The statements
PARAMETER_TABLE DW PAR1
DW PAR2
DW PAR3
|
would cause the offsets of PAR1, PAR2, and PAR3 to be stored as shown in Fig. 3-58(a). PAR1, PAR2, and PAR3 may be variables or labels. Statements such as
INTERSEG_DATA DD DATA1
DD DATA2
|
could be used to store both the offsets and segment addresses, as shown in Fig. 3-58(b).
Figure 3-58 Use of DW and DD statements to preassign addresses.
| |
(a) DW statement | (b) DD statement |
The assembler uses the type attribute to determine whether the machine instruction is to operate on a byte or word (i.e., the w-bit is to be set to 0 or 1). For example, given
MOV OPER1,0
MOV OPER2,0
.
.
.
OPER1 DB ?,?
OPER2 DW ?,?
|
the w-bit is set to 0 in the first MOV instruction and to 1 in the second.
The LABEL directive, which
Variable    LABEL    Type
causes the variable to be typed and assigned to the current offset. The directives
BYTE_ARRAY LABEL BYTE
WORD_ARRAY DW 50 DUP(?)
|
would assign both BYTE_ARRAY and WORD_ARRAY to the same location, the first byte of a 100-byte block. The instruction
MOV WORD_ARRAY+2,0
would set the third and fourth bytes of the block to 0 and
MOV BYTE_ARRAY+2,0
would set the third byte to 0.
Table of Contents | Next page | Previous page
This is page 43.