beautypg.com

Zilog Z8F0130 User Manual

Page 350

background image

Using the Macro Assembler

UM013037-1212

326

Zilog Developer Studio II – Z8 Encore!
User Manual

IFSAME

– see page 328

IFMA

– see page 328

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 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.

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

Example

IF XYZ ; process code body 0 if XYZ is not 0

.

.

.

.

.

ENDIF

IF XYZ !=3 ; process code body 1 if XYZ is not 3

.

.

.

Note: