attribute (at ()) variable attribute
Grammar
attribute (at (to address))
Where:
Address
is the desired address of the variable.
Usage
The variable is placed in it own section, and the section containing the variable is given a appropriate type by the COM Piler:
1.read-only variables are placed in a section of type RO.
2.Initialized read-write variables are placed in a section of type RW.
Variables explicitly initialized to zero are placed in:
1). A section of type ZI in RVCT 4.0 and later.
2). A section of type RW (not ZI) in RVCT 3.1 and earlier. Such variables are not candidates for the ZI-TO-RW optimization.
3.Uninitialized variables are placed in a section of type ZI.
Limit
The linker is isn't always able to place sections produced by the at variable attribute.
The compiler faults use of the ' at ' when ' it is used ' declarations with incomplete types.
Note
The GNU editor does not support this variable attribute
Example
const int X1 __attribute__ ((at (0x10000)) = 10; /* RO/
int x2 __attribute__ ((at (0x12000)) =/* RW/
int x3 __attribute__ ((at (0x14000)) = 0;/* RVCT 3.1 a nd earlier:rw.
* RVCT 4.0 and Later:zi. * *
int x4 __attribute__ ((at (0x16000));/* ZI *