Algorithm for Convertion float number to string, and string to float

Started by ERNI, December 12, 2006, 10:34:03 PM

Previous topic - Next topic

ERNI

Hi
I must write two simple procedures in ASM program
first procedure for conversion string to real number
and second procedure
real namber convert to string, But I do not know as these algorithms can look
I must use in this procedures Float Procesor Unit

for example

1) string to real coversion
  in input program get this string
  str1 db"-123.345789"
  and program return real number -123.345789

2) real to string conversion
  in input program get this real number
  number db -123.345789
  and program return string as text "-123.345789"

And i necessarily must do this behind assistance FPU

maybe We know how :wink
Can We help my..

raymond

This sure sounds like homework. :green :green :naughty:

However, I guess that you have never heard of the FPULIB which comes with MASM32. It does contain both procedures and the source code is included. If you do use them for your homework, either as is or modified, be sure to tell your prof about the source. If you have to provide your procedures in 16-bit code, you will definitely have to modify the FPULIB procedures which are in 32-bit code.

If you really want to learn how to use the FPU in the future, I would certainly recommend that you study the tutorial from the same site where you can get the FPULIB if you don't have it already. The tutorial will give you a definite edge over your peers.

http://www.ray.masmcode.com/fpu.html

Raymond
When you assume something, you risk being wrong half the time
http://www.ray.masmcode.com