Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In my x86 assembly language class we have been given the task of writing a fahrenheit to celsius temperature converter using the formula: C =

In my x86 assembly language class we have been given the task of writing a fahrenheit to celsius temperature converter using the formula: C = (5/9) * (F - 32) as well as using floating point numbers. Our teacher provided the following templates to use for our codes.

image text in transcribedimage text in transcribed

So far this is what I have been able to come up with, any help would be appreciated.

image text in transcribed

#define CRT SECURE NO WARNINGS #include #define ASM float f2c(float); int main float fahren; printf("Enter degree in Fahrenheit: scanf("f", &fahren) printf("%f degrees in Fahrenheit is "); %f degrees in Celsus. ", fahren, f2c (fahren)); getchar(); getchar() return 0; #1f !ASM float f2c(float f) return 5.0/9(f 32); #endif .586 MODEL FLAT DATA five DWORD 5 nine DWORD 9 ttwo DWORD 32 result DWORD? CODE f2c PROC push ebp mov ebp, esp TODO Your code goes here mov pop ret eax, result ebp f2c ENDP END .586 . MODEL FLAT DATA five DWORD !5 nineDWORD 9 ttwo DWORD 32 result DWORD ? . CODE f2c PROC push ebp mov ebp, esp TODO YOUR CODE HERE finit fild five fild nine fdiv st (0), st (1) fild ttwo fsub st (0), fmulst (0), st (1) st (2) 8 result mov poP ret eax, result ebp f2c ENDP END #define CRT SECURE NO WARNINGS #include #define ASM float f2c(float); int main float fahren; printf("Enter degree in Fahrenheit: scanf("f", &fahren) printf("%f degrees in Fahrenheit is "); %f degrees in Celsus. ", fahren, f2c (fahren)); getchar(); getchar() return 0; #1f !ASM float f2c(float f) return 5.0/9(f 32); #endif .586 MODEL FLAT DATA five DWORD 5 nine DWORD 9 ttwo DWORD 32 result DWORD? CODE f2c PROC push ebp mov ebp, esp TODO Your code goes here mov pop ret eax, result ebp f2c ENDP END .586 . MODEL FLAT DATA five DWORD !5 nineDWORD 9 ttwo DWORD 32 result DWORD ? . CODE f2c PROC push ebp mov ebp, esp TODO YOUR CODE HERE finit fild five fild nine fdiv st (0), st (1) fild ttwo fsub st (0), fmulst (0), st (1) st (2) 8 result mov poP ret eax, result ebp f2c ENDP END

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

Decisions Based On Data Analytics For Business Excellence

Authors: Bastian Weber

1st Edition

9358681683, 978-9358681680

Students also viewed these Databases questions

Question

=+Will the humor help meet the objectives?

Answered: 1 week ago