The MASM Forum Archive 2004 to 2012

General Forums => The Workshop => Topic started by: ERNI on December 12, 2006, 10:34:03 PM

Title: Algorithm for Convertion float number to string, and string to float
Post by: ERNI on December 12, 2006, 10:34:03 PM
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..
Title: Re: Algorithm for Convertion float number to string, and string to float
Post by: raymond on December 13, 2006, 03:41:45 AM
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
Title: Re: Algorithm for Convertion float number to string, and string to float
Post by: ERNI on December 13, 2006, 10:45:00 PM
Thanks Raymond for help :wink