loope

8086 and later

Loop with Counter

loope imm8 {near|short} | loope imm8 {near|short}, cx | loope imm8 {near|short}, ecx | loope imm8 {near|short}, rcx

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.

Loading...

Forms

Every form of loope the assembler accepts, from NASM's own instruction table. The second column is the processor that introduced the form; a badge marks a form that needs an extension, that is lockable, or that long mode dropped.

FormSinceNotes
loope imm8 {near|short}8086
loope imm8 {near|short}, cx8086nolong
loope imm8 {near|short}, ecx386
loope imm8 {near|short}, rcxx86-64long