我尝试在 FASM 上编写我的第一个 .exe 程序。当我使用 org 100h 时它工作正常,但我想编译 .exe 文件。当我用“format PE GUI 4.0”替换第一行并尝试编译它时,发生了错误:“值超出范围”(行:mov dx,msg)。
ORG 100h ;format PE GUI 4.0
mov dx,msg
mov ah,9h
int 21h
mov ah,10h
int 16h
int 21h
msg db "Hello World!$"
我应该如何更改源代码?
----------------------------------------------
答案是:
format mz
org 100h
mov edx,msg
mov ah,9h
int 21h
mov ah,10h
int 16h
mov ax,$4c01
int 21h
msg db "Hello World!$"