REPE
Operand:
chain instruction
Repeat following CMPSB, CMPSW, SCASB, SCASW instructions
while ZF = 1 (result is Equal), maximum CX times.
Algorithm:
check_cx:
if CX <> 0 then
do following *chain instruction*
CX = CX - 1
if ZF = 1 then:
go back to check_cx
else
exit from REPE cycle
else
exit from REPE cycle
Flags:
Z
r