beautypg.com

Copy to ram configuration, Custom configuration, Copy to ram configuration custom configuration – Zilog EZ80F916 User Manual

Page 264

background image

UM014423-0607

Using the Linker/Locator

ZiLOG Developer Studio II

eZ80Acclaim!

®

User Manual

244

Copy to RAM Configuration

This configuration provides support for copying code as well as data segments from phys-
ical ROM to physical RAM. The idea is to compensate for the performance penalty often
associated with running code from ROM. A ROM instruction fetch, for example, might
require more wait states than a RAM instruction fetch. It is therefore more efficient to run
code from RAM than to run it from ROM, provided the target system has enough RAM
for the program code and data. As in the other configurations, ZDS II automatically gener-
ates linker commands in the linker command file to support this operating mode when
Copy to RAM is selected.

To run code from the RAM space, the linker must do two things:

Reassign all of the CODE segment addresses to RAM instead of ROM.

Place a copy of the CODE segment in ROM for an application restart (the startup
module re-copies it from ROM to RAM upon restart).

The linker CHANGE command allows you either to rename a segment or reassign a seg-
ment to another space. For example,

CHANGE TEXT is DATA
CHANGE CODE is RAM
CHANGE STRSECT is CODE

causes the linker to do the following:

1. Combine the TEXT segment into the DATA segment.

2. Reassign the CODE segment to the RAM space.

3. Combine the STRSECT segment into the CODE segment.

These three CHANGE commands reassign all addresses in the CODE, TEXT, and

STRSECT segments into RAM for the fastest possible execution.

The final step requires the RAM space to be copied in ROM space so that it can be
reloaded from ROM when the application starts. Adding the following commands

COPY DATA ROM
COPY CODE ROM

causes both the CODE and DATA segments to be copied to ROM. These segments are
then copied by the startup code to the appropriate RAM addresses, completing the actions
associated with the COPY to RAM configuration.

Custom Configuration

In this configuration, you define all of the segment to space mappings, depending on the
hardware configuration of the application board.

This manual is related to the following products: