EasyManua.ls Logo

Intel 8080 - B3_Page_40

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
There
is
no
interaction between the operands specified for the DSEG and CSEG directives. Thus, a code segment
can be
byte relocatable while the data segment
is
page relocatable.
The
DSEG directive remains
in
effect until an
ASEG
or CSEG directive
is
encountered.
The data segment location counter has an initial value
of
zero. The ORG directive can be used to assign a new
value to the
DSEG location counter.
ORG
Directive (Re!ocatable Mode)
The ORG directive can be
u<,ed
to alter the value
of
the location counter presently
in
use.
Label
Opcode Operand
optional: ORG
expression
There are three location counters,
but
only one location counter
is
in
use
at
any given point
in
the program.
Which one depends on whether the
ASEG, CSEG, or
DSEG
directive
is
in
effect.
Any symbol used
in
the operand expression must have been previously defined.
An
exception causes phase
errors for
all
labels
that
follow the ORG and a label error if the undefined error
is
defined later.
When the
ORG directive appears
in
a relocatable program segment, the value
of
its operand expression must
be
either absolute or relocatablc within the current segment. Thus, if the ORG directive appedrS within a data
seg-
ment, the value
of
its expression must be relocatable within the data segment.
An
error occurs if the expression
evaluates to an address
in
the code segment.
If the optional label
is
present, it
is
assigned the current value
of
the location counter presently
in
use before
the ORG directive
is
executt~d.
Program Linkage Directives
4-16
Modular programming and the relocation feature enable you
to
assemble and test a number
of
separate programs
that
are to be joined together and executed
as
a single program. Eventually, it becomes necessary for these
separate programs to communicate information among themselves. Establishing such communication
is
the
function
of
the program linkage directives.
A program may share its data addresses and instruction addresses with other programs.
Only items having an
entry
in
the symbol table can be shared with other program',; therefore, the item must
be
assigned a name or a
label when
it
i, defined
in
the program. Items to
be
shared with other program'> must
be
declared
in
a PUBLIC
directive.
Your program can directly access data or instructions defined
in
another program if you know the actual
address
of
the item, but this
is
unlikely when both programs use relocation. Your program can also gain access
to data or instructions declared
as
PUBLIC
in
other programs. Notice, however, that the assembler normally

Table of Contents

Related product manuals