Ax51 User's Guide

Side-Effects

The integrated C preprocessor in the Ax51 Assembler has two side-effects which may cause problems when you assemble programs that were originally written for other assemblers.

  • A backslash character ('\') at the end of a comment line forces the next line to be a comment, too. For example:
    ; THIS IS A COMMENT ENDING WITH \ 
    MOV A,#0
    ; DUE TO THE \ IN THE FIRST LINE THE SECOND LINE IS CONCATENATED
    ; AND THE MOV INSTRUCTION IS NOT ASSEMBLED
    
  • If you use the $INCLUDE directive in conditional assembly blocks, the include file must exist even if the conditional block is not assembled. For example:
    $IF 0
    $INCLUDE (MYFILE.INC)    ; This file must exist even if the block
                             ; is not assembled since the C preprocessor
    $ENDIF                   ; interprets the file first.
    
    #if 0                    // If you use C preprocessor statements
    #include (myfile.inc)    // with the #include directive, the file
    #endif                   // does not need to exist.