Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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 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 -107814Step 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