In Icz Tut 3 I saw that

invoke WinMain,hInstance,NULL,CommandLine,SW_SHOWDEFAULT
WinMain proc hInst:HINSTANCE,hPrev:HINSTANCE,CmdLine:LPSTR,CmdShow:DWORD

and below in the code which initialize WNDCLASSEX.hInstance
I see a push hInstance
and a pop WNDCLASSEX.hInstance
why can't we grant directly hInst to WNDCLASSED.hInstance when HINSTANCE is defined as DWORD ??
I tried it , but MASM pop up an compiler - error .
But I really don't know , why we must push a global variable and pop it when we passing it through WinMain ??:confused: :confused:
Posted on 2003-04-16 07:46:46 by dreamweaver
We cannot move memory to memory in a single instruction, thus you have to either use the stack
push mem1

pop mem2

or use a free register


mov eax,mem1
mov mem2,eax

PS there are some macro such as
MOVmd	MACRO Var1, Var2

push Var2
pop Var1
ENDM
Posted on 2003-04-16 07:51:44 by roticv
many thanks for it :grin: :grin:
Posted on 2003-04-16 22:52:41 by dreamweaver