English
Language : 

CC78K4 Datasheet, PDF (456/523 Pages) NEC – CC78K4 Ver.2.30 or Later, C Compiler Language
CHAPTER 11 EXTENDED FUNCTIONS
(2) Location and order of storing arguments
• There are two types of arguments: arguments allocated to registers and ordinary arguments. Arguments
allocated to registers are the arguments declared with registers and the arguments when -QV is specified.
• The arguments not allocated to registers are allocated to stacks. The arguments allocated to stacks are
placed on the stack sequentially from the last argument.
(a) When the -ZO option is not specified
• Saving and restoring registers to which arguments are allocated is performed on the function definition
side.
• When -QV option is specified, the ordinary arguments are also allocated to registers regarding they are
declared with registers.
• The ordinary arguments are allocated to a stack. When the arguments are passed via stacks, the area
where the arguments are passed (stack) is used as the area to which arguments are allocated.
• On the function definition side, the arguments that are passed via a register or stack are stored in the area
to which arguments are allocated.
• Arguments with more references together with register variables are allocated to registers. When the -QF
and -ML options are specified, however, a second or subsequent argument whose size is less than 4-bytes
and number of references is two or less is not always allocated to a register.
Table 11-29. List of Storing Arguments (On Function Definition Side, When -ZO Is Not Specified)
Option
When -QF is specified
When -QF is not specified
Model
Small Model, Medium ModelNote
RP3, VP, UP
RP3, VP
Large Model
RP3, VVP, UUP
RP3, VVP
Note With the medium model, the function pointer (3 bytes) cannot be used as a register argument.
(Order of allocation)
• With small model, medium model, when -QF is specified
char, int, short, enum type: If there is long, float, double type argument, in the order of UP, RP3, VP
char, int, short, enum type: If there is no long, float, double type argument, in the order of RP3, UP,
VP
Pointer type:
In the order of UP, VP, RP3
long, float, double type: RP3 (lower), VP (higher)
• With small model, medium model, when -QF is not specified
char, int, short, enum type: In the order of RP3, VP
Pointer type:
In the order of VP, RP3
long, float, double type: RP3 (lower), VP (higher)
• With large model, when -QF is specified
char, int, short, enum type: If there is long, float, double type argument, in the order of UP, RP3, VP
char, int, short, enum type: If there is no long, float, double type argument, in the order of RP3, UP,
VP
Pointer type:
In the order of UUP, VVP
long, float, double type: RP3 (lower), VP (higher)
456
User’s Manual U15556EJ1V0UM