News:

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

Question

Started by Titan, August 05, 2005, 11:52:55 PM

Previous topic - Next topic

Titan

I want this to be a function, and not a macro:

      Pcall MACRO name:REQ,items:VARARG
        LOCAL arg
        FOR arg,<items>
          push arg
        ENDM
          call name
      ENDM
[quote][/quote]
I get errors that VARARG must be used in C calling convention or something.  Is it possible to make a function out of this?

hitchhikr

Something like that:


Pcall PROC C Function:dword, Nbr_Items:dword, Items:VARARG
mov eax,Nbr_Items
Push_Params: dec eax
push Items[eax * 4]
jnz Push_Params
call Function
ret
Pcall ENDP


Use it like that:


invoke Pcall, addr myproc, 3, 4, 5, 6