English
Language : 

CC78K0S Datasheet, PDF (419/520 Pages) NEC – C Compiler Ver.1.30 or Later Language
CHAPTER 11 EXTENDED FUNCTIONS
Absolute Address Allocation Specification
_ _directmap
USAGE
• Declare _ _directmap in the module in which the variable to be allocated in an absolute address is to be
defined.
_ _directmap Type name Variable name
= Allocation address specification;
_ _directmap static Type name Variable name
= Allocation address specification;
_ _directmap _ _sreg Type name Variable name
= Allocation address specification;
_ _directmap _ _sreg static
Type name Variable name = Allocation address specification;
• If _ _directmap is declared for a structure/union/array, specify the address in braces {}.
• _ _directmap does not have to be declared in a module in which a _ _directmap external variable is
referenced, so only declare extern.
extern Type name Variable name;
extern _ _sreg Type name Variable name;
• To generate the saddr instruction in a module in which a _ _directmap external variable allocated inside the
saddr area is referenced, _ _sreg must be used together to make extern_ _sreg Type name Variable name;.
EXAMPLE
(C source)
_ _directmap char c = 0xfe00;
_ _directmap _ _sreg char d = 0xfe20;
_ _directmap _ _sreg char e = 0xfe21;
_ _directmap struct x {
char a;
char b;
} xx = {0xfe30};
void main()
{
c = 1;
d = 0x12;
e.5 = 1;
xx.a = 5;
xx.b = 10;
}
User’s Manual U14872EJ1V0UM
419