In a non-leaf function (a function that calls another function), three words are always allocated on the stack for the outgoing parameters that are passed in registers (R0, R1 and R2), even if the called function actually has fewer parameters. The following note is given in the Compiler and Library manual:

"When calling a C function, at least twelve bytes of stack space must be allocated for the function’s arguments, corresponding to R0–R2. This applies even for functions with fewer than 12 bytes of argument data, or that have fewer than three arguments. Note that the called function is permitted to modify the contents of this stack space."

These stack locations are in the caller's frame, but the callee is permitted to use them as additional stack space for temporary storage of the parameters R0 to R2 or for any other purpose. The calling function should therefore not make any assumptions about what is contained in those three locations across a call.

In a non-leaf function (a function that calls another function), three words are always allocated on the stack for the outgoing parameters that are passed in registers (R0, R1 and R2), even if the called function actually has fewer parameters. The following note is given in the Compiler and Library manual:

"When calling a C function, at least twelve bytes of stack space must be allocated for the function’s arguments, corresponding to R0–R2. This applies even for functions with fewer than 12 bytes of argument data, or that have fewer than three arguments. Note that the called function is permitted to modify the contents of this stack space."

These stack locations are in the caller's frame, but the callee is permitted to use them as additional stack space for temporary storage of the parameters R0 to R2 or for any other purpose. The calling function should therefore not make any assumptions about what is contained in those three locations across a call.