Keil Logo Arm Logo

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 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-small

Keil logo
Important information

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