Question: Instructions: Write an assembly language procedure that will use Intel floating-point instructions to perform the computations required to evaluate the quadratic formula (found in any

 Instructions: Write an assembly language procedure that will use Intel floating-point

Instructions: Write an assembly language procedure that will use Intel floating-point instructions to perform the computations required to evaluate the quadratic formula (found in any algebra textbook). In other words, given the real numbers a, b, and c which represent the coefficients of the terms in the equation ax2 + bx c0, the procedure must solve for the two roots of the equation. This procedure must be called from a high-level language main program (written in C, C++, Java, Pascal, Fortran, or any other high-level language approved by the instructor for which you have access to a compiler) which prompts the user for the values of the real numbers a, b, and c; passes these three values (as well as pointers rootlptr and root2ptr to the two memory locations used to return the roots) to the procedure using the standard mechanism supported by the high-level language compiler (most likely through a stack frame); and (after the called procedure returns) displays the results (the two real roots of the quadratic equation) computed by the assembly language procedure. If the roots of the quadratic are complex (if the number under the radical in the quadratic formula is negative), the called procedure should return an error code of -1 to the calling program (typically this is done in register EAX), which should then display a message to that effect. If the roots are real, the assembly procedure should use the supplied pointers to store the two roots in memory and return 0 to the caller, which will then display the real roots of the quadratic equation to the user. Instructions: Write an assembly language procedure that will use Intel floating-point instructions to perform the computations required to evaluate the quadratic formula (found in any algebra textbook). In other words, given the real numbers a, b, and c which represent the coefficients of the terms in the equation ax2 + bx c0, the procedure must solve for the two roots of the equation. This procedure must be called from a high-level language main program (written in C, C++, Java, Pascal, Fortran, or any other high-level language approved by the instructor for which you have access to a compiler) which prompts the user for the values of the real numbers a, b, and c; passes these three values (as well as pointers rootlptr and root2ptr to the two memory locations used to return the roots) to the procedure using the standard mechanism supported by the high-level language compiler (most likely through a stack frame); and (after the called procedure returns) displays the results (the two real roots of the quadratic equation) computed by the assembly language procedure. If the roots of the quadratic are complex (if the number under the radical in the quadratic formula is negative), the called procedure should return an error code of -1 to the calling program (typically this is done in register EAX), which should then display a message to that effect. If the roots are real, the assembly procedure should use the supplied pointers to store the two roots in memory and return 0 to the caller, which will then display the real roots of the quadratic equation to the user

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!