Nasm命令
Nasm –f <format> <filename> [-o output]
例子:
Nasm –f elf myfile.asm
Nasm –f bin myfile.asm –o myfile.com
在源文件左边用16进制显示代码使用如下指令
Nasm –f coff myfile.asm –f myfile.lst
获得帮助
Nasm –h
获得可用输出文件格式
Nasm –hf
如果你使用linux但是不确定是a.out或是ELF
File nasm
Nasm –f elf
Nasm –f aout
将编译错误信息写到文件
Nasm –z myfile.err –f obj myfile.asm
包含包含助编译文件路径
Nasm –I c:\macrolib –f obj myfile.asm
包含文件到被编译文件
Nasm myfile.asm –p myinc.inc等价于把 %include “myinc.inc”被编译文件头
定义常量
Nasm myfile.asm –d FOO=100等价于把%define FOO 100放在被编译文件头
去除常量定义
Nasm myfile.asm –d FOO=100 –uFOO
编译优化,使到目标文件短小
-O1 不优化
-O2 最小优化
-Ox 多途径优化,很多用户需要使用