LOOPE

LOOPZ

LOOPWHILE

EQUAL

LOOPWHILE

ZERO

LOOPE

LOOPZ

Operation:

Flags Affected:

(ex) +- (ex) -1

None

if (ZF) = 1 and (eX) =/; 0 then

 

(lP) +- (lP) + disp (sign-extended

 

to 16-bits)

 

Description:

 

LOOPE/LOOPZ short-label

 

LOOPE and LOOPZ (Loop While Equal and Loop While Zero) are different mnemonics for the same instruction (similar to the REPE and REPZ repeat prefixes). ex is decremented by 1, and control is transferred to the target operand if ex is not 0 and if ZF is set; otherwise the instruction following LOOPEI LOOPZ is executed.

Encoding:

1111 00001 disp

LOOPE/LOOPZ Operands Clocks Transfers Bytes LOOPE Coding Example

short-label

18 or 6

-

2 LOOPE AGAIN

2-114

Page 149
Image 149
Intel 210200-002 manual Loopwhile Equal Zero, LOOPE/LOOPZ short-label