Question: Complete the implementation for the basic arithmetic using the FPU. Write the apprioirate ASM codes for each FPU operation. Only use floating point values to

Complete the implementation for the basic arithmetic using the FPU. Write the apprioirate ASM codes for each FPU operation. Only use floating point values to test your code operational correctness in its execution.

----

 Complete the implementation for the basic arithmetic using the FPU. Writethe apprioirate ASM codes for each FPU operation. Only use floating point

Plain text:

--

#include "stdafx.h" void myAdd(double x, double y); /* Add two floating point numbers */ void mySub(double x, double y); /* Subtract two floating point numbers */ void myMul(double x, double y); /* Multiply two floating point numbers */ void myDiv(double x, double y); /* Divide two floating point numbers */ /* Main program starts here */ int main() { float A = 0, B = 0; /* Variables used */ printf(" Enter values A and B "); scanf_s("%f", &A); /* Input for A */ scanf_s("%f", &B); /* Input for B */ /* Add the values A and B */ myAdd(A, B); /* Subtract A B */ mySub(A, B); /* Multiply the values A and B */ myMul(A, B); /* Add the values A and B */ myDiv(A, B); printf(" "); return 0; } /* Function implementations */ void myAdd(double x, double y) /* Add two floating point numbers */ { /* Implement ASM code */ double result = 0; _asm { } printf(" A(%f) + B(%f) = Y(%f)", x, y, result); } void mySub(double x, double y) /* Subtract two floating point numbers */ { double result = 0; /* Implement ASM code */ } void myMul(double x, double y) /* Multiply two floating point numbers */ { double result = 0; /* Implement ASM code */ }

Assignment: FPU Arithmetic Calculations Assembly Programming for FPU Co-Processor Question: Complete the implementation for the basic arithmetic using the FPU. Only use floating point values to test your code operational correctness in its execution. Code starts here // basicCalConApp.cpp Defines the entry point for the console application // Solution to basic arithmetic operations using the FPU #include "stdafx.h" void myAdd (double x, double y); Add two floating point numbers*/ void mySub(double x, double y); * Subtract two floating point numbers */ void myMul (double x, double y);* Multiply two floating point numbers*/ void myDiv(double x, double y); I* Divide two floating point numbers */ /*Main program starts here */ int main() float A 0, B-0; * Variables used */ printf("In Enter values A and B scanf-s("%f", &A); /* Input for scanf-s("%f", &B); /* Input for "); A */ B */ /*Add the values A and B * myAdd (A, B); /* SubtractA B mySub (A, B); /* Multiply the values A and B myMul (A, B); /Add the values A and B myDiv(A, B); printf(" "); return 0; /Function implementations void myAdd (double x, double y) /* Add two floating point numbers */ Implement ASM code * double result 0; asm printf("n A(f) B(f) Y(f)" x, y, result); Assignment: FPU Arithmetic Calculations Assembly Programming for FPU Co-Processor Question: Complete the implementation for the basic arithmetic using the FPU. Only use floating point values to test your code operational correctness in its execution. Code starts here // basicCalConApp.cpp Defines the entry point for the console application // Solution to basic arithmetic operations using the FPU #include "stdafx.h" void myAdd (double x, double y); Add two floating point numbers*/ void mySub(double x, double y); * Subtract two floating point numbers */ void myMul (double x, double y);* Multiply two floating point numbers*/ void myDiv(double x, double y); I* Divide two floating point numbers */ /*Main program starts here */ int main() float A 0, B-0; * Variables used */ printf("In Enter values A and B scanf-s("%f", &A); /* Input for scanf-s("%f", &B); /* Input for "); A */ B */ /*Add the values A and B * myAdd (A, B); /* SubtractA B mySub (A, B); /* Multiply the values A and B myMul (A, B); /Add the values A and B myDiv(A, B); printf(" "); return 0; /Function implementations void myAdd (double x, double y) /* Add two floating point numbers */ Implement ASM code * double result 0; asm printf("n A(f) B(f) Y(f)" x, y, result)

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!