Slide 5.12: Symbolic constants Slide 5.14: TEXTEQU directive Home |
EQU
Directive
String Size | Array Size | Instruction Size |
Output | Output | Output |
13 | 4 | 2 |
The EQU directive associates a symbolic name with an integer expression or some text.
|
|
expression
must be a valid integer expression.symbol
is an existing symbol name, already defined with ‘=’ or EQU
.<...>
.
When the assembler encounters name later in the program, it substitutes the integer value or text for the symbol. Code 3 and 4 are equal.
myWord1 stores the integer value 200, and myWord2 stores the string “20 * 10” .
†Unlike the ‘=’ directive, a symbol defined with EQU cannot be redefined in the same source code.
|
|