我的第一个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

运行结果:

posted @ 2012-01-11 14:47  luzhiyuan  阅读(470)  评论(0编辑  收藏  举报