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.
LOOPcondition Instruction
◄Detail► ◄Key► ◄Example► ◄Up► ◄Contents► ◄Index► ◄Back►
────────────────────────────────────────────────────────────────────────────
Title: Loop If Flags: O D I T S Z A P C
═════════════════
Syntax: LOOPE label -none-
LOOPNE label
LOOPZ label
LOOPNZ label
LOOPEW label
LOOPNEW label
LOOPED label
LOOPNED label
LOOPZW label
LOOPNZW label
LOOPZD label
LOOPNZD label
See also: CMP, .REPEAT, .WHILE, JCXZ, LOOP
Description:
Loops repeatedly to a specified label if the condition is met and
if CX is not 0. On the 80386/486, these instructions use the
16-bit CX in 16-bit mode and the 32-bit ECX in 32-bit mode. This
default can be overridden with the W (CX) or D (ECX) forms of the
instruction.
The instruction decrements CX without changing any flags and tests
whether the zero flag was set by a previous instruction (for
example, CMP). With the synonyms LOOPE and LOOPZ, execution is
transferred to the label if the zero flag is set and CX is not 0.
With the synonyms LOOPNE and LOOPNZ, execution is transferred to
the label if the zero flag is cleared and CX is not 0.
Execution continues at the next instruction if the condition is
not met. Before entering the loop, CX should be set to the maximum
number of repetitions desired.
-♦-