EasyManua.ls Logo

Intel 8080 - B3_Page_28

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
Label
Opcode Operands
optional:
DB
expression(s) or string(s)
The operand field of the
DB
directive can contain a list of expressions and/or
text
strings. The list can contain
up
to eight total items; list items must
be
separated
by
commas. Because
of
limited workspace, the assembler
may not be able
to
handle a total of eight items when the list includes a number of complex expressions. If
you ever have this problem, it
is
easily solved: simply use two or more directives to shorten the list.
Expressions must evalua te
to
l-byte
(8-bit) numbers
in
the
I-ange
~
256 through 255.
Text
strings may comprise
a maximum
of
128 ASCII characters enclosed
in
quotes.
The assembler's relocation feature treats
all
external and relocatable symbols
as
16-bit addresses. When one of
these symbols appears
in
an
operand expression
of
the
DB
directive, it must be preceded by either the
HIGH
or
LOW
operator to specify which byte
of
the address
is
to be used
in
the evaluation
of
the expression. When
neither operator
is
present, the assembler assumes the
LOW
operator and issues an error message.
If
the optional label
is
present,
it
is
assigned the starting value
of
the location counter, and thus references
the first byte stored
by
the
DB
directive. Therefore, the label STR
in
the following examples refers to the letter
T
of
the string TIME.
Examples:
Label Opcode Operands
Assembled
Code
STR:
DB
TIME'
54494D45
HERE:
DB
OA3H
A3
WORD1:
DB
~03H,5*2
FDOA
DW
Directive
4-4
The
DW
directive stores each 16-bit value from the expression list
as
an
address. The values are stored starting
at the current setting
of
the location counter.
Label Opcode Operands
optional:
DW
expression list
The least significant eight bits
of
the first value
in
the expression list are stored
at
the current setting
of
the
location counter; the most significant eight bits are stored
at the next higher location. This process
is
repeated
for each item
in
the expression list.
Expressions evaluate to 1
~word
(16-bit) numbers, typically addresses.
If
an
expression evaluates
to
a single byte,
it
is
assumed to be the low order byte
of
a 16-bit word where the
high
order byte
is
all
zeros.

Table of Contents

Related product manuals