I'm writing a program that takes in Floating Points and averages them for a CMSC class this weekend. My only problem seems to be the conversion of said floating poing values. When I run this little bit of code, all I ever get out is 41, no matter what I enter. Any help would be much appreicated. Thanks
LOCAL inString:DWORDLOCAL newFP:QWORDLOCAL answer1[20]:BYTEmov [inString], input("Please Enter Value")invoke StrToFloat, ADDR inString, ADDR newFPinvoke FloatToString, newFP, ADDR answer1invoke StdOut, ADDR answer1
Hi there Joe!
I'm not sure if you had a typo or not, but instead of using invoke FloatToString, why not try to use invoke FloatToStr or invoke FloatToStr2.
Example: invoke FloatToStr2, answer[source], ADDR buffer[destination]
LOCAL inString:DWORDLOCAL newFP:QWORDLOCAL answer1[20]:BYTEmov [inString], input("Please Enter Value: ")invoke StrToFloat, ADDR inString, ADDR newFPinvoke FloatToStr2, newFP, ADDR answer1print addr answer1
I have attached a compile sample with the exact code as above. Thanks. Hope it works and you make it on time. :D