Global Variable Address Modifier (@address)

Use the global variable address modifier to assign global variables to specific addresses and to access memory-mapped I/O ports. These variables, called absolute variables, have the following syntax:

  Declaration = <TypeSpec><Declarator>[@<Address>|@"<Section>"][= <Initializer>]  

The frontend creates a segment for each global object specified with an absolute address. This address must not be inside any address range in the SECTIONS entries of the link parameter file, or a linker error (overlapping segments) occurs.

Listing: Using the Global Variable Address Modifier
int glob @0x0500 = 10; // OK, global variable "glob" is
// at 0x0500, initialized with 10
void g() @0x40c0; // error (the object is a function)
void f() {
int i @0x40cc; // error (the object is a local variable)
}