print floating pt using xmm0
Peter Johnson
peter at tortall.net
Thu Oct 26 00:22:51 PDT 2006
You need to use cvtsi2sd, not cvtsi2ss.
Peter
On Thu, 26 Oct 2006, Vikas N Kumar wrote:
> Hi All
> Below is my code to print a floating point number which has been
> loaded into XMM0 register.
> For some reason it always prints 0.0000. I am not able to figure it
> out. Could anyone let me know what I am doing wrong here ? It seems
> right based on the manual.
>
> section .data
> fltprmpt db "%f",10,0
>
> section .text
>
> global main
> extern printf
>
> main:
> enter 0,0
> mov rdi, dword fltprmpt
> mov rdx, 10
> cvtsi2ss xmm0, edx
> mov rax, 1
> call printf
> leave
> ret
>
> Regards,
> Vikas
> --
> http://www.vikaskumar.org/
> _______________________________________________
> yasm-devel mailing list
> yasm-devel at tortall.net
> http://cvs.tortall.net/mailman/listinfo/yasm-devel
>
More information about the yasm-devel
mailing list