Question

In the code fragment below, what is the state of the registers R4, R5, and R6...

In the code fragment below, what is the state of the registers R4, R5, and R6 after the code fragment is executed (all numbers decimal unless otherwise specified)?

mov R0, #5
mov R1, #8
add R4, R0, R0
mul R5, R1, R1
sub R6, R5, R4

Group of answer choices

R4 = 64
R5 = 10
R6 = 54
R4 = 10
R5 = 64
R6 = 54
R4 = 54
R5 = 64
R6 = 10
R4 = 64
R5 = 10
R6 = 54
0 0
Add a comment Improve this question Transcribed image text
Answer #1
1.mov R0, #5
       This statement moves integer 5 to register R0.
2.mov R1, #8
       This statement moves integer 8 to register R1.
3.add R4, R0, R0
        This statement adds values in second and third registers and stores the result in first             register.So R4=R0+R0.
        So now R4 contains value 10(5+5)
4.mul R5, R1, R1
        This statement will multiply the values in registers R1 and R1 and stores the result in R5.
        So now R5 contains value 64(8*8).
5.sub R6, R5, R4

This statement will subtract third register value from second register and stores the result in first register.

So now R6=R5-R4=64-10=54

After the execution of the code fragment:

R4 =10,R5=64,R6=54

Add a comment
Know the answer?
Add Answer to:
In the code fragment below, what is the state of the registers R4, R5, and R6...
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