Ax51 User's Guide

& Operator

The ampersand operator ('&') may be used to concatenate text and macro parameters as shown in the following example:

MAK_NOP_LABEL MACRO X
        LABEL&X: NOP
        ENDM

This macro inserts a new label and a NOP instruction for each invocation. The parameter passed to the macro is appended to the text LABEL to create the label for each line. For example:

LOC     OBJ     LINE  SOURCE
                1     MAK_NOP_LABEL MACRO X
                2             LABEL&X: NOP
                3             ENDM
                4
                5
                6     MAK_NOP_LABEL 1
0000    00      7+1   LABEL1: NOP
                8     MAK_NOP_LABEL 2
0001    00      9+1   LABEL2: NOP
                10    MAK_NOP_LABEL 3
0002    00      11+1  LABEL3: NOP
                12    MAK_NOP_LABEL 4
0003    00      13+1  LABEL4: NOP
                14
                15    END