Answered step by step
Verified Expert Solution
Link Copied!

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;

}

image text in transcribed

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Select Healthcare Classification Systems And Databases

Authors: Katherine S. Rowell, Ann Cutrell

1st Edition

0615909760, 978-0615909769

More Books

Students also viewed these Databases questions