INSTRUCTION SET DESCRIPTIONS

Table C-4. Instruction Set (Continued)

Name

Description

Operation

Flags

Affected

 

 

 

 

 

 

 

SCAS

Scan String:

When Source Operand is a Byte:

AF

 

SCAS dest-string

(AL) – (byte-string)

CF

 

DF –

 

Subtracts the destination string

if

 

IF –

 

(DF) = 0

 

element (byte or word) addressed by

 

OF

 

then

 

DI from the content of AL (byte string)

 

PF

 

(DI) (DI) + DELTA

 

or AX (word string) and updates the

 

SF

 

else

 

flags, but does not alter the destination

 

TF –

 

(DI) (DI) – DELTA

 

string or the accumulator. SCAS also

 

ZF ¸

 

When Source Operand is a Word:

 

updates DI to point to the next string

 

 

element and AF, CF, OF, PF, SF and

(AX) – (word-string)

 

 

ZF to reflect the relationship of the

 

 

if

 

 

scan value in AL/AX to the string

 

 

(DF) = 0

 

 

element. If SCAS is prefixed with

 

 

then

 

 

REPE or REPZ, the operation is

 

 

(DI) (DI) + DELTA

 

 

interpreted as "scan while not end-of-

 

 

else

 

 

string (CX not 0) and string-element =

 

 

(DI) (DI) – DELTA

 

 

scan-value (ZF = 1)." This form may be

 

 

 

 

 

used to scan for departure from a

 

 

 

given value. If SCAS is prefixed with

 

 

 

REPNE or REPNZ, the operation is

 

 

 

interpreted as "scan while not end-of-

 

 

 

string (CX not 0) and string-element is

 

 

 

not equal to scan-value (ZF = 0)."

 

 

 

Instruction Operands:

 

 

 

SCAS dest-string

 

 

 

SCAS (repeat) dest-string

 

 

 

 

 

 

NOTE: The three symbols used in the Flags Affected column are defined as follows:

the contents of the flag remain unchanged after the instruction is executed ¸? the contents of the flag is undefined after the instruction is executed

the flag is updated after the instruction is executed

C-42

Page 365
Image 365
Intel 80C186XL, 80C188XL user manual Scan String When Source Operand is a Byte, Scas dest-string