在我的高中作业中,我必须编写一个程序,该程序使用 DOS 中断来输入和输出字符串而不是 std printf/scanf 但是当我尝试运行此程序时:
format ELF
use16
section '.data' writeable
msg db 'Hello, world!', 0
section '.text' executable
public _main
_main:
mov ebp, esp; for correct debugging
mov ah, 1
int 21h
mov ah,4Ch
int 21h
xor eax, eax
ret
Run Code Online (Sandbox Code Playgroud)
它只是崩溃。我附加的调试,并发现它崩溃在这条线:int 21h。我绝对不知道为什么会发生这种情况。
我使用 FASM、SASM IDE 和 Windows XP SP3 x32