flat assembler
Message board for the users of flat assembler.
Index
> Main > Floating problems |
Author |
|
Tomasz Grysztar 08 Nov 2003, 13:50
scientica wrote: Why is it invalid, is it because fasm can't make computations on float vars? That's right. This is design flaw that comes form the fact, that I wanted fasm to run on 386 machines (as I myself was using it on such computers), so I couldn't use any FPU instructions. I could anyway write routines for such calculations as I wrote the routine for string to float conversion, but it's a bit much of work... |
|||
08 Nov 2003, 13:50 |
|
scientica 08 Nov 2003, 15:25
Privalov wrote: This is design flaw that comes form the fact, that I wanted fasm to run on 386 machines (as I myself was using it on such computers), so I couldn't use any FPU instructions. I could anyway write routines for such calculations as I wrote the routine for string to float conversion, but it's a bit much of work... Ok, I see, the only float calculation I need now is addition (possibly subtraction - depends on wheter one can add the compliment instead). I'd apriciate basic addition/subtraction for floats, the rest (mul,div, etc) isn't of any greater importance now (anyway that could be fixed later via macros if addition works (a teacher has told me that every mathematical operation can be broken down to only additions)). _________________ ... a professor saying: "use this proprietary software to learn computer science" is the same as English professor handing you a copy of Shakespeare and saying: "use this book to learn Shakespeare without opening the book itself. - Bradley Kuhn |
|||
08 Nov 2003, 15:25 |
|
comrade 09 Nov 2003, 02:50
Is it hard to make string to float routine without use of FPU?
|
|||
09 Nov 2003, 02:50 |
|
inskipp 09 Nov 2003, 12:09
It isn't very hard.
You can find an example at http://www.programmersheaven.com/zone5/cat18/1369.htm It's old, 16-bit code, but good commended. |
|||
09 Nov 2003, 12:09 |
|
Tomasz Grysztar 09 Nov 2003, 12:23
In fasm I have used "very high precision" floating point format, just to make sure you'll get the best precision even when defining twords (this internal 16-byte format is later converted into appropriate IEEE format depending on data instruction with which it's used) - and this complicated the things a bit. The whole conversion procedure it's in EXPRESSI.INC file, labelled "get_fp_value" - it includes subroutines for adding such FP values, and for multiplying or dividing them by integer value.
|
|||
09 Nov 2003, 12:23 |
|
Crunch 09 Dec 2003, 17:12
Privalov,
How painful would it be to add support for FPU instructions in the future? |
|||
09 Dec 2003, 17:12 |
|
Tomasz Grysztar 09 Dec 2003, 17:21
What do you mean? fasm has got support for FPU instructions, it is only that it doesn't use them itself.
|
|||
09 Dec 2003, 17:21 |
|
Crunch 09 Dec 2003, 17:37
Doh!
Should have picked the username "Homer Simpson"! Stupid me, I've been sitting on the sidelines with the mistaken impression that I couldn't use hardware FPU instructions with FASM. Maybe it's time for me to download it and spend the time to actually use it I use so many other tools (not an assembler for a while though) and am hestitant to confuse my poor old brain with new stuff until it becomes obvious that I've waited too long to start using the right tool. I've been following FASM for quite a while and guess now is as good of a time as any to jump in and feel more stupid than I think I am to learn a new (yet a least good) tool. Doh! Thanks for your patience and all the hard work. |
|||
09 Dec 2003, 17:37 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.