English
Language : 

CC78K4 Datasheet, PDF (304/523 Pages) NEC – CC78K4 Ver.2.30 or Later, C Compiler Language
CHAPTER 11 EXTENDED FUNCTIONS
Usage of saddr Area
-RD
(2) Usage with saddr automatic allocation option of external variables/external static variables
FUNCTION
• External variables/external static variables (except const type) are automatically allocated to the saddr2 area
regardless of whether an sreg declaration is made or not.
• Depending on the value of n, the external variables and external static variables to allocate can be specified
as follows.
Table 11-10. Variables Allocated to saddr2 Area by -RD Option
Value of n
If 1
If 2
If 4
If omitted
Variables Allocated to saddr2 Area
Variables of char and unsigned char types
Variables if n is 1 and variables of short, unsigned short, int, unsigned int, enum,
small model pointer, and medium model data pointer type
Variables if n is 2 and variables of long, unsigned long, float, double, long double,
medium model pointer, and large model pointer type
All variables (including structures, unions, and arrays in this case only)
• Variables declared with the keyword sreg are allocated to the saddr2 area, regardless of the above
specification.
• The above rule also applies to variables referenced by an extern declaration, and processing is performed as
if these variables were allocated to the saddr2 area.
• The variables allocated to the saddr2 area by this option are treated in the same manner as the sreg
variable. The functions and restrictions of these variables are as described in (1).
METHOD OF SPECIFICATION
Specify the -RD [n] (n: 1, 2, or 4) option.
RESTRICTIONS
• With the -RD [n] option, modules specifying different n values cannot be linked to each other.
304
User’s Manual U15556EJ1V0UM