These parameter passing and return value conventions apply for the RS08:
- Registers used for Parameter Passing (only for parameter lists without the ellipsis):
- if the last parameter is 8-bit large, the parameter is passed in register A
- all other are parameters passed using the shared section (OVERLAP)
- Parameter naming conventions for the shared OVERLAP section are zero-relative starting from the last parameter. In other words:
- __OVL_funcname_p0 indicates the last parameter
- __OVL_funcname_p1 indicates the next to the last parameter
- __OVL_funcname_p2 indicates the third from the last parameter, and so on.
- Ellipsis (for open parameters): Pass open parameters using a parameter block allocated in the local scope of the caller. The address of this block is passed implicitly together with the last declared parameter. The callee uses this address to get the open parameters:
unsigned char __OVL_callerfuncname_pblock [MAX_BLOCK_SIZE] // MAX_BLOCK_SIZE is the maximum of bytes needed by a caller to pass open parameters
- The following return address is used for non-leaf functions or for functions that call the runtime library):
unsigned char __OVL_funcname_ra[2] // 2 bytes for return address of caller