I have this code in masm to deal with the FPU and it works great
in this code I get a number from 2 different textboxes and then divide them and then output the results to another textbox
this is the data that is local
LOCAL variable1 :QWORD
LOCAL variable2 :QWORD
LOCAL variable3 :QWORD
LOCAL string1[20]:BYTE
LOCAL string2[20]:BYTE
LOCAL string3[20]:BYTE
this is the code
invoke GetDlgItemText,hWin,textbox1,addr string1,9
invoke StrToFloat,addr string1,addr variable1
invoke GetDlgItemText,hWin,textbox2,addr string2,9
invoke StrToFloat,addr string2,addr variable2
finit
fld variable1
fld variable2
fdiv
fstp variable3
invoke FloatToStr,variable3,addr string3
invoke SetDlgItemText,hWin,textbox3,addr string3
I am trying to convert the code to fasm
this is what I have so far but it is not working the textbox3 just says 0
this is the data (this is not local data because I have not learned how to do that in fasm yet)
v1 dq ?
v2 dq ?
v3 dd ?
v4 rb 20
this is the code
invoke GetDlgItemTextA,[hWin],textbox1,addr v1,100
invoke GetDlgItemTextA,[hWin],textbox2,addr v2,100
finit
fld qword [v1]
fld qword [v2]
fdivp
fstp qword [v3]
cinvoke wsprintfA,addr v4,"%u",[v3]
invoke SetDlgItemTextA,[hWin],textbox3,addr v4
I know this code is not right because I am not converting the text to float at the begining but i do not know how to
I also tried a simpler version and it did not work either
mov [v1],5.3
mov [v2],7.1
finit
fld [v1]
fld [v2]
fdivp
fstp [v3]
cinvoke wsprintfA,addr v4,"%u",[v3]
invoke SetDlgItemTextA,[hWin],maximumoutputpowertext,addr v4
so my question is can someone please show me how to read a number from 2 different textboxes and then divide them and the return the result to another textbox using fasm code
thank you