The content of the accumulator after the execution of the following 8085…

2016

The content of the accumulator after the execution of the following 8085 assembly language program, is :

MVI A, 42H

MVI B, 05H

UGC:  ADD B

DCR B

JNZ UGC

ADI 25H

HLT

  1. A.

    82 H

  2. B.

    78 H

  3. C.

    76 H

  4. D.

    47 H

Attempted by 41 students.

Show answer & explanation

Correct answer: C

Solution: compute the accumulator step by step.

Initial values: A = 42H, B = 05H.

  1. Iteration 1: ADD B -> A = 42H + 05H = 47H. DCR B -> B = 04H.

  2. Iteration 2: ADD B -> A = 47H + 04H = 4BH. DCR B -> B = 03H.

  3. Iteration 3: ADD B -> A = 4BH + 03H = 4EH. DCR B -> B = 02H.

  4. Iteration 4: ADD B -> A = 4EH + 02H = 50H. DCR B -> B = 01H.

  5. Iteration 5: ADD B -> A = 50H + 01H = 51H. DCR B -> B = 00H and loop exits.

After the loop, A = 51H.

Then ADI 25H -> A = 51H + 25H = 76H.

Final answer: the accumulator contains 76H.

Explore the full course: Mppsc Assistant Professor