Question: Translate this C loop into MIPS instructions, assuming that our ISA requires one delay slot for every branch. Try to ill delay slots with non-NOP

Translate this C loop into MIPS instructions, assuming that our ISA requires one delay slot for every branch. Try to ill delay slots with non-NOP instructions when possible. You can assume that variables a, b, c, i, and j are kept in registers r1, r2, r3, r4, and r5.


The remaining four problems in this exercise refer to the following C loop:a. b. for(i=0;i!-j; i++) { c+=a[i]; } for(i=0;i!-j;i+=2) { c+ a[i]-a[i+1]; }

a. b. for(i=0;i!-j; i++) { c+=a[i]; } for(i=0;i!-j;i+=2) { c+ a[i]-a[i+1]; }

Step by Step Solution

3.34 Rating (151 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Heres the translation of the given C loops into MIPS assembly instructions assuming that variables a ... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Computer Organization Design Questions!