What is VARARG? Is it a macro? AFAIK different count of variables. Want to use it in tasm. It's already defined for Masm.
Posted on 2003-02-17 09:56:11 by cakmak
It is a condition where the function being called has a variable number of arguments.

Ordinarily when invoking a function the assembler can type-check against a prototype, but with VARARGS it cannot (the number is beyond predictability). Also this affects the function itself, if the calling convention is STDCALL. Ordinarily the stack cleanup is done within the STDCALL function, but when the number of arguments is indeterimate, it can only be done by the caller (rather than the called), so a STDCALL VARARG'd function does the stack cleaning itself (rather like a C function would).

A classic example is the wsprintf functions. It has two required arguments, and all others are determined by the contents of the "format" string argument.

Posted on 2003-02-17 10:36:46 by Mirno
Thank you.
Posted on 2003-02-17 20:07:21 by cakmak