English
Language : 

CC78K4 Datasheet, PDF (308/523 Pages) NEC – CC78K4 Ver.2.30 or Later, C Compiler Language
CHAPTER 11 EXTENDED FUNCTIONS
Usage of saddr Area
_ _sreg1
(Assembler source)
The following example shows a definition code for a sreg1 variable that the user creates. If an extern declaration is
not made in the C source, the C compiler outputs the codes in the same way as those of assembler source. In this
case, the ORG quasi directive will not be output.
PUBLIC _s1
PUBLIC _s2
PUBLIC _sptr
;Declaration
;
;
@@DATS1 DSEG SADDR
ORG 0FFE00H
_s1: DS
(2)
_s2: DS
(2)
_sptr: DS
(3)
;Allocation to segment
;
;
;
;
(Output object of compiler)
EXTRN _s2
EXTRN _s1
PUBLIC _main
@@CODE CSEG
_main:
subw
ret
_s1,_s2
COMPATIBILITY
From another C compiler to this C compiler
• Modification is not required if the keyword _ _sreg1 is not used in the program.
• When changing to sreg1 variables, use the method above.
From this C compiler to another C compiler
• #define must be used. For details, see 11.6 Modifications of C Source. By this modification, sreg1
variables will be handled as ordinary variables.
308
User’s Manual U15556EJ1V0UM