English
Language : 

CC78K0S Datasheet, PDF (315/520 Pages) NEC – C Compiler Ver.1.30 or Later Language
CHAPTER 11 EXTENDED FUNCTIONS
Register Variables
register
• When the -SM option is specified (Example of register variable allocation to register DE)
_main:
push de
movw
movw
incw
movw
xch
mov
add
xch
addc
mov
call
pop
ret
de, #00H; 0
de, ax
ax
!?L0003+1, a
a, x
!?L0003, a
a, e
a, x
a, d
de, ax
!_func
de
; Saves the contents of the register at the beginning of the function
;
;
;
;
;
;
;
;
;
;
; Restores the contents of the register at the end of the function
EXPLANATION
• To use register variables, you only need to declare them with the register storage class specifier.
• Labels such as _@KREG00 include the modules declared with PUBLIC in the library attached to this C
compiler.
COMPATIBILITY
<From another C compiler to this C compiler>
• The C source program need not be modified if the other C compiler supports register declarations.
• To change to register variables, add the register declarations for the variables to the program.
<From this C compiler to another C compiler>
• The C source program need not be modified if the other compiler supports register declarations.
• How many variable registers can be used and to which area they will be allocated depends on the
implementations of the other C compiler.
User’s Manual U14872EJ1V0UM
315