THE
80286
INSTRUCTION SET
REP
IREPE/REPNE-Repeat Following. String
Operation
Opcode Instruction
Clocks·
Description
F3
6C
REP
INS eb,OX
5+4*CX
Input
CX
bytes from port
OX
into ES:[OI]
F3
60
REP
INS ew,OX
5+4*CX
Input
CX
words from port
OX
into ES:[OI]
F3
6C REP INSB
5+4*CX
Input
CX
bytes from port
OX
into ES:[OI]
F3
60
REP
INSW
5+4*CX
Input
CX
words from port
OX
into ES:[OI]
F3
A4 REP MOVS mb,mb
5+4*CX
Move
CX
bytes from [SI] to ES:[OI]
F3
A5
REP MOVS
mW,mw
5+4*CX
Move
CX
words from [SI] to ES:[OI]
F3
A4
REP
MOVSB
5+4*CX
Move
CX
bytes from OS:[SI] to ES:[OI]
F3
A5
REP
MOVSW
5+4*CX
Move
CX
words from OS:[SI]
to
ES:[OI]
F3
6E
REP
OUTS OX,eb
5+4*CX
Output
CX
bytes from [SI] to port
OX
F3
6F REP OUTS OX,ew
5+4*CX
Output
CX
words from [SI]
to
port
OX
F3
6E REP OUTSB
5+4*CX
Output
CX
bytes from OS:[SI] to port
OX
F3
6F REP OUTSW
5+4*CX
Output
CX
words from OS:[SI] to port
OX
F3
AA
REP STOS
mb
4+3*CX
Fill
CX
bytes at ES:[OI] with AL
F3
AB
REP
STOS mw
4+3*CX
Fill
CX
words at ES:[OI] with
AX
F3
AA
REP
STOSB
4+3*CX
Fill
CX
bytes at ES:[OI] with AL
F3
AB
REP
STOSW
4+3*CX
Fill
CX
words at ES:[OI] with
AX
F3
A6
REPE
CMPS mb,mb
5+9*N
Find non matching bytes in ES:[OI] and [SI]
F3
A7
REPE CMPS
mW,mw
5+9*N
Find non matching words
in
ES:[OI] and [SI]
F3
A6
REPE
CMPSB
5+9*N
Find nonmatching bytes in ES:[OI] and OS:[SI]
F3
A7
REPE
CMPSW
5+9*N
Find nonmatching words
in
ES:[OI]
and
OS:[SI]
F3
AE
REPE
SCAS
mb
5+S*N
Find non-AL byte starting at ES:[OI]
F3
AF
REPE
SCAS mw
5+S*N
Find non-AX word starting at ES:[OI]
F3
AE
REPE
SCASB
5+S*N
Find non-AL byte starting at ES:[OI]
F3
AF REPE SCASW
5+S*N
Find non-AX word starting at ES:[OI]
F2
A6
REPNE
CMPS mb,mb
5+9*N
Find matching bytes in ES:[OI] and [SI]
F2
A7 REPNE CMPS
mW,mw
5+9*N
Find matching words
in
ES:[OI] and [SI]
F2
A6
REPNE CMPSB
5+9*N
Find matching bytes in ES:[OI] and OS:[SI]
F2
A7
REPNE CMPSW
5+9*N
Find matching words
in
ES:[OI] and OS:[SI]
F2
AE
REPNE SCAS
mb
5+S*N
Find AL, starting at ES:[OI]
F2
AF REPNE SCAS mw
5+S*N
Find
AX,
starting at ES:[OI]
F2
AE REPNE SCASB
5+S*N
Find AL, starting at ES:[OI]
F2
AF
REPNE
SCASW
5+S*N
Find
AX,
starting at ES:[OI]
*
N denotes the number
of
iterations actually executed.
FLAGS MODIFIED
By
CMPS and SCAS, none by REP
FLAGS UNDEFINED
None
OPERATION
REP, REPE, and
REPNE
are prefix operations. These prefixes cause the string instruction that
follows
to be repeated CX times or (for REPE and REPNE) until the indicated condition
in
the zero flag
is
no
longer met. Thus, REPE stands for "Repeat while equal,"
REPNE
for "Repeat while not equal."
B-92