First page Back Continue Last page Overview Graphics
Assembler Directives: equ
equ is used to assign a name to a given value. No memory is reserved by this directive. In the example below, “GAIN” is replaced by the number six during the assembly process.
GAIN: equ 6
- ldaa #GAIN
- is equivalent to: ldaa #6
The equ directive allows names to be associated with constants. This allows us to make programs much more readable. In a long program, hundreds of constants may need to be used, so assigning meaningful names to the constants meaningful greatly simplifies program development and support.
An added benefit of assigning names to values is that if a name is used in multiple places in the program and a change in the value is necessary, the change need be made in only one place.
If the # sign were omitted in the third statement, i.e.
the processor load whatever it found at that memory address 6 into register A.