X86 汇编程序:使用;“平面汇编程序”;如何生成EXE文件(编译、链接..)?

X86 汇编程序:使用;“平面汇编程序”;如何生成EXE文件(编译、链接..)?,x86,assembly,fasm,X86,Assembly,Fasm,我正在使用FASM编译一小段代码: mov ah,4ch mov al,00 int 21h 我点击Run->Compile,得到的是一个.BIN文件。 对于noobish的问题很抱歉,但是为什么我不获取一个OBJ或EXE文件,而这个BIN是什么?这个BIN是一个二进制文件,您需要检查用于传递给FASM的命令行选项。根据默认格式,默认格式为平面二进制文件。引用文件第2.4节: Default output format is a flat binary file, it can

我正在使用FASM编译一小段代码:

  mov ah,4ch
  mov al,00
  int 21h 
我点击Run->Compile,得到的是一个.BIN文件。
对于noobish的问题很抱歉,但是为什么我不获取一个OBJ或EXE文件,而这个BIN是什么?

这个BIN是一个二进制文件,您需要检查用于传递给FASM的命令行选项。根据默认格式,默认格式为平面二进制文件。引用文件第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. 默认输出格式为平面二进制文件,也可以使用 格式化二进制指令。此指令后面可以跟as关键字和 带引号的字符串,指定输出文件的默认文件扩展名。 除非从命令行指定了输出文件名,否则汇编程序将 生成输出文件时使用此扩展名。 因此,我认为您的代码应该如下所示:

.use32 .format pe console mov ah,4ch mov al,00 int 21h .use32 .格式化pe控制台 mov啊,4ch 莫夫艾尔,00 int 21h 编辑:我在点击Save后才意识到,使用的是16位寄存器

.use16 .format MZ mov ah,4ch mov al,00 int 21h .use16 .格式MZ mov啊,4ch 莫夫艾尔,00 int 21h
你知道,他们有自己的论坛。