Question Details

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

Show Answer
Correct Answer
210

Solution :

The correct answer is 210.


Step 1: Understand the Given Memory Setup

According to the question, two memory locations contain specific 8-bit values in hexadecimal:

Memory location 2001 H contains the value 98 H.
Memory location 2002 H contains the value B1 H.


Step 2: Trace the 8085 Assembly Program Line by Line

1. LXI H, 2001 H
This instruction loads the 16-bit memory address 2001 H into the HL register pair.
So, HL = 2001 H.


2. MVI A, 21 H
This instruction moves the immediate 8-bit value 21 H into the Accumulator (register A).
So, Accumulator (A) = 21 H.


3. INX H
This instruction increments the content of the HL register pair by 1.
HL = 2001 H + 1 = 2002 H.


4. ADD M
This instruction adds the contents of the memory location pointed to by the HL register pair to the accumulator, storing the result in register A.
Since HL points to 2002 H, the value at memory location 2002 H is B1 H.
Accumulator (A) = (A) + (2002 H) = 21 H + B1 H.


Let's perform the hexadecimal addition of 21 H and B1 H:

In the lower nibble: 1 + 1 = 2.
In the upper nibble: 2 + B (where B in decimal is 11) = 2 + 11 = 13 (which is D in hexadecimal).


Therefore, 21 H + B1 H = D2 H.
So, Accumulator (A) now holds the hexadecimal value D2 H.


5. INX H
Increments the HL register pair by 1 again.
HL = 2002 H + 1 = 2003 H.


6. MOV M, A
Moves the contents of the accumulator (A) into the memory location pointed to by HL.
Since HL = 2003 H and A = D2 H, memory location 2003 H now stores D2 H.


7. HLT
Stops the execution of the program.


Step 3: Convert Hexadecimal D2 H to Decimal (Base 10)

The value stored in memory location 2003 H is D2 H. To convert D2 H to decimal:

( D2 ) 16 = ( D × 16 1 ) + ( 2 × 16 0 )

Since the hex digit D equals 13 in decimal:

( D2 ) 16 = ( 13 × 16 ) + ( 2 × 1 ) = 208 + 2 = 210


Thus, the number stored in memory location 2003 H in decimal form is 210.

Transparent Access on Mindyard

Built for Learners & Educators Alike

Completely free for students. Educators & coaching institutes get 2 months free Pro trial to create tests.

FREE FOR STUDENTS

Practice & Learn Free for Students

Access unlimited practice questions, detailed step-by-step solutions, and exam study materials — completely free for students.

  • Unlimited mock tests & question bank practice
  • Full access to curated study library & formula notes
  • 100% free for students • No credit card required
2 MONTHS FREE TRIAL

Educators & Coaching Institutes

Create and conduct professional online assessments with AI question generation, tab proctoring, and comprehensive batch management.

  • AI question uploader & rapid test generator
  • Anti-cheating tab proctoring & performance reports
  • Full Pro access free for 60 days • No upfront commitment
Discover more resources

You may also like

Mock Tests

View All
  • GATE
  • intermediate
  • 3 hours
  • electrical engineering

Prepare for success in the GATE Electrical Engineering exam with our comprehensive Ultimate Revision Test. Designed for aspirants aiming for top scores, this test covers all key topics in the GATE EE syllabus, including Circuit Theory, Electromagnetic Fields, Power Systems, Electrical Machines, Control Systems, and Analog & Digital Electronics. Our revision test offers a balanced mix of theory-based and application-based questions that will help you assess your understanding and boost your problem-solving skills. With carefully selected questions that mirror the difficulty level of the actual GATE exam, this test will help you identify areas for improvement and fine-tune your exam strategy.

  • SSC
  • intermediate
  • 1 hour
  • english, general awareness, general intelligence and reasoning, logical reasoning, quant

SSC CHSL Tier-1 Shift 1 2 July 2024 question paper with answers and detailed solutions. This practice paper covers questions from General Intelligence & Reasoning, General Awareness, Quantitative Aptitude, and English Language as asked in the SSC CHSL Tier-1 examination. Practice the SSC CHSL 2 July 2024 Shift 1 paper to understand the exam pattern, question types, difficulty level, and important topics for upcoming SSC CHSL exams.

Ask AI Tutor
5 left
Q1 View Question & Options
AI Tutor is solving this question...
Reading question context & options...
Ask your own doubt or choose a quick prompt: