• Please review our updated Terms and Rules here

String to floating point conversion in ML for 8088

Ruud

Veteran Member
Joined
Nov 30, 2009
Messages
1,369
Location
Heerlen, NL
Hello,

I know how to convert a number like 286.75 into FP by hand. One of the two main problems I have is 1) converting the fraction into FP using 8088 instructions and 2) how to handle E-numbers like 1.23456 E 14 when the exponent is large.

If I google on the subject I get a lot of hits that point to the way it is in done in Python, C, etc. i.e. using their interna functions. The very few ones I found so far use ML used 8087 instructions. I even tried Turbo Debugger to see how Turbo Pascal does it, only to find out that still outputs FPU code and while stepping through the program, the emulated code is executed under water.

The one solution I have now is looking at the source code of the ROMs of the C64 to see how it was done there. A problem, the comments are not always clear or it was not understood well by the author. I think that given time, I will solve it. But OTOH in this case it is stupid to invent the wheel twice IMHO. Real code or a good document is welcome!

Thank you very much in advance for any help!
 
The UCR Standard Library for 80x86 Assembly Language Programmers contains some routines to do floating point computations, including conversion to/from strings.


Documentation may be found in the 1st edition of "The art of assembly programming". The website that used to host the free edition of the book seems to be defunct, but there should be other sources out it in the web. If not, I have a copy that I can share.
 
The UCR Standard Library for 80x86 Assembly Language Programmers contains some routines to do floating point computations, including conversion to/from strings.


Documentation may be found in the 1st edition of "The art of assembly programming". The website that used to host the free edition of the book seems to be defunct, but there should be other sources out it in the web. If not, I have a copy that I can share.
I just happen to have have the HTML and PDF version. I read about the UCR Standard Library but it didn't ring a bell at all. So thank you very much!

I also seem to have the source codes and executables that go with each chapter. If you or anyone is interested, PM me, or better: visit my site to obtain my private email address.

EDIT: I just found out what I have is part of the ZIP that contains the above FP.ASM. So grab the complete ZIP and you have both!
 
Last edited:
The UCR standard library is one of the first places where I look for ASM code examples. It includes quite a lot of stuff.

BTW, I have to correct myself, the various editions of The art of assembly programming are still avaiable here:


Either the website was down early today, or I checked a wrong link
 
Back
Top