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.
LOOP Instruction
 Detail Key Example                    Up Contents Index Back
────────────────────────────────────────────────────────────────────────────
 
  Title:    Loop                                  Flags: O D I T S Z A P C
                                                         ═════════════════
  Syntax:   LOOP label                                        -none-
            LOOPW
            LOOPD
 
  See also: LOOPE, .REPEAT, JCXZ
 
  Description:
 
     Loops repeatedly to a specified label. LOOP decrements CX (without
     changing any flags) and, if the result is not 0, transfers
     execution to the address specified by the operand.
 
     On the 80386/486, LOOP uses the 16-bit CX in 16-bit mode and the
     32-bit ECX in 32-bit mode. The default can be overridden with the
     LOOPW (CX) or LOOPD (ECX) forms of the instruction.
 
     If CX is 0 after being decremented, execution continues at the
     next instruction. The operand must specify a short label (between
     -128 and +127 bytes from the instruction following the LOOP
     instruction).
                                    -♦-