English
Language : 

CC78K0S Datasheet, PDF (448/520 Pages) NEC – C Compiler Ver.1.30 or Later 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 arguments declared with registers and 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.
• Saving and restoring registers to which arguments are allocated is performed on the function definition side.
• 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.
• The register arguments are copied to a register or _@KREGxx. Copying to _@KREGxx is performed only
when -QR is specified. Even when the arguments are passed via registers, register copying is necessary
since the registers on the function caller (passing side) are different to those on the function definition side
(receiving side).
• On the function caller side, both register arguments and normal arguments are passed using the same
method.
The second or later arguments are passed via a stack. The first argument is passed via a register or stack.
Refer to Table 11-17 for the place where the first argument is passed.
(Registers to be used)
HL
Arguments are not allocated to HL when there is a stack frame.
(saddr area to be used)
_@KREG12 to 15
(Allocation sequence)
• Registers
char type:
The sequence is L-H.
int, short, and enum type: HL
• saddr area
char type:
The sequence is _@KREG12, _@KREG13, _@KREG14, and _@KREG15.
int, short, and enum type: The sequence is _@KREG12 to 13 and _@KREG14 to 15.
long, float, double type: The sequence is _@KREG12 to 13 (lower)-_@KREG14 to 15 (higher).
448
User’s Manual U14872EJ1V0UM