flat assembler
Message board for the users of flat assembler.
  
|  Index
      > Main > FPU: Load constant floating point value | 
| Author | 
 | 
| revolution 14 Jan 2009, 21:41 Code: value dd 123.456 ;or DQ/DT if you want more precision. ... fld [value] | |||
|  14 Jan 2009, 21:41 | 
 | 
| vid 14 Jan 2009, 22:56 if you REALLY want to have it in one place, and 32bit precision is enough, easiest you can do is probably something like
 Code: push dword 123.456 ;FASM supports this fld [esp] ;FLD from stack add esp, 4 ;remove value from stack but i would suggest revolution's version. | |||
|  14 Jan 2009, 22:56 | 
 | 
| revolution 14 Jan 2009, 23:02 One thing to note with vid's suggestion is that you need a type override.     Code: push dword 123.456 fld dword [esp] ;add the operand size override add esp, 4 | |||
|  14 Jan 2009, 23:02 | 
 | 
| flona 15 Jan 2009, 13:01  thank you  _________________ My english is not very well. Pardon. | |||
|  15 Jan 2009, 13:01 | 
 | 
| < Last Thread | Next Thread > | 
| Forum Rules: 
 | 
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.