我正在使用 FASM 编译一小段代码:
mov ah,4ch
mov al,00
int 21h
我点击运行 -> 编译,我得到的是一个 .BIN 文件。 抱歉,我问的是白痴问题,但为什么我没有得到 OBJ 或 EXE 文件,这个 BIN 是什么?
最佳答案
BIN 是一个二进制文件,您需要检查用于传递给 FASM 的命令行选项。根据documentation默认格式是平面二进制文件。引用文档第 2.4 节:
Default output format is a flat binary file, it can also be selected by using format binary directive. This directive can be followed by the as keyword and the quoted string specifying the default file extension for the output file. Unless the output file name was specified from the command line, assembler will use this extension when generating the output file.
所以我认为你的代码应该是这样的:
.use32 .format pe console mov ah,4ch mov al,00 int 21h
编辑:我在点击保存后才意识到,它使用了 16 位寄存器...
.use16 .format MZ mov ah,4ch mov al,00 int 21h
关于x86 - 汇编程序 : Using "Flat assembler" how do I produce EXE files (compile, 链接..)?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2302695/