define region directive
Syntax
define [ ram | rom ] regionname=region-expr;
where region-expr is a region expression, see also Regions.
Parameters
| The region contains RAM memory. |
| The region contains ROM memory. |
| The name of the region. |
Description
The define region directive defines a region in which specific sections of code and sections of data can be placed. A region consists of one or several memory ranges, where each memory range consists of a continuous sequence of bytes in a specific memory. Several ranges can be combined by using region expressions—these ranges do not need to be consecutive or even in the same memory.
If you declare regions as being ROM or RAM, this directive interacts with the build for rom directive to ensure that read-only content can only be placed on ROM addresses, and that read/write content cannot be placed on ROM addresses. If build for ram has been specified, the define region directive has no effect on it. Note that if no build for directive has been specified, build for ram is used by default. See build for directive.
Example
/* Define the 0x10000-byte code region ROM located at address 0x10000 */ define rom region ROM = [from 0x10000 size 0x10000];