>- The first four function arguments are passed in registers r0-r3,
> extra parameters are passed on the stack.
More precisely, the first four words of arguments go in registers.
Structures or "long long" values can occupy more than one register, and can
also be split between registers and the stack. Functions that return structs
have a hidden pointer to a return buffer passed in R0, so only three words of
arguments go in registers.
>Floating point arguments go in the first four floating point registers.
ARM GNU/Linux puts floating point arguments in integer registers, though a
single floating point return value can go in f0 if hard float is in use.
GCC doesn't have any support for passing arguments in FPA registers at the
moment.
>- The return value of a function goes into r0.
>I'm not sure if a function should save r1-r3 before calling a function,
>or if the called function should do that.
They are caller-saved. Similarly r0 for procedures that return void.
p.
PGP signature