What will be the output at PORT1 if the following program is executed? MVI B,…
2015
What will be the output at PORT1 if the following program is executed?
MVI B, 82H
MOV A, B
MOV C, A
MVI D, 37H
OUT PORT1
HLT
- A.
37𝐻
- B.
82𝐻
- C.
𝐵9𝐻
- D.
00𝐻
Attempted by 42 students.
Show answer & explanation
Correct answer: B
Key insight: OUT PORT1 sends the contents of the accumulator (A) to the port.
MVI B, 82H → B = 82H
MOV A, B → A = B = 82H (accumulator now holds 82H)
MOV C, A → C = 82H (copies accumulator value to C; does not change A)
MVI D, 37H → D = 37H (this sets D but does not affect A)
OUT PORT1 → sends contents of A to PORT1; A = 82H, so PORT1 receives 82H
HLT → program halts
Final answer: PORT1 receives 82H