.386 .model flat,stdcall option casemap:none include c:\masm32\include\windows.inc include c:\masm32\include\kernel32.inc includelib c:\masm32\lib\kernel32.lib include c:\masm32\include\user32.inc includelib c:\masm32\lib\user32.lib
.data MsgBoxCaption db "第一个Hello World Win32汇编程序",0 MsgBoxText db "Hello Win32",0
.code start: invoke MessageBox, NULL, addr MsgBoxText, addr MsgBoxCaption, MB_OK invoke ExitProcess, NULL end start
|
设置好masm32环境后。上面代码用文本文件保存。文件名hello.asm
进入控制台使用以下命令:
>ml /c /coff hello.asm
编译后将产生hello.obj目标文件。
>link /subsystem:windows hello.obj
连接目标文件后生成hello.exe可执行文件。
双击即可看到效果。
编译命令: ml /c /coff asm文件路径
连接命令: link /subsystem:windows 产生的目标文件
阅读(459) | 评论(0) | 转发(0) |