Keil Logo

& 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
  Arm logo
Important information

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.

Change Settings

Privacy Policy Update

Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers
of your data.