Address spaces and segments, Allocating processor memory, Address spaces – Zilog Z8F0130 User Manual

Page 302: Allocating processor memory address spaces

Advertising
background image

Using the Macro Assembler

UM013037-1212

278

Zilog Developer Studio II – Z8 Encore!
User Manual

Address Spaces and Segments

You access the memory regions of the Z8 Encore! microcontroller by using segment direc-
tives. A segment is a contiguous set of memory locations. All segments are attached to
exactly one memory space. The Z8 Encore! Assembler has predefined spaces and seg-
ments. The following sections describe address spaces and segments:

Allocating Processor Memory

– see page 278

Address Spaces

– see page 278

Segments

– see page 279

Assigning Memory at Link Time

– see page 281

Allocating Processor Memory

All memory locations, whether data or code, must be defined within a segment. There are
two types of segments:

Absolute segments

An absolute segment is any segment with a fixed origin. The origin of a segment can
be defined with the ORG directive. All data and code in an absolute segment are
located at the specified physical memory address.

Relocatable segments

A relocatable segment is a segment without a specified origin. At link time, linker
commands are used to specify where relocatable segments are to be located within
their space. Relocatable segments can be assigned to different physical memory loca-
tions without reassembling.

Address Spaces

The memory regions for the Z8 Encore! microprocessor are represented by the address
spaces listed in the

Linker: Address Spaces Page

section on page 103. Briefly, the main

address spaces are the ROM space (used for program storage and some constant data) and
the data spaces RData and EData. Both RData and EData are used to store nonconstant
data; RData is 8-bit addressable memory with a maximum range of

00H-FFH

, and EData

is 12-bit addressable memory with a maximum range of

100H-EFFH

. Some CPUs also

have specialized Nonvolatile Data Storage (NVDS) and Program RAM (PRAM) spaces,
which are described more fully in the

Linker: Address Spaces Page

section on page 103.

Code and data are allocated to these spaces by using segments attached to the space.

Advertising