The compiler returns function results in registers A, R0, R2, and Y0:
Additionally, the compiler:
- Reserves R5 for the stack frame pointer when a function makes a dynamic allocation. (This is the original stack pointer before allocations.) Otherwise, the compiler saves R5 across function calls.
- Saves registers C10 and D10 across function calls.
- Does not save registers C2 and D2 across function calls.