我使用FASM編譯小塊代碼:彙編程序:使用「Flat assembler」如何生成EXE文件(編譯,鏈接..)?
mov ah,4ch
mov al,00
int 21h
我點擊運行 - >編譯,我得到的是一個.BIN文件。 對於沒有問題的問題感到抱歉,但爲什麼我沒有得到OBJ或EXE文件,這個BIN是什麼?
我使用FASM編譯小塊代碼:彙編程序:使用「Flat assembler」如何生成EXE文件(編譯,鏈接..)?
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
雅知道了,他們有自己的論壇。 http://board.flatassembler.net/