beautypg.com

Zilog EZ80F916 User Manual

Page 205

background image

UM014423-0607

ZiLOG Developer Studio II

eZ80Acclaim!

®

User Manual

185

User-Defined Segments
You can define a new segment using the following directives:

DEFINE MYSEG,SPACE=ROM
SEGMENT MYSEG

MYSEG becomes the current segment when the assembler processes the

SEGMENT

direc-

tive, and MYSEG remains the current segment until a new

SEGMENT

directive appears.

MYSEG can be used as a segment name in the linker command file.

You can define a new segment in RAM using the following directives:

DEFINE MYDATA,SPACE=RAM
SEGMENT MYDATA

The

DEFINE

directive creates a new segment and attaches it to a space. For more informa-

tion about using the

DEFINE

directive, see “DEFINE” on page 203. The

SEGMENT

direc-

tive attaches code and data to a segment. The

SEGMENT

directive makes the segment

named in the directive the currently active segment. Any code or data following the

SEG-

MENT

directive resides in the segment until another

SEGMENT

directive is encountered. For

more information about the

SEGMENT

directive, see “SEGMENT” on page 208.

A segment can also be defined with a boundary alignment and/or origin:

Alignment

Aligning a segment tells the linker to place all instances of the segment in your
program on the specified boundary.

NOTE: Although a module can enter and leave a particular segment many times, the

module still has only one instance of that segment.

Origin

When a segment is defined with an origin, the segment becomes an absolute segment,
and the linker places it at the specified physical address in memory.

BSS

RAM

Uninitialized data

DATA

RAM

Initialized data

CODE

ROM

Code

Table 8. Predefined Segments (Continued)

Segment Name

Address Space

Contents

This manual is related to the following products: