Convert the following C code into the MIPS assembly code which can be tested b
y using SPIM.
void main(void)
{
int x1, x2, x3, x4, x5, x6, y ;
int add1 ( );
scanf (“%d”, &x1);
scanf (“%d”, &x2);
scanf (“%d”, &x3);
scanf (“%d”, &x4);
scanf (“%d”, &x5);
scanf (“%d”, &x6);
y = add1(x1,x2, x3) + add1 (x4, x5, x6)
printf (“%d\n”, y);
}
int add1(int a, int b, int c)
{
int d;
d = a + b + c;
return d;
}