Question: Convert the C program below into an equivalent 64-bit x86-64 assembly language program. #include #include int main(void) { double a, b, c, disc; int status;

Convert the C program below into an equivalent 64-bit x86-64 assembly language program.

#include

#include

int main(void) {

double a, b, c, disc;

int status;

printf("Enter the constants a, b, and c for the quadratic equation: ");

status = scanf("%lf%lf%lf", &a, &b, &c);

if (status != 3)

printf("Error: Invalid input");

else if (a == 0 && b == 0)

printf("The quadratic equation has no solution ");

else if (a == 0)

printf("The quadratic equation has the single root %f ", -c / b);

else {

disc = b * b - 4 * a * c;

if (disc

printf("The quadratic equation has no real roots ");

else if (disc == 0)

printf("The quadratic equation has two equal real roots:%f ", -b / (2 * a));

else {

double sqrtDisc = sqrt(disc);

double root1 = (-b + sqrtDisc) / (2 * a);

double root2 = (-b - sqrtDisc) / (2 * a);

printf("The real roots of the quadratic equation are %f and %f ", root1, root2);

}

}

return 0;

}

 Convert the C program below into an equivalent 64-bit x86-64 assembly

Sample program runs: Enter the constants a, b, and c for the quadratic equation: 6.e x 7.0 Error: Invalid input Enter the constants a, b, and c for the quadratic equation: 2.e 5.e 3.e The real roots of the quadratic equation are -1.e0eee0 and -1.500000 Enter the constants a, b, and c for the quadratic equation: 1 4.e 10.0 The quadratic equation has no real roots Enter the constants a, b, and c for the quadratic equation: 1.e 8.0 16. The quadratic equation has two equal real roots:4.80008 Enter the constants a, b, and c for the quadratic equation : e. .e 6.5 The quadratic equation has no solution Sample program runs: Enter the constants a, b, and c for the quadratic equation: 6.e x 7.0 Error: Invalid input Enter the constants a, b, and c for the quadratic equation: 2.e 5.e 3.e The real roots of the quadratic equation are -1.e0eee0 and -1.500000 Enter the constants a, b, and c for the quadratic equation: 1 4.e 10.0 The quadratic equation has no real roots Enter the constants a, b, and c for the quadratic equation: 1.e 8.0 16. The quadratic equation has two equal real roots:4.80008 Enter the constants a, b, and c for the quadratic equation : e. .e 6.5 The quadratic equation has no solution

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

To convert the given C program into 64bit x8664 assembly lets break down each part of the C program and translate it to assembly 1 Setup and IO Operat... View full answer

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!