Motorola HC12 User Manual

Page of 328
Assembler Directives
FAIL — Generate Error Message
MCUez HC12 Assembler
User’s Manual
MOTOROLA
Assembler Directives
181
Example:
The following code segment:
cpChar: MACRO
          IFC "\1", ""
            FAIL "A character must be
specified as first parameter"
            MEXIT
          ELSE
            LDD \1
          ENDIF
          IFC "\2", ""
            FAIL 600
          ELSE
            STD \2
          ENDIF
        ENDM
codeSec: SECTION
Start:
        cpChar , char2
Generates this error message:
>> in "Y:\DEMO\HC12A\cbe.asm", line 7, col 17, pos 110
          IFC "\1", ""
            FAIL "A character must be specified as first parameter"
                   ^
ERROR A2338: A character must be specified as first parameter
The
FAIL
 directive is intended for use with conditional
assembly to detect a user-defined error or warning condition.