;一個匯編版本的 hello world
;test.asm
;a hello world program with asm
.386P
.model FLAT
include listing.inc
INCLUDELIB LIBCD
INCLUDELIB OLDNAMES
PUBLIC _main
PUBLIC szHelloWorld
EXTERN _printf:NEAR
CONST SEGMENT
?szHelloWorld DB 'Hello World!', 0aH, 00H
CONST ENDS
_TEXT SEGMENT
_argc$ = 8
_argv$ = 12
_main PROC NEAR
?push OFFSET FLAT:szHelloWorld
?call _printf
?add esp, 4
?xor eax, eax?
?ret 0
_main ENDP
_TEXT ENDS
END
?
;編譯命令
;ml.exe??? /c?? /coff??? test.asm
;link /out:test.exe /subsystem:console kernel32.lib test.obj