Question

What is the content of the accumulator after executing the following code? Answer in decimal format. MOV A,#OABH SETBC RRCA C

0 0
Add a comment Improve this question Transcribed image text
Answer #1

So lets execute the program instruction by instruction

1 Mov A # 0AB H

As data is in hexadecimal so Converting to decimal

0AB = 0000 1010 1011

Data in A = 0000 1010 1011

2. SETB C

This instruction is used to set the Carry Flag so

C=1

3.RRC A

Rotate RIght with carry

In this instruction, each bit is shifted to the adjacent right position. Bit D7 becomes D0. Carry flag C is modified according to the bit D0.

 A = D7 D6 D5 D4 D3 D2 D2 D0

For example

//before the instruction A = 10000001; C=0 //after 1st RRC A = 11000000; C=1 

So RRC A will be

// Before the Instruction we have

A= 0000 1010 1011 ; C = 1

After RRC A

A= 1000 0101 0101 C =1

4. CLR C

This instruction will clear the Carry Flag

C=0

5.

RLC A

In this instruction, each bit is shifted to the adjacent left position. Bit D7 becomes D0. Carry flag C is modified according to the bit D7

For example

//before the instruction A = 10101010; C=0 //after 1st RLC A = 01010101; C=1 

So Now RLC A

// before the instruction

A= 1000 0101 0101 C =0

// After RLC A

A= 1000 0010 1010   C = 1

The final data of accumulator after executing the program

A= 1000 0010 1010 = 82A

In Decimal = 2090

Note ---> Don't confuse IN RRC and RLC with example as that is acc to 8 bit data but our data is 12 bit so we do accordingly.That i only showed so that it is easy to grasp it

Thank You

I hope u get the answer well so please upvote it and comment any doubt u have

Add a comment
Know the answer?
Add Answer to:
What is the content of the accumulator after executing the following code? Answer in decimal format....
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT