RE: [fasm-help] How to use floating point variables
Brought to you by:
privalov
|
From: Brian C. B. <bri...@ho...> - 2002-08-20 20:51:52
|
Hi Alsono, > Greetings to every body in FASM group, can some body help me, > i wrote the following code: I can try if you don't mind me being wrong every once in a while (mabye more often!). > section '.data' data readable writeable > > numberone dt ? > numbertwo dt ? > > section '.code' code readable executable > > mov [numberone],125.236 > But on this last line of code i get an invalid size of operand > error when i try to assign a value to the floating point > variable, can any body tell me what i am doing wrong! I know exactly how you feel. I wanted to do this quite a while ago and spent several hours searching online for a solution. The only thing I came up was to store each new number in the '.data' section of the program, like so: section '.data' data readable writeable numberone dt ? numbertwo dt ? TempNumber1 dt 125.236 section '.code' code readable executable FINIT FLD tword[TempNumber1] FSTP tword[numberone] Alternatively, you can probably make a macro that does this automatically (I've seen some macros for MASM that do such a thing). That's about the extent of my knowledge; perhaps somebody else can prove me wrong and tell you a better way (which would be nice). Sincerely, Brian Becker Shall we accept good from God, and not trouble? --- Outgoing mail is certified Virus Free by AVG Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.372 / Virus Database: 207 - Release Date: 6/20/2002 |