beautypg.com

Sequence of operations – Zilog Z8F0130 User Manual

Page 348

background image

Using the Macro Assembler

UM013037-1212

324

Zilog Developer Studio II – Z8 Encore!
User Manual

The syntax of the structured assembly block must conform to the requirements speci-
fied in the

Structured Assembly Inputs

section on page 319.

The

.$IF

and

.$ENDIF

directives must be properly balanced, that is, there must be

exactly one

.$ENDIF

directive for each

.$IF

directive, and the

.$IF

directive must

precede its corresponding

.$ENDIF

directive.

The

.$REPEAT

and

.$UNTIL

directives must be properly balanced, that is, there must

be exactly one

.$UNTIL

directive for each

.$REPEAT

directive, and the

.$REPEAT

directive must precede its corresponding

.$UNTIL

directive.

The

.$WHILE

and

.$WEND

directives must be properly balanced, that is, there must be

exactly one

.$WEND

directive for each

.$WHILE

directive, and the

.$WHILE

directive

must precede its corresponding

.$WEND

directive.

The structured assembly block must be completely specified with a single assembly
unit. An assembly unit is a single source file or a single macro definition.

Sequence of Operations

The following sequences of operations are performed in processing structured assembly
test directives:

.$IF Sequence of Operations

– see page 324

.$REPEAT Sequence of Operations

– see page 325

.$WHILE Sequence of Operations

– see page 325

.$IF Sequence of Operations

The following sequence of operations is performed in processing the

.$IF

structured

assembly test directives:

1. The assembler generates object code to evaluate the conditions specified on the

.$IF

directive and on any optional

.$ELSEIF

directives. If the condition is true at execu-

tion time, the object code generated from the statements associated with the

.$IF

directive are executed.

2. If the condition specified on the

.$IF

directive is false at execution-time, the assem-

bler-generated object code successively evaluates the conditions specified on the

.$ELSEIF

directives, if there are any, until a true condition is evaluated. On evaluat-

ing a true

.$ELSEIF

condition, the object code generated from the statements associ-

ated with the

.$ELSEIF

directive are executed.

3. If all conditions on the

.$IF

and

.$ELSEIF

directives are false at execution-time, and

an

.$ELSE

directive is present, the object code generated from the statements associ-

ated with the

.$ELSE

directive are executed.

4. If no tested condition is true, and if no

.$ELSE

directive is specified, no statements in

the structured assembly block are executed.