Compile the following C code into MIPS i0 while i

Compile the following C code into MIPS:

i=0;  

        while (i<=100) do

            A[4*i]=0;  

        where integer i is in register $s0 and the base memory address of array A is in$s1.


For turning in this homework, please bring your it to the class on February 21.

Solution

Code:

Note: In your question, the value of i is not incremented.So,it will stuck in infinite loop. So, here I incremented the value by 1.

Compile the following C code into MIPS: i=0; while (i<=100) do A[4*i]=0; where integer i is in register $s0 and the base memory address of array A is in$s1.

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site