1. Engineering
  2. Computer Science
  3. translate the following code into mips code for i0 ilt5...

Question: translate the following code into mips code for i0 ilt5...

Question details

Translate the following code into MIPS code.

           

            for (i=0; i<=5; i=i+1)

                        {

                        if (i != k)

                                    k=(k *2)-1;

                                    else

                                    k=(k *4)+1;

                        }

Assume the compiler associates the variables i and k to the registers $s0 and $s1, respectively.

Solution by an expert tutor
Blurred Solution
This question has been solved
Subscribe to see this solution