in CO and Architecture recategorized by
6,074 views
1 vote
1 vote

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. $00H$ 
  2. $35H$
  3. $EFH$
  4. $2FH$
in CO and Architecture recategorized by
6.1k views

1 Answer

2 votes
2 votes
Best answer

MVI A, 35H   // content of accumulator = 35H = 0011 0101

MOV B, A     // content of register B = 35H

STC              // set carry flag = 1.

CMC             // complement carry flag = not( 1) = 0.

RAR              // Each binary bit of the accumulator is rotated right by one position through the Carry flag. And modify carry = D0.

and D7 = previous carry.

                      //  Now content of accumulator = 0001 1010  , carry = 1.

XRA B             // The content of accumulator are exclusive OR with register B. 

 (0011 0101 ) xor ( 0001 1010 ) 

 = 0010 1111

 = 2F H ( Ans - D)

selected by

Related questions