
UM017105-0511 Conditional Assembly
Zilog Developer Studio II – ZNEO™
User Manual
245
If a condition is true, the code body is processed. Otherwise, the code body after an ELSE
is processed, if included.
The
ELIF directive allows a case-like structure to be implemented.
Conditional assembly can be nested.
IF
Evaluates a Boolean expression. If the expression evaluates to 0, the result is false; other-
wise, the result is true.
Synonyms
.if, .IF, IFN, IFNZ, COND, IFTRUE, IFNFALSE, .IFTRUE
Syntax
IF [<cond_expression> <code_body>]
[
ELIF <cond_expression> <code_body>]
[
ELSE <code_body>]
ENDIF
Example
IF XYZ ; process code body if XYZ is not 0
.
.
.
<Code Body>
.
.
ENDIF
IF XYZ !=3 ; code body 1 if XYZ is not 3
.
.
.
<Code Body 1>
.
.
.
ELIF ABC ; XYZ=3 and ABC is not 0,
.
.
.
<Code Body 2>
.
Comentários a estes Manuais