Thanks I reread the goAsm manual and the winapi Doc.
but I still have a bug to be solved
Data Section
;
RCKEEP DD 0 ;temporary place to keep things
toConsole DD 0 ; HANDLE WINAPI GetStdHandle(
; _In_ DWORD nStdHandle
; )
String1 DB 'Hello friend', 0
String2 DB 'Hello FRIEND', 0
STD_OUTPUT_HANDLE Equ -11D ; 11 The standard output device.Initially, this is the active console screen buffer.
Code Section
;
START:
/* Initialize the console */
Push STD_OUTPUT_HANDLE ;STD_OUTPUT_HANDLE
Call GetStdHandle ;get, in eax, handle to active screen buffer
Mov [toConsole], Eax
Call HELLO1
Call HELLO2
Call EXIT
HELLO1:
Push 0, Addr RCKEEP ;RCKEEP receives output from API
Mov Esi, Addr String1 ;gets pointer to
Push 13D, Esi ;13=length of string1
Push [toConsole] ;handle to active screen buffer
CALL WriteFile
Ret
HELLO2:
Push 0, Addr RCKEEP ;RCKEEP receives output from API
Mov Esi, Addr String2 ;gets pointer to
Push 13D, Esi ;13=length of string2
Push [toConsole] ;handle to active screen buffer
CALL WriteFile
Ret
EXIT:
Xor Eax, Eax ;return zero
Ret
It repeats 3 time "hello friend" .It should prints only two messages
maybe the EXIT code is the issue