Running, debugging Assembly code/script.

Running Assembly file :

To compile a Assembly file, It need to be in FILENAME.asm , and use nasm command in Terminal. As follow :
nasm -f elf64 FILENAME.asm
FILENAME.o will be created at the same directory, then run :
ld -s -o FNAME FILENAME.o to create an executable.
Finally, to run the exxcutable in Terminal ./FNAME

Debbugging Assembly file :

To compile a Assembly file, It need to be in FILENAME2.asm , and use nasm command in Terminal. As follow :
nasm -f elf64 -g -F stabs FILENAME2.asm -o FILEBUG.o
FILEBUG.o will be created at the same directory, then run :
ld -m elf_x86_64 -s -o FILEBUGED FILEBUG.o to create an executable.
Finally, to debug the excutable in Terminal gdb FILEBUGED

Comments

Popular Posts