Chapter
4.
Assembler
Directives
Three assembler
directives·
E.QU,
SET, and MACRO
--
have a slightly different format from assembly
language instructions. The
EQU, SET, and MACRO directives require a name for the symbol or macro being
defined to
be
present
in
the label field. Names differ from labels
in
that
they must
not
be
terminated with a
colon (:)
as
labels arc. Also, the LOCAL and
ENDM
directive', prohibit the usc
of
the label field.
The
MACRO, ENDM, and LOCAL directives are explained
in
Chapter
5.
SYMBOL
DEFINITION
The assembler automatically assigns values to symbols that appear
as
instruction labels. This value
is
the
current
setting
of
the location
counter
when the instruction
is
assembled. (The location counters arc explained under
'Address
Control and Relocation,' later
in
this chapter.)
You may define
other
symbols and assign them values by using the EQU and SET directives. Symbols defined
using
EQU cannot
be
redefined during assembly; those defined
by
SET can
be
assigned new values
by
subsequent
SET directive.,.
The name required
In
the label field
of
an
EQU
or SET directive must
not
be
terminated with a colon.
Symbol> defined by EQU dnd SET have meaning
throughout
the remainder
of
the program. This may cause the
symbol to have illegal
multiple definitions when the EQU or SET directive appears
in
a macro definition.
Usc
the LOCAL directive (described
in
Chapter
5)
to avoid this problem.
EQU Directive
4-2
EQU
a.,signs the value
of
'expression' to the name specified
in
the label field.
Label
Opcode Operand
name
EQU
expres.,ion
The required name
in
the label
Field
may not
be
terminated with a colon. This name cannot
be
redefined
by
a
subsequent EQU or SET diret.:tive. The
EQU
expression
cannot
contain any external .,ymbo!. (External .,ymbols
are explained under 'Location
Counter
Control and Relocation,' later
in
this chapter.)
As.,embly-time evaluation
of
EQU expres.,ions always generate., a modulo 64K address. Thu5, the expression
always yields a value
in
the
rclnge
0-65,536.
Example:
The following
EQU
directive enters the name ONES into the .,ymbol
uble
and as,igns the binary value
1111
1111 to it:
ONES
EQU
OFFH