English
Language : 

CC78K0S Datasheet, PDF (473/520 Pages) NEC – C Compiler Ver.1.30 or Later Language
CHAPTER 12 REFERENCING THE ASSEMBLER
12.1.2 Static model
• On the function call side, register arguments are passed in the same way as regular arguments.
• Up to 3 arguments, or a total of 6 bytes, can be passed, all via a register.
Table 12-3. Passing Arguments (Function Call Side)
Type
1-byte data
2-byte data
4-byte data
Passing Location (First Argument) Passing Location (Second Argument)
A
B
AX
BC
Allocated to AX and BC, remainder allocated to H or HL
Passing Location (Third Argument)
H
HL
Remark 1- to 4-byte data does not include structures and unions.
• On the function definition side, arguments passed via a register are stored to the argument allocation
location.
Arguments (register arguments) declared with register are allocated to registers whenever possible, and
regular arguments are allocated to areas reserved for specific functions.
• All register arguments are passed via registers, but the registers on the function call side (passing side) and
the function definition side (receiving side) differ, and therefore register copying is performed.
• Saving and restoring of registers to which arguments/automatic variables are allocated is performed on the
function definition side.
• Function arguments and the values of automatic variables declared inside functions are stored in the
function-specific areas listed below using an option. Function-specific areas are static areas in RAM
reserved for each function.
Table 12-4. Storing of Arguments/Automatic Variables (Inside Called Function)
Option
Argument/auto Variable
-QV
Declared argument or
(register allocation option) automatic variable
Storage Location
DE register
Default
Default
Declared argument,
automatic variable
Function-specific area
Argument, register variable
declared with register
DE register
Priority Level
Arguments:
char type: D, E, in this order
int, short, enum type: DE
Automatic variables:
char type: E, D, in this order
int, short, enum type: DE
Arguments are allocated starting from
the 1st argument, automatic variables
are allocated by order of appearance
Only the number of bytes of the
variable or argument is allocated,
according to the number of times
referenced.
Other than the number of bytes of the
variable or argument is allocated to the
area peculiar to the function.
User’s Manual U14872EJ1V0UM
473