Question

write in assembly $t0 is i and $t1 is j and $s0 is W please include...

write in assembly
$t0 is i and $t1 is j and $s0 is W please include comments

for (i=50; i> j ; i--)
W[i]=-17*i;

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

addi $t0 , $0, 50   # initializes i to 50

addi $s1, $0 , -17    #initlizition of $s1 with -17

Loop:

         slt $t2 ,$t0 ,$t1      #set to 0 , if i<j

         beg $t2 , $0, Loopend   #exit if condition fails

         Mul $s0 ,$s1, $t0   #address of W[i] and multiples it with the value of $s1 and saves in $so

Loopend

Add a comment
Know the answer?
Add Answer to:
write in assembly $t0 is i and $t1 is j and $s0 is W please include...
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