Hi Everyone,
I noticed looking at the masm32 help section the explanation forstandard input and output is rather vague. For example are there more references for these two functions. I have looked at Google search.
Thank you
MBeckford05
In the "good" legacy of UNIX like systems Windows standard input and output are just "files". Hence you can write to standard output by using file write operations on a special file handle obtained by GetStdHandle API.
Something like this:
...
STD_OUTPUT EQU -11
...
.data
std_out_handle dd 0
bytes_wr dd 0
msg_text db "My message for stdout",0
msg_len equ $-msg_text
.code
invoke GetStdHandle,STD_OUTPUT
mov [out_handle],eax
invoke WriteFile,[out_handle],offset msg_txt, msg_len, offset bytes_wr, 0
invoke ExitProcess,0
ret
Study GetStdHandle,WriteFile, and ReadFile API.
Alternatively Windows also has console only API like WriteConsole and related functions.