Question

5. Consider the SPIM code below. globl main .text main: ori $t1, $0, 10 ori $t2, $0, 11 add $t3, $t1,$t2 move $t4, $t3 The foWhat will be the next PC value? Move is not included in MIPS Machine Code. How it is converted? Check the image. The Register

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

1) The next PC value will be 0040002c (32 bits in hexa decimal notation). Next PC is current PC + 4 for a non jump linear instruction.

2) move dest-reg src-reg, is internally translated into addu dest-reg $0 src-reg, i.e, adding 0 to unsigned value of src-reg and saving to dest-reg

3) The previous instruction was ori $t1 $0 10,

$t1 represents register R9

ori stands for or immediate, this instruction takes or with 0 and 10 and saves into R9

10 represented in hexa decimal is 'a'

Hence, R9 have a 'a'.

4) Currently,

R9 = 10

After, ori $t2 $0 11,

R9 = 10

R10 = 11 or 0 = 11

After, add $t3 $t2 $t1,

R9 = 10

R10 = 11

R11 = 11 + 10 = 21

After, move $t4 $t3,

R9 = 10

R10 = 11

R11 = 21

R12 = R11 = 21

Add a comment
Know the answer?
Add Answer to:
5. Consider the SPIM code below. globl main .text main: ori $t1, $0, 10 ori $t2,...
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
ADVERTISEMENT