GATE 2020 EE – Question 64
An 8085 microprocessor accesses two memory locations (2001H) and (2002H), that contain 8-bit numbers 98H and B1H, respectively. The following program is executed:
LXI H,2001H
MVI A,21H
INX H
ADD M
INX H
MOV M,A
HLTAt the end of this program, the memory location 2003H contains the number in decimal (base 10) form ________.
Practise this question in The GATE Grind →
Show answer and explanation
Correct answer: 210
Explanation
LXI loads HL=2001H, MVI loads A=21H, and INX H makes HL=2002H. ADD M adds the contents of 2002H, B1H, to A: $21\text{H}+\text{B1H}=\text{D2H}$. INX H gives HL=2003H, and MOV M,A stores D2H there. $\text{D2H}=13\times16+2=210$.