Question: Write MIPS assembly code for the following C code. int sub1 (int a, int b) { int ans1; ans1 = a - b; return ans1;
Write MIPS assembly code for the following C code.
int sub1 (int a, int b)
{
int ans1;
ans1 = a - b;
return ans1;
}
int sub2 (int c, int d, int e)
{
int ans2;
ans2 = sub1(c, d) - e:
return ans2:
}
void main()
{
int f = 1, g = 2, h = 3, ans3;
ans3 = sub2 (f, g, h);
return;
}

register variable Sa0 Sal Sa2 $a0 Sal a 2 $a0 Sal ansi ans2 ans3 Returned value of subl procedure Returned value of sub2 Ss1 Ss2 $vo SvO procedure
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
