beautypg.com

Endif (conditional assembly) – Echelon Neuron User Manual

Page 149

background image

ENDIF (Conditional Assembly)

The Neuron assembler provides the following directives for conditional control of

the assembly of blocks of source lines: IF, IFDEF, IFNDEF, ELSE, and

ENDIF.
A conditional assembly block begins with the IF, IFDEF, or IFNDEF directive,

and ends with a matching ENDIF directive. A conditional block can contain at

most one matching ELSE directive.
Conditional assembly directives can be nested. Thus, a group of source-code lines

between an IF directive and a matching ELSE or ENDIF can contain additional

IF, IFDEF, or IFNDEF directives, and ELSE directives, as long as there are an

identical number of matching ENDIF directives. The maximum number of

nested directives is five. The total maximum number of conditional IF, IFDEF,

and IFNDEF directives for a single source file is 256.
Source-code lines that the assembler skips because of conditional assembly must

still conform to the Neuron assembler syntax.

Syntax:
The ENDIF directive has no arguments and cannot have a label. The ENDIF

directive must be preceded by a matching IF, IFDEF, or IFNDEF directive.

ENDIF

Neuron Assembly Language Reference

139