简单的代码,应用程序已停止工作
我开始使用 fasm 学习 asm,不幸的是在编译下面的代码后我得到错误:“应用程序已停止工作”,我使用 Win7 64 位。有人知道为什么它不起作用吗?
format PE Console 4.0
include 'win32a.inc'
push MB_OK
push _tresc
push _tytul
push 0
call [MessageBoxA]
push 0
call [ExitProcess]
mov eax,0
ret
_tytul db "Tytul",0
_tresc db "Hello world :)",0
data import
library user32,'USER32.DLL'
library kernel32,'KERNEL32.DLL'
import user32,\
MessageBoxA,'MessageBoxA'
import kernel32,\
ExitProcess,'ExitProcess'
end data
I start to learn asm using fasm, unfortunately after compile code below I get error: "app has stopped working", I use Win7 64bit. Has anybody any idea why it doesn't work?
format PE Console 4.0
include 'win32a.inc'
push MB_OK
push _tresc
push _tytul
push 0
call [MessageBoxA]
push 0
call [ExitProcess]
mov eax,0
ret
_tytul db "Tytul",0
_tresc db "Hello world :)",0
data import
library user32,'USER32.DLL'
library kernel32,'KERNEL32.DLL'
import user32,\
MessageBoxA,'MessageBoxA'
import kernel32,\
ExitProcess,'ExitProcess'
end data
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
只能有一个库宏调用。您的 ExitProcess 未导入并调用错误的地址。将所有内容放入一个库调用中:
There can be only one library macro invocation. Your ExitProcess does not get imported and calls the wrong address. Put everything in one library invocation: