一个很简单的Win32汇编程序
时间:2010-11-14 来源:老钟古
1
2 ;文件名 msgbox.asm
3 ;作者 StudyRush
4 ;创建时间 2010-11-14
5 ;修改时间 2010-11-14
6 ;函数功能 用于显示一个窗口和在里面显示消息
7
8
9 .386
10 .model flat, stdcall
11 option casemap : none
12
13 include windows.inc
14 include user32.inc
15 includelib user32.lib
16 include kernel32.inc
17 includelib kernel32.lib
18 include gdi32.inc
19 includelib gdi32.lib
20
21
22 .data
23 MsgBoxCaption db "StudyRush", 0
24 MsgBoxText db "Win32 Assembly is Great!", 0
25 MBC db "NO", 0
26 MBT db "OK YOU ARE SO GOOD", 0
27
28
29 .code
30 start:
31
32 invoke MessageBox, NULL, addr MsgBoxText, addr MsgBoxCaption, MB_YESNOCANCEL
33 invoke MessageBox, NULL, addr MBT, addr MBC, MB_OK
34 invoke ExitProcess, NULL
35
36 end start
37
38
2 ;文件名 msgbox.asm
3 ;作者 StudyRush
4 ;创建时间 2010-11-14
5 ;修改时间 2010-11-14
6 ;函数功能 用于显示一个窗口和在里面显示消息
7
8
9 .386
10 .model flat, stdcall
11 option casemap : none
12
13 include windows.inc
14 include user32.inc
15 includelib user32.lib
16 include kernel32.inc
17 includelib kernel32.lib
18 include gdi32.inc
19 includelib gdi32.lib
20
21
22 .data
23 MsgBoxCaption db "StudyRush", 0
24 MsgBoxText db "Win32 Assembly is Great!", 0
25 MBC db "NO", 0
26 MBT db "OK YOU ARE SO GOOD", 0
27
28
29 .code
30 start:
31
32 invoke MessageBox, NULL, addr MsgBoxText, addr MsgBoxCaption, MB_YESNOCANCEL
33 invoke MessageBox, NULL, addr MBT, addr MBC, MB_OK
34 invoke ExitProcess, NULL
35
36 end start
37
38
这个程序也一定程度说明了自己以后的代码风格,学一些大师写程序的代码风格,这样自己也能够收获很多。
相关阅读 更多 +
排行榜 更多 +