A SERVICE OF

logo

ARCHITECTURE AND INSTRUCTIONS
Labels in instruction statements are always
optional; names in directive statements can
be mandatory, optional, or prohibited, depend-
ing on the particular directive.
Mnemonics in instruction statements specify
the purpose of the statement. Directives, in
directive statements, specify the purpose of
the statement. The instruction
mgemonics
correspond to the set of approximately
100
opcodes available in the
8088.
The directives
correspond to the set of some
20
functions
provided by the ASM-86 assembler (Fig.
2-14).
The mnemonic or directive may require addi-
tional information to define its purpose
completely. This information
is
provided
by'
a sequence of arguments.
Optional comments make the program more
readable; when present they must be pre-
ceded
by
a semicolon.
Directive Statements
The various directive statements in ASM-86
are:
1)
symbol-definition
2)
data-definition
3)
segmentation-definition
4)
procedure-definition
5)
termination
Symbol-Definition Statements
The EQU statement provides a means for
defining symbolic names to represent values
or
other symbolic names. The two forms of
the
EQU statement are illustrated:
name
new
name
EQU
EQU
expression
old_name
THING
BIGGER_THING
BIGGEST_THING
DB ?
OW ?
DO ?
Some examples are:
BOILING_POINT
BUFFEFLSIZE
NEW_PORT
COUNT
EQU
EQU
EQU
EQU
212
32
PORT_VAL+1
CS
The last example differs from the other three
in
that COUNT does not represent a value; it
is
a
synonym for the
ex register.
A symbolic name can be
"undefined" by a
PURGE
statement
so
it
may later represent
something entirely different:
PURGE
Data-Definition Statements
Data-definition allocates memory for a data
item, associates a symbolic name with that
memory address, and optionally supplies an
initial value for the data. Symbolic names
associated with data items are called vari-
ables. Examples of data-definition statements
are:
(see
below) .
In the example below,
THING
is
a symbolic
name associated with a byte in memory,
BIGGER_
THING with two consecutive
bytes in memory, and BIGGEST_THING
with four consecutive bytes in memory.
Initial Values
Before
we
can discuss the question marks
(?),
we
need to introduce the concept of initial
values of data items.
The object code produced by the assembler
contains the
l's
and
O's
that make up each
instructIon and the memory address
at
which
each instruction should reside.
Mter
the
object code
is
produced, the instructions are
;defines a byte
;defines a
word
(2
bytes)
;defines a
doubleword
(4 bytes)
2-28