linux x86_64 下编译运行x86 nasm 汇编程序

背景:学习PC Assemble Language。

1. nasm -f elf fileName.asm

这样生成了合适的fileName.o

2. nasm -f elf -d ELF_TYPE asm_io.asm

这样生成了合适的第三步用到的asm_io.o

P.S. 这里就是”ELF_TYPE”, 不要换成其他的如”elf”

3. gcc -m32 -o fileName driver.c asm_io.o

这样就生成了可执行文件fileName

4. ./fileName

这样就运行了!