;------------------------------------------------------------------ ; ; HelloWorld1 - copyright Jeremy Gordon 2002 ; ; SIMPLE "HELLO WORLD" WINDOWS CONSOLE PROGRAM - for GoAsm ; ; Assemble using GoAsm HelloWorld1 (produces PE COFF file) ; Then link as windows console program using GoLink as follows:- ; GoLink /console helloworld1.obj kernel32.dll ; (add -debug coff if you want to watch the program in the debugger) ; ; Note that the GetStdHandle and WriteFile calls are to kernel32.dll ;------------------------------------------------------------------ ; DATA SECTION ; RCKEEP DD 0 ;temporary place to keep things ; CODE SECTION ; START: PUSH -11D ;STD_OUTPUT_HANDLE CALL GetStdHandle ;get, in eax, handle to active screen buffer PUSH 0,ADDR RCKEEP ;RCKEEP receives output from API PUSH 24D,'Hello World (from GoAsm)' ;24=length of string PUSH EAX ;handle to active screen buffer CALL WriteFile XOR EAX,EAX ;return zero RET