flat assembler
Message board for the users of flat assembler.

Index > Main > fpu emulation library?

Author
Thread Post new topic Reply to topic
donkey7



Joined: 31 Jan 2005
Posts: 127
Location: Poland, Malopolska
donkey7 28 Jan 2006, 13:29
does anyone have a thing like that?
i need functions doing floating point math, but not using fpu.
quick googling does not reveal anything interesting, usually commercial packages and no source codes (that i need).

thanks in advance.

ps. of course emulation of 'intel' chips :D

_________________
Keep coding!
Post 28 Jan 2006, 13:29
View user's profile Send private message Visit poster's website Reply with quote
Borsuc



Joined: 29 Dec 2005
Posts: 2465
Location: Bucharest, Romania
Borsuc 28 Jan 2006, 13:58
IIRC when I read "The Art of Assembly Language Programming" book, I took a look into the so called UCR Standard Library. It has a FPU library, but it's 16-bit.. At least it serves as the back-bone (it's not really 100% optimized, but it's a starting point). it's in MASM (I think), but translation should be easy.

here
Post 28 Jan 2006, 13:58
View user's profile Send private message Reply with quote
donkey7



Joined: 31 Jan 2005
Posts: 127
Location: Poland, Malopolska
donkey7 28 Jan 2006, 14:28
hmm, it may be, but i also need something to handle bcd values (translations between bcd and hex, int or asc values)
thanks
Post 28 Jan 2006, 14:28
View user's profile Send private message Visit poster's website Reply with quote
Borsuc



Joined: 29 Dec 2005
Posts: 2465
Location: Bucharest, Romania
Borsuc 28 Jan 2006, 14:38
I don't know any other FPU library in Fasm. maybe look at emulators like Qemu (i'm not sure if it really emulates FPU), but source code is in C.. but if you know the language, you might get away with some 'ideas'

BCD aritmethic shouldn't be that hard (at least not harder than IEEE floating point format, anyway Wink ).
maybe someone else has some links? sorry, this is all I know
Post 28 Jan 2006, 14:38
View user's profile Send private message Reply with quote
Madis731



Joined: 25 Sep 2003
Posts: 2139
Location: Estonia
Madis731 29 Jan 2006, 10:27
If you really have no way of using FPU, the emulation is not the best way to go. You should move your ideas to integer the best you can and the parts remaining can (hopefully) be optimized with integer instruction, but NOT straight-forward emulation to FPU!

All the checks involved etc. you will go nuts, for the program is too slow.
Post 29 Jan 2006, 10:27
View user's profile Send private message Visit poster's website Yahoo Messenger MSN Messenger Reply with quote
Borsuc



Joined: 29 Dec 2005
Posts: 2465
Location: Bucharest, Romania
Borsuc 30 Jan 2006, 18:24
Integer (software) is faster than floating point (software).. If we have floating point (hardware), why don't we have fixed-point integer (hardware) Sad


btw: if you really need emulation of FPU, try some 'emulators' (maybe some are in asm?), because I think you can set them to 'emulate' a floating point unit.. maybe google a bit
Post 30 Jan 2006, 18:24
View user's profile Send private message Reply with quote
donkey7



Joined: 31 Jan 2005
Posts: 127
Location: Poland, Malopolska
donkey7 30 Jan 2006, 20:01
say, i want to learn how floating point math is done :)
maybe you have some references of fp variables structure (ie. 32, 64 and 80 bit floating point variables and 80 bit bcd variables)?
i can make appropriate library by myself :D

btw: emulation shouldn't be much slower, say 2 - 3 times slower.

ps. can you do some search for me? please, i am not good at english.

_________________
Keep coding!
Post 30 Jan 2006, 20:01
View user's profile Send private message Visit poster's website Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid 30 Jan 2006, 21:13
donkey: good description was in Art Of Assembly book, google for it.

And emulation will be much slower...
Post 30 Jan 2006, 21:13
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.