Question:

The output of the following program is: 

Show Hint

The DAD B instruction in 8085 adds the contents of register pair BC to HL without affecting flags except the carry flag.
Updated On: Feb 10, 2025
  • 1234h
  • 7938h
  • 7939h
  • 129Bh
Hide Solution
collegedunia
Verified By Collegedunia

The Correct Option is C

Solution and Explanation

Step 1: Understanding the instructions: 
1. LXI H, 1234h → Load register pair HL with 1234h. \[ HL = 1234h \] 
2. MVI C, 05h → Load C with 05h. 
3. MVI B, 67h → Load B with 67h. 
4. DCR C → Decrement C to 04h. 
5. DAD B → Add HL = HL + BC. 
Step 2: Calculating the final value of HL: 
- Initially: \( HL = 1234h \), \( BC = 6704h \). 
- DAD B: \[ HL = 1234h + 6704h = 7938h \] 
6. SHLD Result → Store HL at memory location Result. 
7. HLT → Halt execution. 
Step 3: The correct output stored in memory is 7938h.

Was this answer helpful?
0
0