我的第一个Win32汇编程序 HelloWorld
代码:
1 .386
2 .model flat,stdcall
3 option casemap:none
4 ;include文件
5 include windows.inc
6 include user32.inc
7 includelib user32.lib
8 include kernel32.inc
9 includelib kernel32.lib
10 ;数据段
11 .data
12 szCaption db 'MessageBox!',0
13 szText db 'Hello,World!',0
14 ;代码段
15 .code
16 start:
17 invoke MessageBox,NULL,\
18 offset szText,\
19 offset szCaption,\
20 MB_OK
21 invoke ExitProcess,NULL
22 end start
运行结果: