Overlay Pages
7.11 Overlay Pages
7.11.1 Using the MEMORY Directive to Define Overlay Pages
Example 7–10. Memory Directive With Overlay Pages
7-48
Some target systems use a memory configuration in which all or part of the
memory space is overlaid by shadow memory. This allows the system to map
different banks of physical memory into and out of a single address range in
response to hardware selection signals. In other words, multiple banks of
physical memory overlay each other at one address range. You may want the
linker to load various output sections into each of these banks or into banks
that are not mapped at load time.
The linker supports this feature by providing overlay pages . Each page
represents an address range that must be configured separately with the
MEMORY directive. You can then use the SECTIONS directive to specify the
sections to be mapped into various pages.
To the linker, each overlay page represents a completely separate memory
comprising the full 24-bit range of addressable locations. This allows you to
link two or more sections at the same (or overlapping) addresses if they are
on different pages.
Pages are numbered sequentially, beginning with 0. If you do not use the
PAGE option, the linker allocates initialized sections into PAGE 0 (program
memory) and uninitialized sections into PAGE 1 (data memory).
For example, assume that your system can select between two banks of
physical memory for data memory space: address range A00h to FFFFh for
PAGE 1 and 0A00h to 2BFF for PAGE 2. Although only one bank can be
selected at a time, you can initialize each bank with different data. This is how
you use the MEMORY directive to obtain this configuration:
Ç Ç Ç Ç Ç Ç Ç Ç Ç Ç Ç Ç Ç Ç Ç Ç Ç Ç Ç Ç Ç
MEMORY
Ç Ç Ç Ç Ç Ç Ç Ç Ç Ç Ç Ç Ç Ç Ç Ç Ç Ç Ç Ç Ç
{
PAGE 0 :
ONCHIP
Ç Ç Ç Ç Ç Ç Ç Ç Ç Ç Ç Ç Ç Ç Ç Ç Ç Ç Ç Ç Ç
:
PROG
Ç Ç Ç Ç Ç Ç Ç Ç Ç Ç Ç Ç Ç Ç Ç Ç Ç Ç Ç Ç Ç
PAGE 1 :
OVR_MEM
:
DATA
Ç Ç Ç Ç Ç Ç Ç Ç Ç Ç Ç Ç Ç Ç Ç Ç Ç Ç Ç Ç Ç
PAGE 2 :
OVR_MEM
Ç Ç Ç Ç Ç Ç Ç Ç Ç Ç Ç Ç Ç Ç Ç Ç Ç Ç Ç Ç Ç
}
: origin = 0800h,
: origin = 02C00h,
: origin = 0A00h,
: origin = 02C00h,
: origin = 0A00h,
length = 0240h
length = 0D200h
length = 02200h
length = 0D400h
length = 02200h
Need help?
Do you have a question about the TMS320C54x and is the answer not in the manual?