Keil Logo

Function Return Values

Function return values are always passed using MCU 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,
unsigned char,
1-byte pointer
R7 Single byte type returned in R7.
int,
unsigned int,
2-byte ptr
R6 & R7 MSB in R6, LSB in R7.
long,
unsigned long
R4-R7 MSB in R4, LSB in R7.
float R4-R7 32-Bit IEEE format.
generic pointer R1-R3 Memory type in R3, MSB R2, LSB R1.
  Arm logo
Important information

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.

Change Settings

Privacy Policy Update

Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers
of your data.