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.
REPcondition Instruction
 Detail Key Example                    Up Contents Index Back
────────────────────────────────────────────────────────────────────────────
 
  Title:    Repeat String Conditionally           Flags: O D I T S Z A P C
                                                         ═════════════════
  Syntax:   REPE instruction                                       ±
            REPNE instruction
 
  See also: CMPS, SCAS, REP
 
  Description:
 
     Repeats a string instruction as long as condition is true and the
     maximum count has not been reached. The synonyms REPE and REPZ
     repeat while the zero flag is set. The synonyms REPNE and REPNZ
     repeat while the zero flag is cleared.
 
     The conditional repeat prefixes should only be used with SCAS and
     CMPS, since these are the only string instructions that modify the
     zero flag. Before executing the instruction, CX should be set to
     the maximum allowable number of repetitions.  First CX is compared
     to zero; if it equals zero, execution proceeds to the next
     instruction. Otherwise, CX is decremented, the string instruction
     is performed, and the loop continues.
 
     On all processors except the 80386/486, combining a repeat prefix
     with a segment override may cause errors if an interrupt occurs
     during a string operation.
                                    -♦-