loopne

8086 and later

Loop with Counter

loopne imm8 {near|short} | loopne imm8 {near|short}, cx | loopne imm8 {near|short}, ecx | loopne 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 loopne 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
loopne imm8 {near|short}8086
loopne imm8 {near|short}, cx8086nolong
loopne imm8 {near|short}, ecx386
loopne imm8 {near|short}, rcxx86-64long