;--- Win32 "hello world" console application.
;--- The Win32Inc include files are used.
;--- assemble: JWasm Win32_2.ASM
;--- link:     WLINK system nt file Win32_2.OBJ

        .386
        .model FLAT, stdcall
        option casemap:none

        pushcontext listing	;suppress listing of includes
        .nolist
        .nocref
WIN32_LEAN_AND_MEAN equ 1 ;this is to reduce assembly time
        include \win32inc\include\windows.inc
        popcontext listing

        .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