beautypg.com

Copy, Examples, Syntax – Zilog ZUSBOPTS User Manual

Page 291

background image

UM017105-0511

Linker Commands

Zilog Developer Studio II – ZNEO™

User Manual

263

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. See also the exam-
ples for the

COPY

command.

Examples

To change the name of a segment (for example,

strseg

) to another segment name (for

example,

codeseg

), use the following command:

CHANGE strseg=codeseg

To move a segment (for example,

codeseg

) to a different address space (for example,

RAM), use the following command:

CHANGE codeseg=RAM

To not allocate a segment (for example,

dataseg

), use the following command:

CHANGE dataseg=NULL

COPY

The

COPY

command is used to make a copy of a segment into a specified address space.

This is most often used to make a copy of initialized RAM in ROM so that it can be initial-
ized at run time.

Syntax

COPY

[at]

<segment> can only be a segment.

<name> can only be an address space.

Examples

To make a copy of a code segment in ROM, observe the following procedure:

1. In the assembly code, define a code segment (for example,

codeseg

) to be a segment

located in RAM. This is the run-time location of

codeseg

.

2. Use the following linker command:

COPY codeseg ROM

The linker places the actual contents associated with

codeseg

in ROM (the load time

location) and associates RAM (the run-time location) addresses with labels in

code-

seg

.

This manual is related to the following products: