Array Loop Preview


Consider the following C code segment:

        /* Double every value in A */
        int i;
        for ( i = 0; i < numVals; i++ )
        {
            A[i] *= 2;      /* which means A[i] = A[i] * 2 */
        }


How would we start to translate this to MIPS?

Break it into smaller steps

Translate to MIPS


Alyce Brady, Kalamazoo College