The general syntax for the MEMORY directive is:
MEMORY
{
PAGE 0 : name 1 [ (attr )] : origin = constant , length = constant;
PAGE n : name n [ (attr) ] : origin = constant , length = constant;
}
PAGE
identifies a memory space. You can specify up to 255 pages,
depending on your configuration; usually, PAGE 0 specifies
program memory, and PAGE 1 specifies data memory. If you do not
specify a PAGE, the linker acts as if you specified PAGE 0. Each
PAGE represents a completely independent address space. Con-
figured memory on PAGE 0 can overlap configured memory on
PAGE 1.
name
Names a memory range. A memory name may be one to eight
characters; valid characters include A–Z, a–z, $, ., and _. The
names have no special significance to the linker; they simply iden-
tify memory ranges. Memory range names are internal to the linker
and are not retained in the output file or in the symbol table.
Memory ranges on separate pages can have the same name; with-
in a page, however, all memory ranges must have unique names
and must not overlap.
attr
Specifies one to four attributes associated with the named range.
Attributes are optional; when used, they must be enclosed in
parentheses. Attributes restrict the allocation of output sections
into certain memory ranges. If you do not use any attributes, you
can allocate any output section into any range with no restrictions.
Any memory for which no attributes are specified (including all
memory in the default model) has all four attributes. Valid attributes
include:
R
specifies that the memory can be read
W
specifies that the memory can be written to
X
specifies that the memory can contain executable code
I
specifies that the memory can be initialized
origin
Specifies the starting address of a memory range; enter as origin ,
org , or o . The value, specified in words, is a 16-bit constant and
may be decimal, octal, or hexadecimal.
The MEMORY Directive
Linker Description
7-29
Need help?
Do you have a question about the TMS320C54x and is the answer not in the manual?