Conditional assembly – Zilog EZ80F916 User Manual
Page 236

UM014423-0607
ZiLOG Developer Studio II
eZ80Acclaim!
®
User Manual
216
.WITH EMPLOYEE
LD R0, SALARY(R2)
MULT RR0
RET
.ENDWITH EMPLOYEE
CONDITIONAL ASSEMBLY
Conditional assembly is used to control the assembly of blocks of code. Entire blocks of
code can be enabled or disabled using conditional assembly directives.
The following conditional assembly directives are allowed:
•
•
•
•
Any symbol used in a conditional directive must be previously defined by an
EQU
or
VAR
directive. Relational operators can be used in the expression. Relational expressions eval-
uate to 1 if true and evaluate to 0 if false.
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.
NOTE: 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
,
.$IF
,
.$if,
.IFTRUE
Syntax
IF [<cond_expression> <code_body>]
[ELIF <cond_expression> <code_body>]
[ELSE <code_body>]
ENDIF