Needed: A (Portable) way of setting up the arg stack

Bob Larson blarson at skat.usc.edu
Mon Jun 5 03:43:33 AEST 1989


In article <11830 at bloom-beacon.MIT.EDU> scs at adam.pika.mit.edu (Steve Summit) writes:
>va_call can be implemented in one line of assembly language on
>the VAX; it typically requires ten or twenty lines on other
>machines, to copy the arguments from the vector to the real stack
>(or wherever arguments are really passed).  I have implementations
>for the PDP11, NS32000, 68000, and 80x86.  (This is a machine
>specific problem, not an operating system specific problem.)

??? Then how come my os9/68k compiler for the 68020 uses a different
calling convention than the sun 3 compiler?  This problem is most
definitly dependant on the calling convention your compiler happens
to be using at the moment, which can vary with cpu, operating system,
and even compiler options.

> 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.

This almost sounds like a chalange to find a machine where it can be
done in non-portable C.  I'm sure there is one out there somewhere.

-- 
Bob Larson	Arpa:	blarson at skat.usc.edu
Uucp: {uunet,cit-vax}!usc!skat!blarson
Prime mailing list:	info-prime-request%ais1 at ecla.usc.edu
			usc!ais1!info-prime-request



More information about the Comp.lang.c mailing list