String manipulation instructions in 8086 microprocessor

MicroprocessorMicrocontroller8086

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.

 

raja
Published on 11-Mar-2019 11:29:22
Advertisements