























Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
An overview of string instructions in 8086 assembly language. String instructions are designed for array processing, including copying, searching, storing, and comparing strings of characters. the use of the DUP operator for declaring large arrays, the syntax for string operations, and the role of the direction flag (DF) and index registers SI and DI. String instructions include MOVSB, MOVSW, MOVSD, STOSB, STOSW, STOSD, LODSB, LODSW, LODSD, SCASB, SCASW, SCASD, CMPSB, CMPSW, and CMPSD.
Typology: High school final essays
1 / 31
This page cannot be seen from the preview
Don't miss anything!
























Move string Store string Load string Scan string Compare string
MOVSB STOSB LODSB SCASB CMPSB
MOVSW STOSW LODSW SCASW CMPSW
MOVSD STOSD LODSD SCASD CMPSD
Move string from one variable to another variable
Store the content of al register to a destination variable
Load a string from source to Al register ( Al register work here as a destination.
Compare contents of destination variable with content of Al register
Compare the contents of source variable to the contents of destination variable
declared
- String db ‘ABCDE ’
A B C D
Destination Source
DI SI
A B C D
memory addresses from left to right.
- DF = 0 => forward (left to right) processing
memory addresses from right to left
- DF = 1 => backward (right to left) processing
given by DS:SI into ES:DI
given by DS:SI into ES:DI
given by DS:SI into ES:DI
Note: the string instructions use DS:SI as the Source
string and ES:DI as the destination string. (For the string instructions, DI references an offset in the ES by default).
Before MOVSB
String 1 H E L L O
SI
offset
0 1 2 3 4
String 2
offset (^5 6 7 8 )
DI
After MOVSB
String 1 H E L L O
SI
offset
0 1 2 3 4
String 2 (^) H E
offset (^5 6 7 8 )
DI
;right to left processing