English
Language : 

CC78K0S Datasheet, PDF (456/520 Pages) NEC – C Compiler Ver.1.30 or Later Language
CHAPTER 11 EXTENDED FUNCTIONS
(Output code)
_main:
; line 4: func2 (0x1234, 0x5678) ;
movw
push
movw
call
pop
ax, #05678H
ax
ax, #01234H
!_func2
ax
; 22136
; 4660
; Argument passed via a stack
; The first argument that is passed via a register
; Function call
; Argument passed via a stack
; line 5: }
ret
; line 6: noauto void func2 (int p1, int p2)
; line 7: {
_func2:
push hl
; Saves a register for arguments
xch
a, x
xch
a, _@KREG12
; Allocates argument p1 to _@KREG12 (lower)
xch
a, x
xch
a, _@KREG13
; Allocates argument p1 to _@KREG13 (higher)
push ax
; Saves the saddr area for arguments
movw ax, sp
movw
mov
hl, ax
a, [hl + 6]
; Argument p2 (lower) passed via a stack
and received via a register
xch
a, x
mov
a, [hl + 7]
movw hl, ax
; Argument p2 (higher) passed via a stack
and received via a register
; Allocates arguments to HL
.
.
.
pop
movw
pop
ax
_@KREG12, ax
hl
; Restores the saddr area for arguments
; Restores the register for arguments
ret
456
User’s Manual U14872EJ1V0UM