 | Ax51 User's Guide |  |
|
|
| IF Assembler Statement| Arguments |
IF expression
| | Description | The IF statement begins an IF-ELSE-ENDIF construct that is used for conditional program assembly. The specified expression is evaluated and, if the value is non-zero (TRUE), the code inside the IF block is assembled. If the expression is zero (FALSE), the IF block is not assembled and subsequent blocks of the construct are evaluated. IF blocks are terminated by an ELSEIF, ELSE, or ENDIF statement. IF-ELSE-ENDIF blocks may be nested up to 10 deep. Note - The specified expression may not contain symbols defined with the SET and RESET directives.
- Do not confuse the IF statement with the $IF directive. They are not equivalent and they may not be used with the same symbols.
| | See Also | ELSE, ELSEIF, ENDIF, EQU, LIT, SET | | Example |
IF (SWITCH = 1)
.
.
.
ELSEIF (SWITCH = 2)
.
.
.
ELSE
.
.
.
ENDIF
|
|
|