;--- Win32 "hello world" console application.
;--- assemble: JWasm Win32_1.ASM
;--- link: WLINK system nt file Win32_1.OBJ
.386
.model FLAT, stdcall
option casemap:none
STD_OUTPUT_HANDLE equ -11
WriteConsoleA proto :dword, :dword, :dword, :dword, :dword
GetStdHandle proto :dword
ExitProcess proto :dword
.const
string db 13,10,"hello, world.",13,10
.code
main proc
local dwWritten:dword
local hConsole:dword
invoke GetStdHandle, STD_OUTPUT_HANDLE
mov hConsole,eax
invoke WriteConsoleA, hConsole, addr string, sizeof string, addr dwWritten, 0
xor eax,eax
ret
main endp
;--- entry
mainCRTStartup proc c
invoke main
invoke ExitProcess, eax
mainCRTStartup endp
end mainCRTStartup
|