Assembler directives – Motorola HC12 User Manual
Page 184
Advertising
User’s Manual
MCUez HC12 Assembler
184
Assembler Directives
MOTOROLA
Assembler Directives
Example:
The following is an example of using conditional assembly
directives:
Try: EQU 0
IFNE Try
LDD #1023
ELSE
LDD #0
ENDIF
The value of
TRY
determines the instruction to be assembled in
the program. As shown, the
LDD #0
instruction generates
code. Changing the directive to
IFEQ
causes the
LDD #1023
instruction to generate code instead.
The following shows the listing provided by the assembler for
these lines of code:
Try: EQU 0
IFNE Try
ELSE
00000 37 B5 00 00 LDD #0
ENDIF
Advertising