EasyManua.ls Logo

Intel 8080 - B3_Page_38

Intel 8080
224 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
Chapter
4.
Assembler
Directives
DIRECTIVES
USED
FOR
RELOCATION
Several directive,> have been ,1dded to the dssembler
to
,>upport the relocation feature. These
fdll
into the general
categories
of
locdtion
counter
control and program linkage.
Location
Counter
Control (Relocatable Programs)
4-14
Relocatable progrdms or program modules may use three locdtion counter'>. The ASEG, OSEG, and CSEG
directives specify which location
counter
is
to
be
used.
The ASEG dircctive
specific"
an
absolute code segmcnt. Even
in
a relocatable program module, you may want
to assign certain codc
'>egments to specific dddresse'>. For eXdmple,
re,tdrt
routines invoked by the RST instruc-
tion require specific addreS'>cs.
The CSEG directive spccifie" a relocatable codc segment.
In
general, thc CSEG location
counter
is
used for por-
tions
of
the program
that
are to
be
in
some form
of
rcad-only memory, such
d'>
mach inc instructions and pro-
gram constants.
The OSEG location counter spccifies d relocatable data segment. This location counter
is
used for program
elements
that
must
be
located
in
random access memory.
Thcse directives allow you to control program segmentation at assembly time. The
LOCATE program, described
in
the ISIS-II System User's Guide, gives you control over program segment location. Therefore, the guidelines
given above
are only general sincc they can
be
overridden
by
the LOCATE program.
Regardless
of
how many times the ASEG, CSEG, and OSEe; directives appcar
in
your program, the assembler
produces
a single, contiguous modulc. This module comprises four segments: code, data, ,;tack and memory.
The LINK dnd
LOCATE programs are used to combine segments from individual modules and relocate them
in
memory. These programs are explained
in
the ISISĀ·II System User's Guide.
ASEG
Directive
ASEG
directs the a'>sembler
to
use
the location
counter
for the absolute progrdm segment.
Label
Opcode Operand
optional:
ASEG
Operands are not permitted with the ASEG directive.
All
irv,Uuctions dnd data to lowing the ASEG directive are dssembled
in
the absolute mode. The ASEG directive
remaim
in
effect until a CSEG
or
OSEG directive
is
encountered.
The ASEG locdtion counter
h.1'>
dn
initial value
of
zero, The ORG directive can
be
used to assign a new value
to
the ASEG location counter.

Table of Contents

Related product manuals