Translate the following C code to MIPS assembly code. Use a minimum number of instructions.
Register allocations
- i $s0
- j $s1
- base of A[] $s2
- base of B[] $s3
1)
if (i == j){i++;}
else {j--;}
j += i;
2)
A[3] = B[i] + B[j];
3)
i = 0;
while (j != A[i]) {
i++;
}
1)
if ( i == j )
i++;
else
j-- ;
j += i;
Answer:
Get Answers For Free
Most questions answered within 1 hours.