Question: 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.


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

#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