0% found this document useful (0 votes)
10 views3 pages

lecture (1)

Uploaded by

blueyard38
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views3 pages

lecture (1)

Uploaded by

blueyard38
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

STRING MANIPULATION

INSTRUCTIONS
LECTURE 15
STRING MANIPULATION INSTRUCTIONS

• REP (Repeat instruction prefix) : REP is a prefix which is written before one of the
string instruction in 8086. These instructions repeat until CX register becomes 0.

• MOVSB/MOVSW (Move string byte or word) : This instruction copies a byte or word
from a location in the data segment to a location in the extra segment. The offset
of the source byte or word in the data segment must be in the SI register. The
offset of the destination in the extra segment must be contained in the DI
register. If DF=0, SI and DI are incremented automatically otherwise they are
decremented.
• CMPSB/CMPSW (Compare string byte or word) : A String Instruction in 8086 is a series of the same type of data
items in sequential memory locations. The CMPSB /CMPSW instruction can be used to compare a byte in one
string with a byte in another string or to compare a word in one string with a word in another string. SI is used to
hold the offset of a byte or word in the source string and DI is used to hold the offset of a byte or a word in the
other string. The AF, CF, OF, PF, SF, and ZF flags are affected by the comparison.

• SCASB / SCASW (Scan string byte or word) : SCASB/SCASW scans a string byte with a byte in AL or a string word
with word in AX. Affects the AF, CF, OF, PF, SF and ZF flags.

• LODSB / LODSW (Load string byte or word ) : This instruction copies a byte from a string location pointed to by SI
to AL, or a word from a string location pointed to by SI to AX. LODS does not affect any flags.

• STOSB /STOSW (Store string byte or word) : The STOS instruction copies a byte from AL or a word from AX to a
memory location in the extra segment.

You might also like