Xref: utzoo comp.unix.wizards:16662 comp.lang.c:19172 Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!ames!apple!desnoyer From: desnoyer@Apple.COM (Peter Desnoyers) Newsgroups: comp.unix.wizards,comp.lang.c Subject: Re: Needed: A (Portable) way of setting up the arg stack Keywords: 1/varargs, callg Message-ID: <32256@apple.Apple.COM> Date: 5 Jun 89 17:12:46 GMT References: <708@mitisft.Convergent.COM> <32208@apple.Apple.COM> <10354@smoke.BRL.MIL> <11830@bloom-beacon.MIT.EDU> Organization: Apple Computer Inc, Cupertino, CA Lines: 15 In article <11830@bloom-beacon.MIT.EDU> scs@adam.pika.mit.edu (Steve Summit) writes: > [routine called va_call that takes a function pointer, an argument > count, and an array of arguments] > >va_call can be implemented in one line of assembly language... >A routine such as va_call MUST be written in assembly language; it >is one of the handful of functions I know of that cannot possibly >be written in C. Almost correct. In Turbo C there are pseudo-variables for the stack pointer, etc. You can also access these registers (warning - approaching gross kludge) by doing a setjmp and knowing the jmp_buf format. Peter Desnoyers