Question: C code to MIPS! for(int i =0; i <5;i++) { if(i==0) Z = A+B; else if( i ==1) Z=A-B; else if(i == 2) Z=A*B; else
C code to MIPS!
for(int i =0; i<5;i++) { if(i==0) Z = A+B; else if( i ==1) Z=A-B; else if(i == 2) Z=A*B; else if(i == 3) Z=A*2; else if(i ==4) Z=A/2; }
i should be loaded at $t0; A, B and Z should be loaded at $S0, $S1, and $S2 Respectively. Print the result after each operation.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
