I am using terminal on mac. I did 'vim hello_worldd.asm' and it created a place for me to write my code.
But I don't know how to exit and run it. Is there a command to do so?
I am using terminal on mac. I did 'vim hello_worldd.asm' and it created a place for me to write my code.
But I don't know how to exit and run it. Is there a command to do so?
To exit Vim, hit the ESC
key to go to normal mode and then type: :wq
to exit and save changes.
For NASM, use:
nasm -f elf file.asm
to compile it.
Then you must link it so you can use:
ld -s -o outfile file.o
Then run with: ./outfile
.
If you can't run ./outfile
. You probably have a permission issue. Which you can fix by using chmod
doing: chmod +x outfile
.