Intel 210200-002 Baby Furniture User Manual


 
ARCHITECTURE AND INSTRUCTIONS
loaded into memory at the indicated addresses
and then executed.
At the time the instructions are loaded, initial
values for data items could also be loaded
into memory. This means that the object
code, besides containing instructions and
their addresses, may also contain initial
values for data items and their addresses.
These initial values are specified to the
assembler in the data definition statements.
The following statement will cause the
assembler to produce object code that, when
loaded into memory, will result in a
25 being
placed in the memory address allocated to
THING;
THING DB
25
:byte initially contains
25
A question mark in place of an initial value
means that
we
do not choose to specify an
initial value for that data item;
we
will be
satisfied with whatever initially appears in the
corresponding memory location.
When the assembler sees the question mark,
it still allocates memory for the data item, but
does not produce object code to initialize the
memory location (although it could).
In
general, the initial value could be specified
by
an
expression, since expressions are eval-
uated
at
assembly time. So
we
can write
statements like:
IN_PORT DB
OUT_PORT DB
PORT_VAL
PORT_VAL+1
Recall that expressions come in two varieties
- numeric and memory address.
It
is
mean-
ingful to initialize either a byte, or a word,
or
a double-word with a numeric value. But,
LITTLE_CYCLE
BIG_CYCLE
DW CYCLE
DO
CYCLE
CYCLE MOV BX,AX
2-29
what about a memory-address value? It won't
fit into a byte, but the offset component fits
into a word; and, both the segment
and address
components fit into a double word. So we can
write initialization statements like
those
shown at the bottom of this page.
The initialization of
LITTLE_CYCLE per-
mits
an
indirect intrasegment
jump
or call to
use the date item named
LITTLE,CYCLE to
transfer control to the label
na~eq
CYCLE.
Similarly,
an
intersegment jump or call
transfers control to
CYCLE by using the data
item named BIG_CYCLE.
Tables
So far
we
have used data-definition state-
ments to define one byte, word, or double-
word
at
a time. Often,
we
deal with tables of
bytes, words, or double words.
For
example,
the
8088
XLAT instruction uses a table of
bytes to translate an encoded value into the
s~me
valJ.le
under a different encoding. The
8088
interrupt mechanism uses a table of
double-words, starting
at
memory location 0
to
point to the starting addresses
of
the inter-
rupt service routines. And, the
8088
string
instructions operate on tables of bytes or
words containing the string elements.
A table
is
defined by placing several initial
values on a data-definition statement. The
following statement defines a table of bytes
containing powers of
2:
DB
1,2,4,8,16
The byte
at
the memory address correspond-
ing to POWERS_2 will
be
initialized to 1
(whenthe object code
is
loaded into memory).
;offset
of
CYCLE
;offset and segment
of
CYCLE