0
19kviews
What is REP prefix? How it functions for string instructions?
1 Answer
written 8.4 years ago by |
Mnemonic: REP
Operation:
Thus, it is important that before we use the REP instruction prefix the following steps must be carried out.
E.g. MOV CX, 0023H
CLD
REP MOVSB
The above section of a program will cause the following string operation
ES: [DI] ← DS: [SI]
SI ← SI + I
DI ← DI + I
CX ← CX – 1
to be executed 23H times (as CX = 23H) in auto incrementing mode (as DF is cleared).
REPZ/REPE (Repeat while zero/Repeat while equal)
REPNZ/REPNE (Repeat while not zero/Repeat while not equal)