beautypg.com

All ram configuration – Zilog EZ80F916 User Manual

Page 262

background image

UM014423-0607

Using the Linker/Locator

ZiLOG Developer Studio II

eZ80Acclaim!

®

User Manual

242

Wizard dialog box or the Address Spaces page of the Project Settings dialog box con-
tained the following values:

ROM:

0-7FFF

RAM:

A000-FFFF

ZDS II then generates the following code for the linker command file:

RANGE ROM $0 : $7FFF
RANGE RAM $A000 : $FFFF

The linker uses the COPY command on segments to better support standalone C pro-
grams. When running a C program under an operating system such as Windows or UNIX,
all initialized variables are set to their starting values upon the start of program execution.
In a standalone C implementation, however, there is no operating system to reload vari-
ables with their initial values. With no operating system, if an embedded application runs
for a while and is then restarted at

main()

, the values of initialized variables are not

restored to their original value. The linker’s COPY command, together with the startup
module, provides a means to reinitialize variables.

The linker normally loads the DATA segment (initialized data) into RAM. When the ini-
tialized data has been loaded into RAM and modified by program execution, in the
absence of the COPY mechanism, the only way to reload the initial DATA segment is to
download the code to the target board again. This approach is not practical for most
embedded systems. (The embedded application would have to save all the initialized data
and reload the initial values upon RESET, for example.)

The COPY command (typically,

COPY DATA ROM

) causes the linker to put a copy of the

DATA segment in the ROM space at load time. The standard startup module always copies
the DATA segment to RAM before calling

main()

. The COPY command copies seg-

ments into spaces only. Any other copy combination generates an error.

The startup module requires additional linker commands to perform the copy. “Compo-
nents Used in All Linker Configurations” on page 245 de
scribes these commands.

The ORDER command allows you to define the sequence of segments within a memory
space. In the Standard Configuration, ZDS II generates the following command to put the
initialized data segment at a lower address than the uninitialized data segment:

ORDER DATA,BSS

All RAM Configuration

In this configuration, the linker maps all segments associated with the logical ROM
address space to physical RAM. ZDS II therefore automatically generates two linker com-
mands. One command combines the spaces into one, and the other defines the physical
address range for the combined spaces. The two linker commands are:

GROUP MEMORY=ROM,RAM

This manual is related to the following products: