Technical information
AN2216/D
12 MC9S12DP256 Software Development Using Metrowerkâs Codewarrior MOTOROLA
PLACEMENT
_PRESTART, STARTUP,
ROM_VAR, STRINGS,
NON_BANKED,
INTERRUPT_ROUTINES,
COPY INTO ROM_C000, ROM_4000;
DEFAULT_ROM INTO PAGE_30, PAGE_31, PAGE_32, PAGE_33, PAGE_34, PAGE_35,
PAGE_36, PAGE_37, PAGE_38, PAGE_39, PAGE_3A, PAGE_3B, PAGE_3C, PAGE_3D;
DEFAULT_RAM INTO RAM;
END
Figure 11. Example of Linker Placement Command Block
The PLACEMENT command block is used to allocate code and data segments
to the memory segments. The predefined segments PRESTART, STARTUP,
ROM_VAR, STRINGS, NON_BANKED and COPY must all be allocated to
fixed, or non-paged memory. The INTERRUPT_ROUTINES segment is the
name used in the example in Figure 4 and this must also be allocated to
non-paged memory. Note that segment COPY must always be the last
segment in this list of segments to be placed in non-paged memory.
The default code segment DEFAULT_ROM is allocated to paged memory
starting with the PAGE_30 section. When the PAGE_30 section has been
filled, the default code segment continues with the PAGE_31 and succeeding
sections until all code has been allocated to memory.
I/O Register
Placement
The use of segments together with the linker PLACEMENT command block
gives a convenient method for the allocation of register variables. The registers
for each peripheral module can be created as a structure within a data segment
and then that segment is allocated to the correct address in the linker command
file. An example for a limited number of registers is given in Figure 12 and
Figure 13.