Assembly Language Help (alang.hlp) (Table of Contents; Topic list)
Control-Flow Blocks
 Example                                   Up Contents Index Back
────────────────────────────────────────────────────────────────────────────
 
  Syntax:   .IF condition
               ifstatements
             [.ELSEIF condition
               elseifstatements]
               .
               .
               .
             [.ELSE
               elsestatements]
             .ENDIF
 
  See also: IF, Conditional Assembly Directives, Comparison Operators,
            Control-Flow Directives
 
  Description:
 
     Used for clear coding of common control-flow blocks. Generates
     comparison and conditional jump instructions so that if
     <condition> is true, the processor executes the instructions
     following .IF until the next .ELSEIF, .ELSE, or .ENDIF. .IF
     statements can be nested.
 
     The .ELSEIF statement is used to create a code block that is
     executed if the preceding .IF and .ELSEIF conditions are false,
     and the current .ELSEIF condition is true. There can be several
     .ELSEIF blocks within a .IF block. The .ELSEIF statement performs
     the same function as a .IF inside a .ELSE but does not create
     another nesting level of .IFs.
 
     .ELSE specifies an alternate code block if the matching .IF and
     previous .ELSEIF expressions are false.
 
     .ENDIF closes the current .IF, .ELSEIF, or .ELSE code block.
     The assembler optimizes to get the best possible code. For example,
 
         .IF  ax==0
     performs the comparison with:
         or   ax,ax
     which is more efficient than:
         cmp  ax, 0
                                    -♦-