Path: utzoo!utgpu!water!watmath!clyde!bellcore!tness7!ninja!pollux!dalsqnt!rpp386!jfh From: jfh@rpp386.UUCP (John F. Haugh II) Newsgroups: comp.lang.c Subject: Re: Variable argument lists. Message-ID: <1701@rpp386.UUCP> Date: 13 May 88 04:39:06 GMT References: <14139@brl-adm.ARPA> <11435@mimsy.UUCP> Reply-To: jfh@rpp386.UUCP (The Beach Bum) Organization: Big "D" Home for Wayward Hackers Lines: 35 In article <11435@mimsy.UUCP> chris@mimsy.UUCP writes: >In article <14139@brl-adm.ARPA> bates%falcon.dnet%fermat@bru.mayo.edu >>In VAX C [by which I presume he means some version of VMS C] there >>is a macro called va_count. > >I would bet that it does not work. Try: [ example deleted ] >Chances are the program will print either 5 or 4. Neither is >correct. >-- >In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 7163) this function can be implemented if the C compiler uses the CALLS instruction. CALLS is of the form CALLS #, the number of arguments is stacked by the call instruction and can be found (if i remember - it can be found however) by referencing the value located at (AP). this mechanism also works for the CALLG instruction which expects an argument list which has been setup to include the count. (FORTRAN uses CALLG since the argument list can be statically allocated) when CALLG is executed, AP is loaded with the address provided as the first argument to the instruction. - john. -- John F. Haugh II | "You see, I want a lot. Perhaps I want every River Parishes Programming | -thing. The darkness that comes with every UUCP: ihnp4!killer!rpp386!jfh | infinite fall and the shivering blaze of DOMAIN: jfh@rpp386 | every step up ..." -- Rainer Maria Rilke