flat assembler
Message board for the users of flat assembler.
![]() |
Author |
|
daluca
sorry: I use the 'search' and found the solution in another topic:
it should be defined as qword and passed as 2 dwords to the printf but.... does this mean there is no function to print single-precision numbers? so if I define a float variable in a c program it's really defined as double? I'm confused. |
|||
![]() |
|
Yardman
[ Post removed by author. ]
Last edited by Yardman on 04 Apr 2012, 02:28; edited 1 time in total |
|||
![]() |
|
vid
this really depends on platform. Microsoft libc could treat float as single precision, while glibc could treat it as double precision. You should first find out more about platform whose libc you want to use. And if you want portability, you can't go without at least some "compatiblity layer", like Yardman demonstrated
|
|||
![]() |
|
f0dder
The C standard specifies that if you don't have a function prototype or use vararg, char/short are passed as int, and float types are passed as double. Check section 2.7, type conversions.
|
|||
![]() |
|
kohlrak
In other words, you can push a 4 byte onto the FPU and pull it, or you can do something else... I forget what it is. I think it was push a 0 befor or after you push the float you want to display.
|
|||
![]() |
|
Yardman
[ Post removed by author. ]
Last edited by Yardman on 04 Apr 2012, 02:28; edited 1 time in total |
|||
![]() |
|
daluca
thanks Yardman I'll use that.
vid: so if I link to msvcrt.dll will I have problems runing my program in different versions of windows? thanks. |
|||
![]() |
|
vid
Quote: vid: so if I link to msvcrt.dll will I have problems runing my program in different versions of windows? no, most probably no. But you may have problems if you decide to use another C library, not one from MS. |
|||
![]() |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2020, Tomasz Grysztar. Also on GitHub, YouTube, Twitter.
Website powered by rwasa.