 | C166 User's Guide |  |
|
|
| Return ValuesC functions (which are declared as follows) may return a single value with a specified type.
<[>type<]> funcname (<[>args<]>)
where: | type | is the type of the value returned from the function. If no type is specified, int is assumed. | | funcname | is the name of the function. | | args | is the argument list for the function. |
Return values are always returned in registers depending on the return value type. The following table lists return types and the registers used for each. | Return Type | Register(s) | Description |
|---|
| bit | R4.0 | | signed char unsigned char | RL4 | | signed int unsigned int | R4 | | signed long unsigned long | R4-R5 | LSB in R4, MSB in R5. | | float | R4-R5 | 32-bit IEEE format, exponent and sign in R5. | | double | R4-R7 | 64-bit IEEE format, exponent and sign in R7. | | near (2-byte) pointer | R4 | | far (4-byte) pointer huge (4-byte) pointer | R4-R5 | Offset in R4, selector in R5. |
|
|