English
Language : 

CC78K4 Datasheet, PDF (458/523 Pages) NEC – CC78K4 Ver.2.30 or Later, C Compiler Language
CHAPTER 11 EXTENDED FUNCTIONS
(3) Location and order of storing automatic variables
• There are two types of automatic variables: automatic variables to be allocated to registers and ordinary
automatic variables. The automatic variables to be allocated to registers are the ones that are declared with
registers and the automatic variables when -QV is specified. They are allocated to register _@KREGXX as
long as there are allocable registers and _@KREGXX. However, the automatic variables are allocated to
_@KREGXX only when -QR is specified.
The automatic variables allocated to registers and _@KREGXX are called register variables hereafter.
• For _@KREGXX, refer to APPENDIX A LIST OF LABELS FOR saddr AREA.
• The register variables are allocated after register arguments are allocated. Therefore, the register variables
are allocated to registers when there are excess registers after the allocation of register arguments.
• The automatic variables not allocated to registers are allocated to stacks.
• The saving and restoring of registers and _@KREGXX to allocate automatic variables is performed on the
function definition side.
(Order of allocating automatic variables)
• The order of allocating automatic variables to registers are the same as the order of allocating arguments.
For the details, refer to the order of allocating arguments.
• The automatic variables allocated to _@KREGXX are allocated in the order of declaration.
• The automatic variables allocated to stacks are placed on the stack in the order of declaration.
The following shows an example of the interface above.
EXAMPLE 1
(C source)
void func0 (register int, int);
void main () {
func0 (0x1234, 0x5678);
}
void func0 (register int p1, int p2) {
register int r;
int a;
r = p2;
a = p1;
}
458
User’s Manual U15556EJ1V0UM