Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1. Convert the following program into: (a) A 32-bit x86-64 assembly language program. (b) A 64-bit x86-64 assembly language program. #include #include int main(void) {

image text in transcribed

1. Convert the following program into: (a) A 32-bit x86-64 assembly language program. (b) A 64-bit x86-64 assembly language program. #include #include int main(void) { double const PI = 3,14159265359; double const g = 9.80665; double degrees, radians, range, maxHeight, flightTime, initialVelocity; double sinRadians, squareInitialVelocity; printf_s("Enter angle of projection in degrees: "); scanf_s("%1f", °rees); printf_s("Enter the initial velocity in meters/second: "); scanf_$("%f", &initialVelocity); radians = degrees * PI / 180.0; sinRadians = sin(radians); square InitialVelocity = initialVelocity * initialVelocity; range = (square InitialVelocity * sin(2 * radians))/ g; flightTime = (2 * initialVelocity * sinRadians)/ g; maxHeight - (squareInitialVelocity * sinRadians * sinRadians) / (2 * g); printf_s(" Range = %0.21f meters. In", range); printf_s("Flight time = %0.2f seconds. In", flightTime); printf_s("Maximum height = %.2f meters. In", maxHeight); return; Sample program runs: Enter angle of projection in degrees: 25.0 Enter the initial velocity in meters/second: 30.0 Range = 70.30 meters. Flight time = 2.59 seconds. Maximum height = 8.20 meters. Enter angle of projection in degrees: 45.0 Enter the initial velocity in meters/second: 30.0 Range = 91.77 meters. Flight time = 4.33 seconds. Maximum height = 22.94 meters. Hint: In a 64-bit program, a standard function retums a double value in the xmm0 register, whereas in a 32-bit program it retums a double value in the ST(0) Floating Point Unit register. Declare PI and g as variables

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Systems An Application Oriented Approach Complete Version

Authors: Michael Kifer, Arthur Bernstein, Richard Lewis

2nd Edition

0321268458, 978-0321268457

More Books

Students also viewed these Databases questions

Question

Sketch the graph of the inequality. 1. y Answered: 1 week ago

Answered: 1 week ago