beautypg.com

User-defined segments – Zilog Z8F0130 User Manual

Page 304

background image

Using the Macro Assembler

UM013037-1212

280

Zilog Developer Studio II – Z8 Encore!
User Manual

The predefined segment

text

is generated by the compiler, which moves it to either the

near_data

or

far_data

segment, depending on the memory model that is in use. See

the

Memory Models

section on page 199.

For every vector directive that locates an interrupt vector at address nnn (where n repre-
sents a hexadecimal digit), the assembler generates an absolute segment in ROM named

__vectors_

nnn.


The

pramseg

segment is available only for the subset of Z8 Encore! CPUs that support

the PRAM (Program RAM) address space.

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=RDATA

SEGMENT MYDATA

or

DEFINE MYDATA,SPACE=EDATA

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 the

DEFINE

section on page 301. The

SEG

-

MENT

directive attaches code and data to a segment. The

SEGMENT

directive makes that

segment the current segment. Any code or data following the directive resides in the seg-
ment until another

SEGMENT

directive is encountered. For more information about the

SEGMENT directive, see the

SEGMENT

section on page 307.

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 pro-
gram on the specified boundary.

Notes: