Intel 80287, 80286 manual SCAS/SCASB/SCASW-Compare String Data

Models: 80287 80286

1 515
Download 515 pages 45.04 Kb
Page 310
Image 310

THE 80286 INSTRUCTION SET

SCAS/SCASB/SCASW-Compare String Data

Opcode

Instruction

Clocks

Description

AE

SCAS

mb

7

Compare bytes AL - ES:[Olj, advance 01

AF

SCAS

mw

7

Compare words AX - ES:[Olj, advance 01

AE

SCASB

7

Compare bytes AL - ES:[Olj, advance 01

AF

SCASW

7

Compare words AX - ES:[Olj, advance 01

FLAGS MODIFIED

Overflow, sigri, zero, auxiliary carry, parity, carry

FLAGS UNDEFINED

None

OPERATION

SCAS subtracts the memory byte or word at ES:OI from the AL or AX register. The result is discarded; only the flags are set. The operand must be addressable from the ES register; no segment override is possible.

After the comparison is made, 01 is automatically advanced. If the direction flag is 0 (CLO was executed), 01 increments; if the direction flag is I (STO was executed), 01 decrements. DI increments or decrements by 1 if bytes were compared; by 2 if words were compared.

SCAS can be preceded by the REPE or REPNE prefix for a block search of CX bytes or words. Refer to the REP instruction for details of this operation.

PROTECTED MODE EXCEPTIONS

#GP(O) for an illegal memory operand effective address in the CS, OS, or ES segments; #SS(O) for an illegal address in the SS segment.

REAL ADDRESS MODE EXCEPTIONS

Interrupt 13 for a word operand at offset OFFFFH.

B-100

Page 310
Image 310
Intel 80287, 80286 manual SCAS/SCASB/SCASW-Compare String Data