Question
An 8085 microprocessor accesses two memory locations (2001 H) and (2002 H), that contain 8-bits
numbers 98 H and B1 H, respectively. The following program is executed :
LXI H, 2001 H
MVI A, 21 H
INX H
ADD M
INX H
MOV M, A
HLT
At the end of this program, the memory location 2003 H contains the number in decimal (base 10) form
Answer :
Ans. 210
LXI H, 2001H; H = 20 H, L = 01 H
MVI A, 21H; A = 21 H
INX H; HL + 1 → H = 20 H, L = 02 H → HL = 2002 H
ADD M; [A] + Reference data of HL pair = 21 H + B1 H = D2H → [A]
INX H; [HL] + 1 → 2002 H + 1 H → 2003H
MOV M, A; [A] to Memory, reference of HL pair, 2003 H [D2] ß [D2] = A
HLT; Stop
Therefore, content in the 2003 H is D2H
Converting in decimal
D × 161 + 2 × 16° ⇒ 13 × 16 + 2 = (210)10
Copyright © 2025 Test Academy All Rights Reserved