Question: C code to Mips Consider the following C code and its MIPS translation, assuming x is in $s3 and y isin $s4. # C Code
C code to Mips
Consider the following C code and its MIPS translation,
assuming x is in $s3 and y isin $s4.
# C Code
if(x==y)
x++;
else
y++;
# MIPSCode
bne $s3,$s4,Else
addi $s3,$s3,1
j Exit
Else:addi $s4, $s4,1
Exit:noop
Write MIPS code for the following C codes:
(a)
# C Code
if(x!=y&&x==0)
x++;
else
y++;
(B)
# C code
while( x<10){
y=y+10;
x++;
}
(c)
#c code
switch(x) {
case 0 : y++; break;
case 1: y ; break;
default : break;
}
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
