title: masm FPU to fasm FPU cannot translate and it does not work
body: <p>I have this code in masm to deal with the FPU and it works great</p>
  
  <p>in this code I get a number from 2 different textboxes and then divide them and then output the results to another textbox</p>
  
  <p>this is the data that is local</p>
  
  <pre><code>LOCAL variable1 :QWORD
  LOCAL variable2 :QWORD
  LOCAL variable3 :QWORD
  
  LOCAL string1[20]:BYTE
  LOCAL string2[20]:BYTE
  LOCAL string3[20]:BYTE
  </code></pre>
  
  <p>this is the code</p>
  
  <pre><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
  </code></pre>
  
  <p>I am trying to convert the code to fasm</p>
  
  <p>this is what I have so far but it is not working the textbox3 just says 0</p>
  
  <p>this is the data (this is not local data because I have not learned how to do that in fasm yet)</p>
  
  <pre><code>v1 dq ?
  v2 dq ?
  v3 dd ?
  v4 rb 20
  </code></pre>
  
  <p>this is the code</p>
  
  <pre><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
  </code></pre>
  
  <p>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</p>
  
  <p>I also tried a simpler version and it did not work either</p>
  
  <pre><code>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
  </code></pre>
  
  <p>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</p>
  
  <p>thank you</p>