English
Language : 

CC78K0S Datasheet, PDF (457/520 Pages) NEC – C Compiler Ver.1.30 or Later Language
CHAPTER 11 EXTENDED FUNCTIONS
11.7.4 norec function call interface (normal model)
(1) Passing arguments
All arguments are allocated to _@NRARGx and _@RTARG6 and 7. On the function caller side, arguments are
passed via register _@NRARGx.
On the function definition side, arguments passed via registers are copied to registers, or to _@RTARG6 and 7
(Refer to APPENDIX A LIST OF LABELS FOR saddr AREA).
(2) Location and order of storing arguments
• On the function definition side, all arguments are allocated to registers, _@NRARGx, _@RTARG6 and 7.
Arguments are allocated to _@NRARGx only when -QR is specified.
• Arguments are allocated to _@RTARG6 and 7 only when there are arguments in DE (Refer to APPENDIX A
LIST OF LABELS FOR saddr AREA).
• If there are arguments that are not allocated to registers, _@NRARGx, _@RTARG6 and 7, an error will result.
• On the function caller side, arguments are passed via registers and _@NRARGx.
• On the function definition side, arguments that are passed via registers are copied to registers or _@RTARG6
and 7. Even when the arguments are passed via registers, register copying is necessary since the registers
on the function caller side (passing side) are different to those in the function definition side (receiving side).
If the arguments are passed via registers, the area where the arguments are passed becomes the area to
which they are allocated.
• If arguments can no longer be passed via a register, they can be allocated to _@NRARGx and passed via
there. In this case, passing is carried out with registers and _@NRARGx intermingled.
(Argument allocation sequence)
• Arguments allocated to _@NRARGx are allocated in the sequence of declaration.
• Arguments allocated to registers are allocated to registers, _@RTARG6 and 7 according to the following
rules.
(Registers to be used)
• When one argument is used in char, int, short, enum, or pointer type:
AX pass, DE receive
• When two or more arguments are used in char, int, short, enum, or pointer type: AX and DE pass
_@RTARG6, 7
DE receive
(Allocation sequence)
• char, int, short, enum, and pointer type:
In the sequence of DE,
_@RTARG6 and 7
User’s Manual U14872EJ1V0UM
457