ARM Technical Support Knowledge Articles

USING THE ! MACRO OPERATOR

Applies to: AX51 Macro Assembler

Answer


Information in this article applies to:


QUESTION

I do not understand how to use the ! macro operator. There is no example in the manual.

ANSWER

The ! macro operator is used to literalize a macro parameter. It is usually used to pass delimiters. The following example shows how you can comment parts of macros by using the ! operator to pass a semicolon as a comment start.

?ID?SEG SEGMENT IDATA
        RSEG    ?ID?SEG
VAL0:   DS      1
VAL1:   DS      1
VAL2:   DS      1

LD_ID   MACRO   Adr, Modi
        MOV     R0,#Adr
        MOV     A,@R0
        Modi    R0
ENDM

?PR?SEG SEGMENT CODE
        RSEG    ?PR?SEG

        LD_ID   VAL0, INC   ; LOAD VAL0 and INC R0
        ADD     A,@R0       ; VAL1

        LD_ID   VAL2, DEC   ; LOAD VAL0 and DEC R0
        XRL     A,@R0       ; VAL2

        LD_ID   VAL1, !;    ; LOAD VAL1 and leave R0 unmodified
        ADD     A,@R0       ; VAL1

END

MORE INFORMATION

SEE ALSO

Article last edited on: 2005-08-03 10:24:52

Rate this article

[Bad]
|
|
[Good]
Disagree? Move your mouse over the bar and click

Did you find this article helpful? Yes No

How can we improve this article?

Link to this article
Copyright © 2011 ARM Limited. All rights reserved. External (Open), Non-Confidential