QPROC ( Quick procedure ) macro :
QPROC MACRO fname:REQ,arguments:VARARG
LOCAL temp
temp TEXTEQU <>
FOR arg,<arguments>
temp CATSTR temp,<arg>,<:DWORD,>
ENDM
fname PROC @SubStr(temp,1,@SizeStr(temp)-1)
ENDM
Replacing the traditional procedure definition :
WinMain PROC hInst:DWORD,hPrevInst:DWORD,CmdLine:DWORD,CmdShow:DWORD
QPROC WinMain,hInst,hPrevInst,CmdLine,CmdShow
Unlikely, but what if arguments is blank?
Hi sinsi,
If there are no arguments, it means that the procedure does not take any parameters so no need to use the macro.
That's why I said unlikely, but consider how many people use
invoke InitCommonControls
Just curious, but which part would poasm throw an error? The FOR part or @SubStr?
Hi sinsi,
invoke InitCommonControls
This call has nothing to do with my macro. InitCommonControls is a procedure stored in comctl32.dll
OK, poor example, it was just to illustrate that people follow habits, so if they see a lot of QPROCs they might think that's the way to do it.
WinMain PROC hInst,hPrevInst,CmdLine,CmdShow
QPROC WinMain,hInst,hPrevInst,CmdLine,CmdShow
Not a great deal of difference - or does poasm expect the size as well?
Hi sinsi,
Jochen informed me about the case, this declaration is accepted by Poasm so my macro is useless :
WinMain PROC hInst,hPrevInst,CmdLine,CmdShow
This is for Poasm 64-bit, the PROCX macro sets automatically the PARMAREA value :
PROCX MACRO functionname:REQ,args:VARARG
fname TEXTEQU functionname
functionname PROC args PARMAREA=16*QWORD
ENDM
ENDPX MACRO
fname ENDP
ENDM
The maximum number of parameters ( 16 by default ) can be modified easily.