English
Language : 

CC78K4 Datasheet, PDF (295/523 Pages) NEC – CC78K4 Ver.2.30 or Later, C Compiler Language
(2) Register variables
Register Variables
CHAPTER 11 EXTENDED FUNCTIONS
register
FUNCTION
• Allocates the declared variables (including arguments of function) to the register (RP3, VP) and saddr2 area
(_@KREG00 to _@KREG15). Saves and restores registers or saddr2 area during the preprocessing/
postprocessing of the module that declared a register.
• When the -ZO option is specified, register variables are allocated in the order of declaration. When the -ZO
option is not specified (default), on the other hand, the allocation is performed based on the number of
references. Therefore, it is undefined to which register or saddr2 area the register variable is allocated. For
details of the allocation of register variables, refer to 11.7 Function Call Interface.
• Register variables are allocated to different areas depending on the compilation condition as shown below (for
each option, refer to the CC78K4 C Compiler Operation User’s Manual (U15557E)).
1. Register variables are allocated to saddr2 area only when the -QR option is specified.
2 When the -QF option is specified and the -ZO option is not specified, register variables are also allocated
also to register UP.
3. When neither the -ZO option nor the -QF option is specified, all the register arguments and register
variables are allocated to registers and saddr2 area. When there is no argument or automatic variable
allocated to the stack area (that is, a stack frame is not generated), register variables are also allocated to
register UP (when the -ML option is specified and the -QR option is not specified, however, register
variables are allocated only if the total size allocated to the register is 6 bytes or less assuming the pointer
is 3 bytes).
User’s Manual U15556EJ1V0UM
295