News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

help reading example file opengl.asm

Started by supercoollee, May 05, 2010, 04:11:05 PM

Previous topic - Next topic

supercoollee

DoEvents      PROC
         LOCAL   msg:MSG
StartLoop:
         invoke   PeekMessage,ADDR msg,0,0,0,PM_NOREMOVE
         or   eax,eax
         jz   NoMsg
         invoke   GetMessage,ADDR msg,NULL,0,0
         or   eax,eax
         jz   ExitLoop
         invoke   TranslateMessage,ADDR msg
         invoke   DispatchMessage,ADDR msg
         jmp   StartLoop
NoMsg:
         invoke   DrawScene
         jmp   StartLoop
ExitLoop:      mov   eax,msg.wParam
         ret
DoEvents      ENDP
========================================
in here, what is the meaning of "msg.wParam" ?

another thing, why in "Procedures Declarations" there is no "DoEvents PROTO ... "?
when should a PROC have the PROTO line ?

clive

wParam is a "word" parameter within the MSG structure. In Win32 it is a DWORD value, it was a WORD in Win16. In this case it contains a return value for the message loop when you quit.

You only need PROTO when the procedure is external to the ASM file you are using, or you use INVOKE before defining the body of the procedure (PROC/ENDP).
It could be a random act of randomness. Those happen a lot as well.

supercoollee

thanks.
so MSG is a predefined structure, if i don't know about this structure, i can't write the program by my own, is that right?
where can i learn about these basic predefined structures?

qWord

FPU in a trice: SmplMath
It's that simple!

joemc


GregL