Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribed 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

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

Step: 3

blur-text-image

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

Systems Analysis And Synthesis Bridging Computer Science And Information Technology

Authors: Barry Dwyer

1st Edition

0128054492, 9780128054499

More Books

Students also viewed these Databases questions

Question

Discuss the states of accounting

Answered: 1 week ago

Question

What were the reasons for your conversion or resistance?

Answered: 1 week ago