Hi,
Timothy Cameron wrote:
Excuse the dumb question, but why use the stack for "Excess parameters" when the PPC has 32 general purpose and 32 floating point registers?
The other registers (r14 +) are "non-volatile", i.e. they must be preserved across function calls. The compilers uses them for local variables. r0, r3-r10, r11, r12 are volatile, i.e. they need not be preserved (with r3-r10 used as parameters when a function is called). Similar rules are in place for the floating point registers.
Please note the last time I've done any 68K ASM was on the "Sinclair QL" many years ago. I have not looked at PPC ASM yet either.
Is this "System V.4" limitation something to do with GCC?
Well, it's one possible ABI gcc supports (besides PowerOpen, AIX and WindowsNT).
However, it's not really a limitation, but a set of rules. It makes things a lot easier, since parameters are now defined by the C prototype of a function, and no compiler specific bindings for parameter passing is necessary... On the old system, every compiler had it's own rules: Aztec C used to pass parameters on the stack, SAS/C could select stack or register arguments, gcc used stack, etc.
Regards,