String manipulation instructions in 8086 microprocessor
String is s series of data byte or word available in memory at consecutive locations. It is either referred as byte string or word string. Their memory is always allocated in a sequential order. Instructions used to manipulate strings are called string manipulation instructions.
Following is the table showing the list of string manipulation instructions:
OPCODE | OPERAND | EXPLANATION | EXAMPLE |
---|---|---|---|
REP | instruction | repeat the given instruction till CX != 0 | REP MOVSB |
REPE | instruction | repeat the given instruction while CX = 0 | REPE |
REPZ | instruction | repeat the given instruction while ZF = 1 | REPZ |
REPNE | instruction | repeat the given instruction while CX != 0 | REPNE |
REPNZ | instruction | repeat the given instruction while ZF = 0 | REPNZ |
MOVSB | none | moves contents of byte given by DS:SI into ES:DI | MOVSB |
MOVSW | none | moves contents of word given by DS:SI into ES:DI | MOVSW |
MOVD | none | moves contents of double word given by DS:SI into ES:DI | MOVD |
LODSB | none | moves the byte at address DS:SI into AL; SI is incr/decr by 1 | LODSB |
LODSW | none | moves the word at address DS: SI into AX; SI is incr/decr by 2 | LODSW |
LODSD | none | moves the double word at address DS:SI into EAX; SI is incr/decr by 4 | LODSD |
STOSB | none | moves contents of AL to byte address given by ES:DI; DI is incr/dec by 1 | STOSB |
STOSW | none | moves the contents of AX to the word address given by ES:DI; DI is incr/decr by 2 | STOSW |
STOSD | none | moves contents of EAX to the DOUBLE WORD address given by ES:DI; DI is incr/decr by 4 | STOSD |
SCASB | none | compares byte at ES:DI with AL and sets flags according to result | SCASB |
SCASW | none | compares word at ES:DI with AX and sets flags | SCASW |
SCASD | none | compares double word at ES:DI with EAX and sets flags | SCASD |
CMPSB | none | compares byte at ES:DI with byte at DS:SI and sets flags | CMPSB |
CMPSW | none | compares word at ES:DI with word at DS:SI and sets flags | CMPSW |
CMPSD | none | compares double word at ES:DI with double word at DS:SI and sets flags | CMPSD |
Recommended Posts:
- Arithmetic instructions in 8086 microprocessor
- Logical instructions in 8086 microprocessor
- Data transfer instructions in 8086 microprocessor
- Process control instructions in 8086 microprocessor
- Program execution transfer instructions in 8086 microprocessor
- 8086 program to transfer a block of 4 bytes by using string instructions
- Arithmetic instructions in 8085 microprocessor
- Machine Control Instructions in Microprocessor
- Logical instructions in 8085 microprocessor
- Branching instructions in 8085 microprocessor
- Data transfer instructions in 8085 microprocessor
- Interrupts in 8086 microprocessor
- Pin diagram of 8086 microprocessor
- Flag register of 8086 microprocessor
- Memory Segmentation in 8086 Microprocessor
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.