loopzw

8086 and later

Loop with Counter

loopzw imm8 {near|short}

LOOP decrements its counter register (either CX or ECX - if one is not specified explicitly, the BITS setting dictates which is used) by one, and if the counter does not become zero as a result of this operation, it jumps to the given label. The jump has a range of 128 bytes.

LOOPE (or its synonym LOOPZ) adds the additional condition that it only jumps if the counter is nonzero and the zero flag is set. Similarly, LOOPNE (and LOOPNZ) jumps only if the counter is nonzero and the zero flag is clear.

Forms

Every form of loopzw the assembler accepts.

FormSinceNotes
loopzw imm8 {near|short}8086nolong