|ARM Technical Support Knowledge Articles|
Applies to: A51 Macro Assembler
Information in this article applies to:
What's the difference between the $IF and IF conditional statements?
The primary difference between $IF and IF is the defined names or symbols that may be tested. In assembler, there are several ways to define symbols.
The $IF statement may only be used to test symbols defined with $SET or $RESET within the program or on the command line.
The IF statement may only be used to test symbols defined with EQU, LIT, or SET, or labels with an absolute address. IF may not be used to test symbols defined with $SET or $RESET.
$set (var1=1) var2 equ 2 var3 lit '3' ;This works only on AX51 var4 set 4 dseg at 5 var5: ds 1 $if (var1 eq 1) __error__ "1" $endif if (var2 eq 2) __error__ "2" endif if (var3 eq 3) __error__ "3" endif if (var4 eq 4) __error__ "4" endif if (var5 ge 5) __error__ "5" endif
Article last edited on: 2004-06-07 23:34:12
Did you find this article helpful? Yes No
How can we improve this article?