Intel 210200-002 Baby Furniture User Manual


 
ARCHITECTURE AND INSTRUCTIONS
component for the various memory-address
. operands
is:
Memory Address Operand
BYTE of data
WORD of data
DWORD of data
NEAR instruction
location
FAR instruction location
Type
Component
1
2
4
-1
-2
Notice that the type component for bytes,
words, and double words corresponds to the
number of bytes
that
each occupies. The
value of the type component for instruction
locations does not have a physical interpreta-
tion.
The LENGTH and SIZE operators apply
only to data-memory-address operands
(BYTE, WORD, or DWORD).
The LENGTH operator returns a numeric
value for the number of units (bytes, words,
or double words) associated with the memory-
address operand.
The SIZE operator returns a numeric value
for the number of bytes allocated for the
memory-address operand.
For
example, if
MULTI_WORDS
is
defined
by
MUL TLWORDS DW 50 DUP (0)
then LENGTH MULTI.JVORDS
is
50
and
SIZE MULTI_WORDS
is
100.
Notice that
. SIZE X
is
equal to (LENGTH
X)*
(TYPE
X).
PTR and THIS
The synthetic
operators
build
memory-
address operands from their components.
These operators are
PTR
and THIS.
The
PTR
operator builds a memory-address
operand that has the same segment and offset
of some other memory-address operand, but
has a different type. Unlike a data-definition
statement, the
PTR
operator does not allo-
cate memory;
it
merely
gives
another mean-
ing to previously-allocated memory.
For
example,
if
TWO_BYTE
were
defined by,
TWO_BYTE DW ?
then
we
could name first the byte in the word
as follows:
ONE_BYTE
EQU BYTE
PTR
TWO_BYTE
In
this example, the
PTR
operator creates a
new memory-address operand having the
same segment and offset components as
TWO_BYTE, but having a type component
of
BYTE. We can name the second byte of
TWO_BYTE either as
OTHER-BYTE
EQU
BYTE PTR (TWO_BYTE +
1)
or more simply as
OTHER_BYTE EQU
The
PTR
operator can also create words and
double-words as illustrated below:
MANY BYTES
FIRST WORD
SECOND DOUBLE
D.B
EQU
EQU
100
DUP (?)
;an
array of 100 bytes
WORD
PTR
MANY_BYTES
DWORD PTR
(MANY_~YTES
+4)
2-31