| ||||||||
Technical Support Support Resources Product Information | A51: DIFFERENCE BETWEEN IF AND $IFInformation in this article applies to:
QUESTIONWhat's the difference between the $IF and IF conditional statements? ANSWERThe 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. For example: $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 SEE ALSOLast Reviewed: Monday, June 07, 2004 | |||||||
| ||||||||