Region literal
Syntax
[memory-name: ][fromexpr{ toexpr| sizeexpr} [ repeatexpr[ displacementexpr]]]
where expr is an expression, see Expressions in linker configuration files.
Parameters
| The name of the memory space in which the region literal will be located. If there is only one memory, the name is optional. |
|
|
|
|
|
|
|
|
|
|
Description
A region literal consists of one memory range. When you define a range, the memory it resides in, a start address, and a size must be specified. The range size can be stated explicitly by specifying a size, or implicitly by specifying the final address of the range. The final address is included in the range and a zero-sized range will only contain an address. A range can span over the address zero and such a range can even be expressed by unsigned values, because it is known where the memory wraps.
The repeat parameter will create a region literal that contains several ranges, one for each repeat. This is useful for banked or far regions.
Example
/* The 5-byte size range spans over the address zero */ Mem:[from -2 to 2] /* The 512-byte size range spans over zero, in a 64-Kbyte memory */ Mem:[from 0xFF00 to 0xFF] /* Defining several ranges in the same memory, a repeating literal */ Mem:[from 0 size 0x100 repeat 3 displacement 0x1000] /* Resulting in a region containing: Mem:[from 0 size 0x100] Mem:[from 0x1000 size 0x100] Mem:[from 0x2000 size 0x100] */