English
Language : 

CC78K4 Datasheet, PDF (461/523 Pages) NEC – CC78K4 Ver.2.30 or Later, C Compiler Language
CHAPTER 11 EXTENDED FUNCTIONS
(3) Location and order of storing automatic variables
(a) When the -ZO option is not specified (default)
Automatic variables are allocated to registers and _@KREGXX. However, the automatic variables are
allocated to _@KREGXX only when -QR is specified. For _@KREGXX, refer to APPENDIX A LIST OF
LABELS FOR saddr AREA.
Automatic variables are allocated to registers when there are excess registers after the allocation of
arguments. When -QR is specified, automatic variables are allocated also to _@KREGXX.
If an automatic variable cannot be allocated to registers and _@KREGXX, an error occurs.
The saving and restoring of the register and _@KREGXX to which automatic variables is allocated are
performed in the function definition side.
(Order of allocation)
• The order of allocating automatic variables to registers are the same as the order of allocating arguments.
• The automatic variables allocated to _@KREGXX are allocated in the order of declaration.
(b) When the -ZO option is specified.
• Allocation cannot be performed because the automatic variables cannot be described.
The following shows an example of the interface above.
EXAMPLE
(C source)
noauto void func2 (int, int);
void main ( ) {
func2 (0x1234, 0x5678);
}
noauto void func2 (int p1, int p2) {
/* function body */
}
User’s Manual U15556EJ1V0UM
461