Again this is flexible, particularly where there can be very few registers. These are the general guidelines.
All byte arguments are promoted to 16-bits.
Arguments are passed in
R2
–R7
(or
R2
–R
max
if there are fewer than 8 registers).
Results are returned on the same registers used to pass arguments.
Varargs are always passed on the stack.
A good guideline is that approximately one third of unallocated
registers should be caller saved, although that can increase to
one half where there are plenty of registers. The following
registers (if present) are caller saved: R10
,
R13
, R16
,
R19
, R22
,
R25
, R28
,
R31
, R33
,
R35
, R37
,
R39
, R41
,
R43
, R45
,
R47
, R49
,
R51
, R53
,
R55
, R57
,
R59
, R61
and
R63
.