Home »
Embedded Systems
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?
- EBCDIC characters
- ASCII characters
- A string does not treat characters
- None of the above
Answer: a. ASCII characters
Explanation:
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 -
- DS:SI to ES:DI
- ES:DI to DS:SI
- ES:SI to DS:DI
- None of the above
Answer: a. DS:SI to ES:DI
Explanation:
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?
- REPEAT MOVSB 10
- REP 10 MOV SB
- CX=10
REP MOVSB
- None of the above
Answer: c. CX =10 REP
MOVSB
Explanation:
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?
- Direction Flag (DF)
- Trap Flag (TF)
- Interrupt Flag (IF)
- Zero Flag (ZF)
Answer: d. Zero Flag (ZF)
Explanation:
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?
- 8 bits
- 16 bits
- 32 bits
- All of the above
Answer: d. All of the above
Explanation:
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.