Zilog ZUSBOPTS User Manual
Page 292

Linker Commands
UM017105-0511
264
Zilog Developer Studio II – ZNEO™
User Manual
You must copy the
codeseg
contents from ROM to RAM at run time as part of the start-up
routine. You can use the
COPY BASE OF
and
COPY TOP OF
linker expressions to get the
base address and top address of the contents in ROM. You can use the BASE OF and TOP
OF linker expressions to get the base address and top address of
codeseg
.
To copy multiple segments to ROM, observe the following procedure:
1. In the assembly code, define the segments (for example,
strseg
,
text
, and
code-
seg
) to be segments located in RAM. This is the run-time location of the segments.
2. Use the following linker commands:
CHANGE strseg=codeseg
CHANGE text=codeseg
COPY codeseg ROM
The linker renames
strseg
and
text
as
codeseg
and performs linking as described
in the previous example. You must write only one loop to perform the copy from
ROM to RAM at run time, instead of three (one loop each for
strseg
,
text
, and
codeseg
).
To allocate a string segment in ROM but not generate the initialization:
1. In the assembly code, define the string segment (for example,
strsect
) to be a seg-
ment located in ROM.
2. Use the following linker command:
COPY strsect NULL
The linker associates all of the labels in
strsect
with an address in ROM and does
not generate any loadable data for
strsect
. This is useful when ROM is already pro-
grammed separately, and the address information is required for linking and debug-
ging.
The linker recognizes the special space
NULL
.
NULL
is not one of the spaces that an object
file or library contains in it. If a segment name is changed to
NULL
using the CHANGE
command to the linker, the segment is deleted from the linking process. This can be useful
if you must link only part of an executable or not write out a particular part of the execut-
able. The predefined space
NULL
can also be used to prevent initialization of data while
reserving the segment in the original space using the COPY command.
Refer to the
section on page 273 for the format to write an expression.
Note:
Notes: