Assembler Directives - EQU


EQU - links a name (label) to a value. Similar to defining a constant in C++.

Usage:
label  EQU    value

BACK_SP   EQU    $08          ASCII code for backspace

Equates BACK_SP with the hex value $08 which is the ASCII code for backspace. In programs we can now use the word BACK_SP to represent $08. This makes our program much easier to read and modify. Once an expression has been equated to a value it may in turn be used in other equate directives, example:

Length EQU    30
Width  EQU    25
Area   EQU    Length*Width