Hi friends,
Here is a set of macros simulating the push statement with extended capabilities :
push2 MACRO args:VARARG
FOR p,<args>
push p
ENDM
ENDM
pop2 MACRO args:VARARG
FOR p,<args>
pop p
ENDM
ENDM
pushREV MACRO args:VARARG
LOCAL paramcount,arg
paramcount=@ArgCount(args)
WHILE paramcount
push @ArgI(paramcount,args)
paramcount = paramcount - 1
ENDM
ENDM
Examples :
push2 eax,ebx,ecx,edx outputs the sequence :
push eax
push ebx
push ecx
push edx
pushREV eax,ebx,ecx,edx passes the parameters in reverse order simulating the STDCALL or C parameter passing convention :
push edx
push ecx
push ebx
push eax
Another example :
pushREV eax,<OFFSET DlgName>,NULL,<OFFSET DlgProc>,NULL
[attachment deleted by admin]
Added a popREV macro to pop arguments in reverse order.
[attachment deleted by admin]