home .. forth .. misc mail list archive ..

Re: Variable number of arguments in registers


>n the SPARC, which has a slidding window of register sets for function calls,
>an interrupt is generated when the slidding window "overflows" to allow the
>saving(push)/restoring(pop) of the deepest register set, but the number of
>registers in a set is still limited to 8 for argument passing (plus 8 for local
>variables).  I have not looked in detail how they handle the case of functions
>with more than 8 arguments (or more than 8 local variables), but I think that
>they use an auxiliary stack in memory (pointed to by one of the 7 "global"
>registers available) and generate code to push/pop it in such a case.

 I have looked at this just recently (when I had to port my DOOF
to a SPARC). They push the excess arguments to the stack.
Actually only 6 (and not 8) arguments can be passed in the in/out
register for the return address and tre stack pointer is also
among those registers (and not a global register).
I did not try to look at printf() though.

Andras