Keil™, An ARM® Company

CARM User's Guide

Discontinued

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 TypeBitsRegisterDescription
signed char8R0Value returned in the low byte of R0.
unsigned char8R0Value returned in the low byte of R0.
signed short16R0Value returned in the low half-word of R0.
unsigned short16R0Value returned in the low half-word of R0.
signed int32R0Value returned in R0.
unsigned int32R0Value returned in R0.
signed long32R0Value returned in R0.
unsigned long32R0Value returned in R0.
float32R0Value returned in R0.
pointer32R0Value returned in R0.
signed long long64R0-R1Low word returned in R0. High word returned in R1.
unsigned long long64R0-R1Low word returned in R0. High word returned in R1.
double64R0-R1Low word returned in R0. High word returned in R1.
struct R0-R3Structs with a total size less than 16 bytes are returned in R0-R3.