ARCHITECTURE AND INSTRUCTIONS
component for the various memory-address
. operands is:
| Type |
Memory Address Operand | Component |
BYTE of data | 1 |
WORD of data | 2 |
DWORD of data | 4 |
NEAR instruction location | |
FAR instruction location |
PTR and THIS
The synthetic operators build memory- address operands from their components. These operators are PTR and THIS.
The PTR operator builds a
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
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
MULTLWORDS 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).
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
or more simply as
OTHER_BYTE EQU
The PTR operator can also create words and
MANY BYTES | D.B | 100 DUP (?) | ;an array of 100 bytes |
FIRST WORD | EQU | WORD PTR MANY_BYTES |
|
SECOND DOUBLE | EQU | DWORD PTR (MANY_~YTES +4) |