String manipulation instructions in 8086 microprocessor


String is a group of bytes/words and their memory is always allocated in a sequential order. String is either referred as byte string or word string. Here we will see some instructions which are used to manipulate the string related operations.

The String manipulation instructions are as follows.

Opcode
Operand
Description
REP
Instruction
Used to repeat the given instruction till CX ≠ 0.
REPE/REPZ
Instruction
Used to repeat the given instruction until CX = 0 or zero flag ZF = 1.
REPNE/REPNZ
Instruction
Used to repeat the given instruction until CX = 0 or zero flag ZF = 1.
MOVS/MOVSB/MOVSW
----
Used to move the byte/word from one string to another.
COMS/COMPSB/COMPSW
----
Used to compare two string bytes/words.
INS/INSB/INSW
----
Used as an input string/byte/word from the I/O port to the provided memory location.
OUTS/OUTSB/OUTSW
----
Used as an output string/byte/word from the provided memory location to the I/O port.
SCAS/SCASB/SCASW
----
Used to scan a string and compare its byte with a byte in AL or string word with a word in AX.
LODS/LODSB/LODSW
----
Used to store the string byte into AL or string word into AX.

 

Updated on: 30-Jul-2019

9K+ Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements