"Hello,world!" Win32 Assembly Applet SZTEXT DB "Hello, world!", 0
Szcaption db "Win32asm", 0
.code
start:
push MB_OK
lea eax,szCaption
push eax
lea eax,szText
push eax
push NULL
call messageboxa
xor eax,eax
push eax
call exitprocess
end start
--------------------------------------------------
Compile Link:
In the following two steps:
ML/C/coff 3.asm
Link/subsystem:windows/libpath:d:masm7lib 3.obj
The first step is to compile the 3.obj file
/C means compile only, not link
/coff represents the target file for generating COFF format
The second chain delivered into 3. exe files
/subsystem:windows to generate Windows files
/libpath:d:masm7lib indicates that the path to the citation library is: D:masm7lib.
After installing Masm32, the introduction library is located in the Masm32lib directory.
You can also set the value of environment variable LIB: Type set lib=d:masm7lib at a DOS prompt, so that "link" can be simply written:
Link/subsystem:windows 3.obj, imagine, in the process of debugging, modify the source program is commonly used, each compile link to bring/libpath: ... How annoying would that be? Of course, we can also in the source program directly to the location of the input, so that the link is convenient, as follows:
Includelib D:masm7libkernel32.lib
Includelib D:masm7libuser32.lib
--------------------------------------------------
Execution: At the DOS prompt, type 3, enter, a message box, haha, the real Win32 program!
--------------------------------------------------