写这个程序的目的很明确就是为了学习Win32汇编的,记录下自己的学习过程,感觉学程序设计语言必须学会对比,这样才能够学得更好和更加有目的性,通过对比来发现哪些地方是不足或者是更好的。
![](https://images.cnblogs.com/OutliningIndicators/ContractedBlock.gif)
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
这个程序也一定程度说明了自己以后的代码风格,学一些大师写程序的代码风格,这样自己也能够收获很多。