Question: 1. Convert the following C code to MIPS assembly. Use the proper procedure/function calling conventions. Not using the proper function calling conventions will result in

1. Convert the following C code to MIPS assembly. Use the proper procedure/function calling conventions.

Not using the proper function calling conventions will result in

reduced marks.

int compare(int number1, int y)

{

if(number1 < y)

return 10

else

return 2;

}

int mcheck(int q, int z, int w)

{

w = compare(z+2,z+3);

return (w+q+4);

}

int result=0; //global .data

int array[14] = {1,4,5,6,7,67,3,20,21,3,9,40,45,46} //global .data

void main()

{

result= mcheck(3, 5, 2);

for(int i=0 ; i < result ; i++)

{

array[i] = array[i] + array[2];

}

printf(The Result is: %d, result);

return 0;

}

BONUS

2. What is the exact output text of the program, you need include the string output and the number.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Accounting Questions!