| |||||
Technical Support Support Resources
Product Information | AX51: USING THE ! MACRO OPERATORInformation in this article applies to:
QUESTIONI do not understand how to use the ! macro operator. There is no example in the manual. ANSWERThe ! 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 ALSOLast Reviewed: Wednesday, August 03, 2005 | ||||
| |||||