beautypg.com

Zilog EZ80F916 User Manual

Page 99

background image

UM014423-0607

Using the Integrated Development Environment

ZiLOG Developer Studio II

eZ80Acclaim!

®

User Manual

79

RANGE

commands for the component address spaces and binds the RAM segments

immediately after the ROM segments.

NOTE: The names following the = in the

GROUP

command define an ordering for the new

GROUP. In the preceding example, all of the ROM segments are allocated memory
at lower addresses than the RAM segments.

Standard

This configuration produces the most common embedded environment. Code resides
in Flash/ROM, and data is placed in RAM. Using the ZDS II standard startup module
with this configuration is recommended as the surest and easiest way to produce an
effective run-time environment.

In the Standard configuration, the hardware has both physical RAM and physical
ROM. The Linker commands generated by ZDS II map logical RAM segments to
physical RAM and logical ROM segments to physical ROM. Suppose the Address
Spaces page contained the following values:

ROM 0-7FFF

RAM A000-FFFF

ZDS II 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

programs. 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 variables 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 will not be 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. Once the
initialized 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
would be 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 (for example,

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
will always copy the DATA segment to RAM before calling

main()

. The

COPY

command copies segments into spaces only. Any other copy combination generates an
error. The startup module requires additional linker commands to perform the copy.
“Linker Commands” on page 247 describes these commands.

This manual is related to the following products: