Keil™, An ARM® Company

Cx51 User's Guide

Return Values

MCU registers are always used for function return values. The following table lists the return types and the registers used for each.

Return TypeRegistersStorage Format
bitCarry Flag 
char, unsigned char, 1-byte ptrR7 
int, unsigned int, 2-byte ptrR6 & R7MSB in R6, LSB in R7
long, unsigned longR4-R7MSB in R4, LSB in R7
floatR4-R732-Bit IEEE format
generic ptrR1-R3Memory type in R3, MSB R2, LSB R1