English
Language : 

CC78K0S Datasheet, PDF (167/520 Pages) NEC – C Compiler Ver.1.30 or Later Language
CHAPTER 10 LIBRARY FUNCTIONS
Figure 10-1. Stack Area When Function Is Called (No -ZR Specified)
Return value in <5> is stored
Lower 16 bits
Higher 16 bits
Stack pointer after <4>
Stack pointer after <3>
Stack pointer after <2>
Stack pointer after <1>
Stack pointer before
stacking arguments
a
HL
Return address
Lower 16 bits of b
Upper 16 bits of b
c
BC
DE
Stack pointer after <6>
Stack pointer after <7>
Stack pointer after <8>
Stack pointer after <9>
High address
(2) -ZR option specified
The following example shows the procedure of passing arguments and return values when the -ZR option is
specified.
Called function "long func(int a, long b, char *c);"
<1> Placing arguments on the stack (by the caller)
The higher 16 bits of arguments “c” and “b” and the lower 16 bits of argument “b” are placed on the stack in
that order. a is passed by the AX register.
Low address
Stack pointer
Stack pointer before
stacking arguments
High address
Lower 16 bits of b
Higher 16 bits of b
c
User’s Manual U14872EJ1V0UM
167