[問題] C語言轉成MIPS語言

作者: ts02406574 (胖胖佬)   2016-04-27 12:38:17
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;
}
作者: suhorng ( )   2016-04-27 16:41:00
請增加文章內容 (違反板規二)

Links booklink

Contact Us: admin [ a t ] ucptt.com