Assembly Language Help (alang.hlp) (Table of Contents; Topic list)
Important Notice
The pages on this site contain documentation for very old MS-DOS software, purely for historical purposes. If you're looking for up-to-date documentation, particularly for programming, you should not rely on the information found here, as it will be woefully out of date.
Code Repeat Blocks
 Example                                   Up Contents Index Back
────────────────────────────────────────────────────────────────────────────
 
  Syntax:   .REPEAT
              statements
            .UNTIL condition
 
            .REPEAT
              statements
            .UNTILCXZ [condition]
 
  See also: REPEAT, .WHILE, .BREAK, .CONTINUE, .IF, LOOPE Instruction,
            LOOPNE Instruction, Comparison Operators
 
  Description:
 
     Used for clear coding of common loop blocks. Generates code causing
     the processor to repeat the following block of <statements> until
     <condition> is true. The .UNTIL statement evaluates <condition> and
     jumps back to the .REPEAT statement if <condition> is not true
     (zero). The block can iterate one (if <condition> is false when the
     .UNTIL is first reached) or more times.
 
     .REPEAT statements can be nested, and the assembler will optimize
     to get the best possible code for evaluating the conditional. A
     .UNTIL 0 statement will cause the loop to iterate until it is
     exited with a .BREAK statement or a jump out of the loop body.
 
     The .UNTILCXZ directive can be used with expression1 ==
     expression2 or expression1 != expression2 to generate a LOOPE or
     LOOPNE instruction. The .UNTILCXZ directive also decrements CX and
     exits the loop if CX=0. If <condition> is omitted, the .UNTILCXZ
     directive generates a LOOP instruction.
                                    -♦-