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, 35H

MOV B, A

STC

CMC

RAR

XRA B

  1. A.

    00H

  2. B.

    35H

  3. C.

    EFH

  4. D.

    2FH

Attempted by 28 students.

Show answer & explanation

Correct answer: D

Solution: Simulate the program step by step.

  • MVI A, 35H -> A = 35H (00110101b). MOV B, A -> B = 35H.

  • STC sets Carry = 1. CMC complements Carry -> Carry = 0.

  • RAR (rotate A right through Carry): before RAR A = 00110101b and Carry = 0. RAR makes A = (Carry << 7) | (A >> 1) = 00011010b = 1AH, and the old A0 (1) becomes Carry = 1.

  • XRA B (A = A XOR B): A = 1AH (00011010b) XOR B = 35H (00110101b) -> result = 00101111b = 2FH.

Final accumulator value: 2FH

Explore the full course: Mppsc Assistant Professor