Function return values are always passed using CPU registers. The following table lists the possible return types and the registers used for each.
Return Type |
Register |
Description |
bit |
Carry Flag |
Single bit returned in the carry flag |
char, |
R7 |
Single byte typed returned in R7 |
int, |
R6 & R7 |
MSB in R6, LSB in R7 |
¤ unsigned ¥ long |
R4 - R7 |
MSB in R4, LSB in R7 |
float |
R4 - R7 |
32-Bit IEEE format |
untyped ptr |
R1 - R3 |
Memory type in R3, MSB R2, LSB R1 |