![](/images/new-backgrounds/1290705/290705367x1.webp)
SCAS SCAN (BYTE OR SCAS
WORD) STRING
Operation: | Flags Affected: |
(LSRC) - (RSRC) | AF,CF,OF,PF,SF,ZF |
if (OF) = 0 then (01) ~ (01) + OELTA |
|
else (01) ~ (01) - OELTA |
|
Description:
seAS destination-string
SCAS (Scan String) subtracts the destination string element (byte or word) addressed by DI from the content of AL (byte string) or AX (word string) and updates the flags, but does not alter the destination string or the accum- ulator. SCAS also updates DI to point to the next string element and AF, CF, OF, PF, SF and ZF to reflect the relationship of the scan value in ALIAX to the string element. If
SCAS is prefixed with REPE or REPZ, the operation is interpreted as "scan while not
Encoding:
11010111wl
if w = 0 then LSRC = AL, RSRC = (01), OELTA = 1 else LSRC = AX, RSRC = (01) +1:(01), OELTA = 2
SCAS Operands | Clocks* | Transfers | Bytes | SCAS Coding Example |
15(19) | 1 | 1 | SeAS INPUT_LINE | |
(repeat) | 9 + 15(19)/rep | 1/rep | 1 | REPNE SeAS BUFFER |
*b(w): where b denotes the number of clock cycles for byte operands and w denotes the number of clock cycles for word operands.