3-630
INSTRUCTION SET REFERENCE
SCAS/SCASB/SCASW/SCASDScan String (Continued)
Operation
IF (byte cmparison)
THEN
temp
<
AL
?
SRC;
SetStatusFlags(temp);
THEN IF DF = 0
THEN (E)DI
<
(E)DI + 1;
ELSE (E)DI
<
(E)DI 1;
FI;
ELSE IF (word comparison)
THEN
temp
<
AX
?
SRC;
SetStatusFlags(temp)
THEN IF DF = 0
THEN (E)DI
<
(E)DI + 2;
ELSE (E)DI
<
(E)DI 2;
FI;
ELSE (* doubleword comparison *)
temp
<
EAX
?
SRC;
SetStatusFlags(temp)
THEN IF DF = 0
THEN (E)DI
<
(E)DI + 4;
ELSE (E)DI
<
(E)DI 4;
FI;
FI;
FI;
Flags Affected
The OF, SF, ZF, AF, PF, and CF flags are set according to the temporary result of the comparison.
Protected Mode Exceptions
#GP(0)
If a memory operand effective address is outside the limit of the ES
segment.
If the ES register contains a null segment selector.
If an illegal memory operand effective address in the ES segment is given.
#PF(fault-code)If a page fault occurs.
#AC(0)
If alignment checking is enabled and an unaligned memory reference is
made while the current privilege level is 3.