3-373
INSTRUCTION SET REFERENCE
LOOP/LOOPccLoop According to ECX Counter (Continued)
Operation
IF AddressSize = 32
THEN
Count is ECX;
ELSE (* AddressSize = 16 *)
Count is CX;
FI;
Count
<
Count 1;
IF instruction is not LOOP
THEN
IF (instruction = LOOPE) OR (instruction = LOOPZ)
THEN
IF (ZF =1) AND (Count
?
0)
THEN BranchCond
<
1;
ELSE BranchCond
<
0;
FI;
FI;
IF (instruction = LOOPNE) OR (instruction = LOOPNZ)
THEN
IF (ZF =0 ) AND (Count
?
0)
THEN BranchCond
<
1;
ELSE BranchCond
<
0;
FI;
FI;
ELSE (* instruction = LOOP *)
IF (Count
?
0)
THEN BranchCond
<
1;
ELSE BranchCond
<
0;
FI;
FI;
IF BranchCond = 1
THEN
EIP
<
EIP + SignExtend(DEST);
IF OperandSize = 16
THEN
EIP
<
EIP AND 0000FFFFH;
FI;
ELSE
Terminate loop and continue program execution at EIP;
FI;