Question: MASM Assembly Program ONLY using Irvine32.inc The program will use floating point instructions to compute the root solutions to the quadratic formula. The program must

MASM Assembly Program ONLY using Irvine32.inc

The program will use floating point instructions to compute the root solutions to the quadratic formula.

The program must repeat the calculation 1 million times calculating the time required to solve the formula.

The program should measure performance (Duration) of the program using the FPU instructions.

MAIN

1) Prompt for the coefficients ax^2 +bx +c.

2) Establish loop (ecx register =1000000)

3) Calculate start time (t1)

a) INVOKE GetTickCount

b) mov t1, eax

4) Using FPU instructions calculate

a) b + Sqrt(b^2 -4*a*c)/2*a

b) b - Sqrt(b^2 -4*a*c)/2*a

5) Repeat step4 until ecx==0

6) Calculate start time (t2)

a) INVOKE GetTickCount

b) mov t2, eax

7) Display the roots

8) Display the running time

Example Output:

Pat Programmer's Quadratic Formula Solver

Solve x^2-3x-4 with quadratic Formula using FPU

Enter a coefficient

1

Enter b coefficient

-3

Enter c coefficient

-4

Real Roots:

+4.0000000E+000

-1.0000000E+000

Computational time: +15

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!