English
Language : 

CC78K4 Datasheet, PDF (468/523 Pages) NEC – CC78K4 Ver.2.30 or Later, C Compiler Language
CHAPTER 11 EXTENDED FUNCTIONS
(Output code)
With small model (when -QF option is specified)
_main:
; line 4 : func0(0x1234, 0x5678);
movw ax,#05678H ; 22136
push ax
movw ax,#01234H ; 4660
; Argument is passed via a stack
; The first argument is passed via a register
call !_func0
; Function call
; Stack is not corrected here
ret
; line 6 : _ _pascal void func0(register int p1, int p2)
; line 7 : {
_func0:
push rp3,up
; Saves the register for register variables
; or register arguments
movw rp3,ax
push ax
; Allocates a register argument to rp3
; Reserves the area for automatic variable a
; line 8 : register int r;
; line 9 : int a;
; line 10 : r = p2;
movw ax,[sp+9]; p2
movw up,ax
; Argument p2 is passed via stack
; Register variable up
; line 11 : a = p1;
movw ax,rp3
; Register argument rp3
movw [sp+0],ax ; a
; Automatic variable a
pop ax
pop rp3,up
; Releases the area for automatic variable a
; Restores the register for register variables
; or register arguments
pop hl
; Obtains the return address
incg sp
;
pop ax
; The stack consumed by arguments passed via a
; stack is corrected
br hl
; Branch to the return address
468
User’s Manual U15556EJ1V0UM