It is desired to multiply the numbers 0AH by 0BH and store the result in the accumulator. The numbers are available in registers B and C, respectively. A part of the 8085 program for this purpose is given below: MVI A, 00H; Loop:---; ---; ---; ---. The sequence of remaining 4 instructions to complete the program would be
1
A, B, C, D
2
A, C, B, D
3
B, A, C, D
4
C, B, D, A
Official Solution
Correct Option: (2)
Step 1: Understand the task.
The program needs to compute 0AH 0BH. This can be done by adding 0AH to an accumulator 0BH (11 decimal) times.
Register B holds the number to be added (0AH). Register C holds the loop count (0BH). The accumulator (A) will store the sum, starting from 0.
Step 2: Outline the program logic.
Initialize the accumulator to 0. (Given: `MVI A, 00H`) Start a loop. Add the contents of register B to the accumulator. (Instruction: `ADD B`) Decrement the loop counter in register C. (Instruction: `DCR C`) Check if the counter (C) has reached zero. If not, repeat the loop. (Instruction: `JNZ LOOP`) If the counter is zero, halt the program. (Instruction: `HLT END`)
Step 3: Match the logic to the given instructions.
The instruction to add B is A. ADD B. The instruction to decrement C is C. DCR C. The instruction to jump if not zero is B. JNZ LOOP. The instruction to halt is D. HLT END.
The correct sequence inside and after the loop is: `ADD B`, then `DCR C`, then `JNZ LOOP`, and finally `HLT END`. This corresponds to the sequence A, C, B, D.