Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

***MIPS*** Problem Description: Solve a quadratic equation in two linked files. Write a function to calculate the roots of any quadratic equation of the form

***MIPS***

Problem Description:

Solve a quadratic equation in two linked files. Write a function to calculate the roots of any quadratic equation of the form ax2+bx+c. a, b, and c are all single-precision floating point values and are passed to the function on the stack. The order you put the arguments on the stack is up to you.

When you return, there should be three items on the stack, two floating point values (referred to below as r1 and r2), and a Status integer. Status indicates the nature of the results returned. Again, the order you put the three values on the stack is up to you.

Status:

0 : 2 real roots in r1 & r2

1 : 1 real root in r1; r2 can be ignored

2: 2 complex roots of the form (r1 i r2)

3 : no roots computed (error); r1 and r2 can be ignored.

Your program should prompt for the values a, b, and c, then label and print the results. For the purposes of this function, assume two numbers that are within 0.001 are the same.

Submit the Following File(s):

roots.asm, roots_main.asm

Required Input:

Three 32-bit floating point numbers (a, b, and c)

Required Output:

Your output should look something like the following examples.

 Quadratic Solver a: 4.3 b: -2.45 c: 2.0 There are two complex roots: 0.284883721 +/- 0.619643078i

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

Database Management An Organizational Perspective

Authors: Richard T. Watson

1st Edition

0471305340, 978-0471305347

More Books

Students also viewed these Databases questions

Question

1. What are the peculiarities of viruses ?

Answered: 1 week ago

Question

Describe the menstrual cycle in a woman.

Answered: 1 week ago

Question

Explain methods of metal extraction with examples.

Answered: 1 week ago