Question: Using MIPS32 assembly language Learning Objective: To write MIPS32 assembly language instructions which perform arithmetic. To learn how a function is called, ar- guments are

 Using MIPS32 assembly language Learning Objective: To write MIPS32 assembly language Using MIPS32 assembly language

Learning Objective: To write MIPS32 assembly language instructions which perform arithmetic. To learn how a function is called, ar- guments are passed by value, and how the function returns a value. Name your source code file poly3.s. For this exercise you will write a complete MIPS32 assembly language program which prompts the user to enter the three integer coefficients of a third degree integer polynomial equation (a cubic equation) of the form p3(x) = C3x3 + czx? + C1X + Co and a value for x. It will then evaluate the polynomial at that value of x and print the result. Note that x and the coefficients will all be integers because I do not cover how to write assembly language code using floating point (its complicated and I feel confident that if you can write these programs using integers, then if you need to write assembly language code using floating point someday, that you will have no problem). The behavior of the program is illustrated by this sample run and output where user input is shown in bold: Enter c3? 37 Enter c22 - 148 Enter c1? 120 Enter co? -47 Enter x? - 13 p(x) = 37x^3 + -148x^2 + 120x + -47 at x = -13 is -107814 Learning Objective: To write MIPS32 assembly language instructions which perform arithmetic. To learn how a function is called, ar- guments are passed by value, and how the function returns a value. Name your source code file poly3.s. For this exercise you will write a complete MIPS32 assembly language program which prompts the user to enter the three integer coefficients of a third degree integer polynomial equation (a cubic equation) of the form p3(x) = C3x3 + czx? + C1X + Co and a value for x. It will then evaluate the polynomial at that value of x and print the result. Note that x and the coefficients will all be integers because I do not cover how to write assembly language code using floating point (its complicated and I feel confident that if you can write these programs using integers, then if you need to write assembly language code using floating point someday, that you will have no problem). The behavior of the program is illustrated by this sample run and output where user input is shown in bold: Enter c3? 37 Enter c22 - 148 Enter c1? 120 Enter co? -47 Enter x? - 13 p(x) = 37x^3 + -148x^2 + 120x + -47 at x = -13 is -107814

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 Databases Questions!