Question: Please help Using FPU assembly code in the double hullSpeed(double lgth) part ! -compute the hull speed for the specified boat length, - implementing the

Please help Using FPU assembly code in the "double hullSpeed(double lgth)" part !

-compute the hull speed for the specified boat length,

- implementing the numerical computation in GNU Assembly Language

- through use of FPU instructions (do NOT call sqrt() from math.h)

#include

#include

#include

// do not change anything above this comment

double hullSpeed(double lgth) // -----------assembly code ----------

{

// here you will compute the hull speed for the specified boat length,

// implementing the numerical computation in GNU Assembly Language

// through use of FPU instructions (do NOT call sqrt() from math.h)

return 0.0;

}

// do not change anything below this comment, except for printing out your name

double hullSpeedC(double lgth)

{

// this C implementation of the hull speed computation is provided

// so you can compare its correct results with the results of your code

return 1.34 * sqrt(lgth);

}

int main(int argc, char **argv)

{

double lgth;

double hullSpd, hullSpdC;

printf("CS201 - Assignment 02 - I. Forgot ");

if (argc != 2) {

printf("need 1 argument: boat length ");

return -1;

}

lgth = atof(argv[1]);

hullSpd = hullSpeed(lgth);

hullSpdC = hullSpeedC(lgth);

printf("hullSpeed(%.0f) = %.3f, %.3f ", lgth, hullSpd, hullSpdC);

return 0;

}

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!