Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started