define memory directive
Syntax
define memory [name] with size =size_expr[ ,unit-size];
where unit-size is one of:
unitbitsize =bitsize_exprunitbytesize =bytesize_expr
and where expr is an expression, see Expressions in linker configuration files.
Parameters
| Specifies how many units the memory space contains—always counted from address zero. |
| Specifies how many bits each unit contains. |
| Specifies how many bytes each unit contains. Each byte contains 8 bits. |
Description
The define memory directive defines a memory space with a given size, which is the maximum possible amount of addressable memory, not necessarily physically available. This sets the limits for the possible addresses to be used in the linker configuration file. For many microcontrollers, one memory space is sufficient. However, some microcontrollers require two or more. For example, a Harvard architecture usually requires two different memory spaces, one for code and one for data. If only one memory is defined, the memory name is optional. If no unit-size is given, the unit contains 8 bits.
Example
/* Declare the memory space Mem of four Gigabytes */
define memory Mem with size = 4G;