flat assembler
Message board for the users of flat assembler.
Index
> Windows > 32 bit code to 64 bit code Goto page Previous 1, 2 |
Author |
|
HaHaAnonymous 20 Oct 2013, 17:32
[ Post removed by author. ]
Last edited by HaHaAnonymous on 28 Feb 2015, 19:41; edited 1 time in total |
|||
20 Oct 2013, 17:32 |
|
patchariadog 20 Oct 2013, 19:37
I think it will work but can you tell me the equivalent of the printf line so I can use it in a GUI program
is it wsprintfA or is it sscanf or what and how do I use it I tried this Code: mov dword[bufferf1],21.0 mov dword[bufferf2],2.0 movsd xmm0,[bufferf1] divsd xmm0,[bufferf2] movsd [bufferf3],xmm0 cinvoke sprintf,str0,"%0.16lf",qword [bufferf3] ;cinvoke printf,str0,sfmt ; cinvoke wsprintfA,str0, "%s" ; xor rcx,rcx invoke SetDlgItemTextA,[hwnd],resultlengthxtextbox,addr str0 and it gives me that range between .85 and 1.5 again thanks Last edited by patchariadog on 20 Oct 2013, 19:46; edited 1 time in total |
|||
20 Oct 2013, 19:37 |
|
HaHaAnonymous 20 Oct 2013, 19:44
[ Post removed by author. ]
Last edited by HaHaAnonymous on 28 Feb 2015, 19:41; edited 3 times in total |
|||
20 Oct 2013, 19:44 |
|
patchariadog 20 Oct 2013, 19:53
okay so this is what I tried and it is still doing the .95 thing
Code: invoke GetDlgItemTextA, [hwnd], resultlengthxpixelstextbox, bufferbuffer1, 100 cinvoke sscanf, bufferbuffer1, "%f", op1 ;read in MeasuredlengthXinpixelstextbox invoke GetDlgItemTextA, [hwnd], measuredlengthxpixelstextbox, bufferbuffer2, 100 cinvoke sscanf, bufferbuffer2, "%f", op2 movsd xmm0,[op1] divsd xmm0,[op2] movsd [result],xmm0 cinvoke sprintf,str0,fmt0,qword [result] invoke SetDlgItemTextA,[hwnd],resultlengthxtextbox,addr str0 data Code: bufferbuffer1 dq ? bufferbuffer2 dq ? op1: dq ? op2: dq ? result: dq $0000000000000000 align 8 fmt0: db '%0.5lf',$00 align 8 sfmt: db '%s',$00 align 8 str0: db 256 dup($00) |
|||
20 Oct 2013, 19:53 |
|
HaHaAnonymous 20 Oct 2013, 20:02
[ Post removed by author. ]
Last edited by HaHaAnonymous on 28 Feb 2015, 19:41; edited 1 time in total |
|||
20 Oct 2013, 20:02 |
|
patchariadog 20 Oct 2013, 20:12
I am even more confused now. could you please show how to fix it. sorry for bothering you
|
|||
20 Oct 2013, 20:12 |
|
HaHaAnonymous 20 Oct 2013, 20:17
[ Post removed by author. ]
Last edited by HaHaAnonymous on 28 Feb 2015, 19:40; edited 1 time in total |
|||
20 Oct 2013, 20:17 |
|
patchariadog 20 Oct 2013, 20:20
like I will type in 300 in the textbox and then 110.2 in the text box and it will also say the answer is between .95154 and 1.59848 instead of 2.72
for example the answer to the numbers above is .98 instead of 2.72 |
|||
20 Oct 2013, 20:20 |
|
HaHaAnonymous 20 Oct 2013, 20:29
[ Post removed by author. ]
Last edited by HaHaAnonymous on 28 Feb 2015, 19:40; edited 1 time in total |
|||
20 Oct 2013, 20:29 |
|
patchariadog 20 Oct 2013, 20:36
yeah! that works
thanks for helping me over these past few days with that |
|||
20 Oct 2013, 20:36 |
|
patchariadog 21 Oct 2013, 15:49
oh 1 more quick question. I was playing around with the calculations and I noticed that if you use xmm registers it only gives correct precision to 15 decimal places and if you use the fpu it only gives it to 7
for example 159/200*5.5 real answer = 4.3725 xmm answer = 4.37250000000000050000 I am okay with it showing a bunch of zeros because I could write a function to check and delete them. although why does the computer put that extra 5 in their thanks |
|||
21 Oct 2013, 15:49 |
|
HaHaAnonymous 21 Oct 2013, 16:13
[ Post removed by author. ]
Last edited by HaHaAnonymous on 28 Feb 2015, 19:40; edited 1 time in total |
|||
21 Oct 2013, 16:13 |
|
patchariadog 22 Oct 2013, 02:35
Oh OK is it hard to change the data type to a larger data type? Do I just change the DQ to whatever is larger then a DQ or do I have to make major changes to the xmm code and the fpu code? Thanks
|
|||
22 Oct 2013, 02:35 |
|
Goto page Previous 1, 2 < Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.