If an expression appears several times in a program, it is sometimes more convenient to give it a name and refer to it by the name.
The statement that assigns a name to an expression has the form
The MOV instruction in the sequence
INDXD_CHAR EQU CHAR_ARRAY[SI+10] . . . MOV AL,INDXD_CHAR . . . |
MOV AL,CHAR_ARRAY[SI+10]
Figure 3-62 Examples of the EQU directive.
Directive | Description | |
---|---|---|
CONSTANT EQU 256 | Assigns 256 to the name CONSTANT | |
DATA EQU HEIGHT+12 | Assigns the direct operand HEIGHT+12 to the name DATA | |
FIELD EQU [BX].ETA[SI] | Assigns the structure referencing operand [BX].ETA[SI] to the name FIELD | |
ALPHA EQU 7 | This combination would give 7 the name ALPHA, 7-2=5 the name BETA, and the direct operand VAR+BETA=VAR+5 the name ADDR |
This is page 47.