MASMで「Hello, world!」

MASM32で遊んでみた。
 
<hello.asm>

.386
.model flat, stdcall
option casemap:none
include \masm32\include\windows.inc
include \masm32\include\kernel32.inc
includelib \masm32\lib\kernel32.lib
include \masm32\include\user32.inc
includelib \masm32\lib\user32.lib

.data
MsgBoxCaption db "Assembly", NULL
MsgBoxText db "Hello, world!", NULL
.code
start:
	invoke MessageBox, NULL, addr MsgBoxText, addr MsgBoxCaption, MB_OK
	invoke ExitProcess, NULL
end start

 
ビルド。

ml /c /coff /Cp hello.asm

 
リンク。

link /SUBSYSTEM:WINDOWS /LIBPATH:c:\masm32\lib hello.obj

 
MASMリンク