wait_key function adapted from the Masm32 package :
.386
.model flat,stdcall
option casemap:none
includelib \PellesC\lib\Win\kernel32.lib
includelib msvcrt.lib
include WaitKeySample.inc
.data
message db 'This is a wait_key test.',13,10
db 'Press any key to exit.',13,10,0
f1 db 'Key = %c',0
.code
start:
invoke printf,ADDR message
invoke wait_key
invoke printf,ADDR f1,eax
invoke ExitProcess,0
wait_key proc
invoke GetStdHandle,STD_INPUT_HANDLE
invoke FlushConsoleInputBuffer,eax
@@:
invoke Sleep, 1
invoke _kbhit
test eax, eax
jz @b
call _getch
ret
wait_key ENDP
END start