Keil Logo

Function Return Values

Function return values are always passed using CPU registers. The following table lists the possible return values and the registers used for each.

Return Type Bits Register Description
signed char 8 R0 Value returned in the low byte of R0.
unsigned char 8 R0 Value returned in the low byte of R0.
signed short 16 R0 Value returned in the low half-word of R0.
unsigned short 16 R0 Value returned in the low half-word of R0.
signed int 32 R0 Value returned in R0.
unsigned int 32 R0 Value returned in R0.
signed long 32 R0 Value returned in R0.
unsigned long 32 R0 Value returned in R0.
float 32 R0 Value returned in R0.
pointer 32 R0 Value returned in R0.
signed long long 64 R0-R1 Low word returned in R0. High word returned in R1.
unsigned long long 64 R0-R1 Low word returned in R0. High word returned in R1.
double 64 R0-R1 Low word returned in R0. High word returned in R1.
struct   R0-R3 Structs with a total size less than 16 bytes are returned in R0-R3.
  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.