MCQ | String Manipulation Instructions in the 8086 microprocessor

Multiple choice questions and answers (MCQ) based on the String Manipulation Instructions in 8086 microprocessor with 4 choices, correct answer and explanation.
Submitted by Monika Sharma, on September 01, 2019

Question 1:

A string is a collection of characters. Each Character is an of byte length which is stored at successive locations. In the 8086 microprocessor, which characters are considered in the string?

  1. EBCDIC characters
  2. ASCII characters
  3. A string does not treat characters
  4. None of the above

Answer: a. ASCII characters


In the 8086 microprocessor's assembly language, the String is the collection of ASCII characters.

Question 2:

While performing any of the MOVE instructions over Strings, i.e. MOVSB, MOBSW or MOVSD, by default, the data is transferred from -

  1. DS:SI to ES:DI
  2. ES:DI to DS:SI
  3. ES:SI to DS:DI
  4. None of the above

Answer: a. DS:SI to ES:DI


By default, every move instruction transfers data from the address calculated from DS register and contents of SI to the address calculated from ES register the contents of DI, i.e. from DS: SI to ES: DI.

Question 3:

Which of the following is the correct code for repeating the MOVSB instructions 10 times?

  2. REP 10 MOV SB
  3. CX=10
  4. None of the above

Answer: c. CX =10 REP


REP instruction repeats the given instruction(s) till CX does not becomes zero, i.e. CX != 0. So, for executing the mentioned instruction 10 times, we need to initialize the CX register with 10.

Question 4:

Which of the following flags gets affected when a compare instruction, i.e. CMPSB, CMPSW or CMPSD is executed?

  1. Direction Flag (DF)
  2. Trap Flag (TF)
  3. Interrupt Flag (IF)
  4. Zero Flag (ZF)

Answer: d. Zero Flag (ZF)


Whenever a compare instruction over strings is executed, the status flags are affected. From the mentioned options, only Zero Flag is a status flag. The rest are the Control Flags.

Question 5:

At a time, on how many bits can we operate while performing any string operation?

  1. 8 bits
  2. 16 bits
  3. 32 bits
  4. All of the above

Answer: d. All of the above


The string operations can be performed either on 1 byte, 2 bytes or 4 bytes at a time. In the string instructions, for example, Move instructions, in MOVSB, 'B' stands for Byte, i.e. 8 bits. Similarly, in MOVSW, 'W' stands for a word, i.e. 16 bits and in MOVSD, 'D' stands for a double word, i.e. 32 bits.

Comments and Discussions!

Load comments ↻

Copyright © 2024 All rights reserved.