I have couple of questions on how to convert C code to Assembly and vice versa but with files program.asm, program.o, program, makefile.
First, I have a
lab12.asm
file that is a text file that contains assembly code. Second, I have amakefile
with the following contents:lab12: lab12.o ld -o lab12 lab12.o lab12.o: lab12.asm nasm -f elf64 -g -F dwarf lab12.asm
Now, to generate an executable file called "lab12" and object file called "lab12.o", in Linux terminal we run the command "make". Now we can call debugger and compiler by typing command "kdbg lab12".
This is how to compile and run the Assembly code.
- Now, the second case - C to Assembly. I am using the following two tutorials:
In these cases, we get the following files: program.c, program.s, program. I am interested in that how to create "makefile" for this case to be able to call the "make" command and "kdbg program" command. In this state as it is, we can't call the "kdbg" command.
So, my question for this case is, how to generate files program.asm, program.o, program, makefile, to be able to call "make" command and "kdbg program" command?
- Third case - Assembly to C. How to do this. Again, I want program.asm, program.o, program, makefile files and to be able to call commands "make" and "kdbg program".
Best Regards.