English
Language : 

CC78K4 Datasheet, PDF (306/523 Pages) NEC – CC78K4 Ver.2.30 or Later, C Compiler Language
CHAPTER 11 EXTENDED FUNCTIONS
Usage of saddr Area
_ _sreg1
(4) Usage with _ _sreg1 declaration
FUNCTION
• Variables declared with the keyword _ _sreg1 (called sreg1 variables) are automatically allocated to saddr1
[XFE00H to XFE7FH] area (x: 0 or F by specifying location) with relocatability. When the sreg1 variable
exceeds the area shown above, a compilation error occurs.
• saddr1 area [XFE00H to XFEFFH] can be used as sreg1 variables by changing the location of segments in
the assembler source or at the time of linking. However, care must be taken because the compiler uses the
area [XFE80H to XFEFFH] as a general-purpose register area.
• The sreg1 variables are handled in the same manner as ordinary variables in the C source.
• Each bit of sreg1 variables of char/short/int/long type automatically becomes a _ _boolean1 type variable.
• sreg1 variables declared without an initial value take 0 as the initial value.
EFFECT
• Instructions to the saddr1 area are generally shorter in code length than those to memory. This helps shorten
object code and also improves program execution speed.
USAGE
• Declare a variable with the keyword _ _sreg1 inside the module in which the variable is to be defined.
_ _sreg1 type-name variable-name
• Declare the following variables inside the module in which the sreg1 variable is referenced.
extern _ _sreg1 type-name variable-name
306
User’s Manual U15556EJ1V0UM