.pg .x if .x then .x elseif .x else .x end .lt ------------------------------------------------------------------------ IF [NOT] predicate THEN ... [ELSEIF [NOT] predicate] THEN ... [ELSE] ... END ------------------------------------------------------------------------ .el .b 3 The IF macro generates code to execute a alternative control structure. .b The ^&predicate\& may take one of the following forms: .ls .le;condition .le;instruction condition .le;instruction ... condition .els where ^&condition\& is one of the following mnemonics: .b .x if > eql .x if > eqlu .x if > neq .x if > nequ .x if > gtr .x if > gtru .x if > lss .x if > lssu .x if > geq .x if > gequ .x if > leq .x if > lequ .x if > cc .x if > cs .x if > vc .x if > vs .x if > lbs .x if > lbc .x if > error .x if > ok .x if > even .x if > odd .x if > bs .x if > bc .x if > bss .x if > bcs .x if > bsc .x if > bcc .lt EQL EQLU NEQ NEQU GTR GTRU LSS LSSU GEQ GEQU LEQ LEQU CC CS VC VS OK ODD ERROR EVEN .el .b and ^&instruction\& can be any assembly instruction. .b .x not .x if > not If NOT is specified, all ^&conditions\& in the predicate are negated. .b .x and .x if > and .x or .x if > or Compound predicates may be formed by using the boolean operators AND and OR. Note that the operators associate to the right, so that the implied grouping of "A OR B AND C OR D" is "A OR (B AND (C OR D))". .b .x andif .x if > andif .x orif .x if > orif In order to associate to the left, we use the operators ANDIF and ORIF. In other words, ANDIF and ORIF act as a closing parenthesis for the expression to their left and as an opening parenthesis for the expression to their right; hence, "A OR B ANDIF C OR D" is "(A OR B) AND (C OR D)". .b The ELSEIF macro ends the true part of an IF structure and begins a subsequent nested IF structure. The ELSEIF macro is optional and can be specified as often as required. .b The ELSE macro ends the true part of an IF structure and begins the false part. The ELSE macro is optional. .b The default branch displacment for IF is WORD (see BRANCH). .b .tp 5 The following IF structure: .b .lt if lss then statements-1 elseif gtr then statements-2 elseif eql then statements-3 end .el .b is equivalent to: .b .lt if lss then statements-1 else if gtr then statements-2 else if eql then statements-3 end end end .el