Home » Embedded Systems

String handling in the 8086 Microprocessor

In this article, we are going to study about strings in 8086 Microprocessor. We will first describe what strings are, and then will learn how they are stored and handled inside the 8086 microprocessor?
Submitted by Monika Sharma, on August 05, 2019

While talking about the 8086 microprocessors, the Strings can be defined as the collection of ASCII characters. Each ASCII character is of one byte, and each byte of a String is stored at successive memory locations.

Source Index (SI), Destination Index (DI) and the general-purpose register-CX (which functions as a counter) are the registers involved in performing string operations.

The following are the various string manipulation instructions in the 8086 microprocessor:

1) REP

Stands for 'Repeat'. This instruction repeats the given instruction(s) till CX does not becomes zero, i.e. CX!=0

    REP  instruction_to_be_repeated

2) REPE

This instruction repeats the given instruction(s) till CX remains zero, i.e. CX=0

    REPE  instruction_to_be_repeated

3) REPZ

It repeats the given instruction(s) while ZF remains 1, i.e. ZF=1

    REPZ  instruction_to_be_repeated

4) REPNE

This instruction is same as REP. It repeats the given instruction(s) till CX remains zero, i.e. CX=0

    REPZ  instruction_to_be_repeated

5) REPNZ

It repeats the instructions while ZF=0

    REPNZ  instruction_to_be_repeated

6) MOVSB

Stands for 'Move String Byte'. It moves the contents of a byte (8 bits) from DS:SI to ES:DI

    MOVSB

7) MOVSW

Stands for 'Move String Word'. It moves the contents of a word (16 bits) from DS:SI to ES:DI

    MOVSW

8) MOVSD

Stands for 'Move String Double Word'. It moves the contents of a double word (32 bits) from DS:SI to ES:DI

    MOVSD

9) CMPSB

Stands for 'Compare String Byte'. It moves the compares the contents of a byte (8 bits) at DS:SI with the contents of a byte at ES:DI and sets the flag.

    CMPSB

10) CMPSW

Stands for 'Compare String Word'. It moves the compares the contents of the word (16 bits) at DS:SI with the contents of the word at ES:DI and sets the flag.

    CMPSW

11) CMPSD

Stands for 'Compare String Double Word'. It moves the compares the contents of the double word (32 bits) at DS:SI with the contents of the double word at ES:DI and sets the flag.

    CMPSD





Comments and Discussions

Ad: Are you a blogger? Join our Blogging forum.
Learn PCB Designing: PCB DESIGNING TUTORIAL




Languages: » C » C++ » C++ STL » Java » Data Structure » C#.Net » Android » Kotlin » SQL
Web Technologies: » PHP » Python » JavaScript » CSS » Ajax » Node.js » Web programming/HTML
Solved programs: » C » C++ » DS » Java » C#
Aptitude que. & ans.: » C » C++ » Java » DBMS
Interview que. & ans.: » C » Embedded C » Java » SEO » HR
CS Subjects: » CS Basics » O.S. » Networks » DBMS » Embedded Systems » Cloud Computing » Machine learning » CS Organizations » Linux » DOS
More: » Articles » Puzzles » News/Updates

© https://www.includehelp.com some rights reserved.