Assembler Directives
SET — Set Symbol Value
MCUez HC12 Assembler User’s Manual
MOTOROLA Assembler Directives 199
8.33 SET — Set Symbol Value
Syntax: <label>: SET <expression>
Description: Similar to the EQU directive, the SET directive assigns the
value of the <expression> in the operand field to the symbol in
the <label> field. The <expression> cannot include a symbol
that is undefined or not yet defined. The <label> is an assembly
time constant; SET does not generate machine code.
The value is temporary; a subsequent SET directive can
redefine it.
Example:
2 2 0000 0002 count: SET 2
3 3 000000 02 loop: DC.B count
4 4 0000 0002 IFNE count
5 5 0000 0001 count: SET count - 1
6 6 ENDIF
7 7 000001 01 DC.B count
8 8 0000 0001 IFNE count
9 9 0000 0000 count: SET count - 1
10 10 ENDIF
11 11 000002 00 DC.B count
12 12 0000 0000 IFNE count
The value associated with the label count is decremented after
each DC.B instruction.