10.2.4 Changing the Default Non-Auto Variable Allocation
There are several ways in which non-auto
variables can be located in
locations other than the default.
Variables can be placed in other device memory spaces by the use of
qualifiers. For example if you wish to place variables in the program memory space, then
the const
specifier should be used (see 9.9.1 Const Type Qualifier).
If you wish to prevent all variables from using one or more data memory
locations so that these locations can be used for some other purpose, it is best to
define a variable (or array) using the address
attribute so that it
consumes the memory space, see 9.11 Variable Attributes .
If only a few non-auto
variables are to be located at
specific addresses in data space memory, then the variables can be located using the
address
attribute. This attribute is described in 9.11 Variable Attributes.