I am trying to convert floating point value to string.I have tried Floattostr function but I dont know how to use it. My previous code which works with tasm on win2k does not work with MASM on win2k.Here is my code for tasm

   	 call FloatToBCD ;aim trying to put flottostring function here
	 mov     edx, offset deger
	 mov     ebx,offset firstpart
	 xor eax,eax
        cmp  byte ptr , '0'
        jne  Setit
        inc  edx
        jmp Rem0  ;to here
FloatToBCD	PROC	uses edi

    sub esp, 10

	; The fbstp instruction converts the top of the stack to a
	; packed BCD form in ten bytes, with two digits per byte.  The top 
	; byte has the sign, which we ignore.


	; Now we need to unpack the BCD to ASCII.

    lea esi, 
    lea edi, 
    mov ecx, 9

	mov al, 		; xxxx xxxx AAAA BBBB
	dec esi
	rol ax, 12		; BBBB xxxx xxxx AAAA
	rol ah, 4		; xxxx BBBB xxxx AAAA
	and ax, 0f0fh		; 0000 BBBB 0000 AAAA
	add ax, 3030h		; 3B3A
	mov , ax
	add edi, 2
	dec ecx

    add esp, 10

Any help will be appreciated
Posted on 2001-02-22 19:48:00 by LaptoniC
You can try to download DLLFloat.exe from the MS download center. You could also provide your own logic to do the conversion yourself using your "bare hands" (it's somewhat messy). I personally would write a C program to do the conversion, test it, and then translate it into MASM32. I found the following on the MSDN CD's: DLLFloat.exe is a sample file that contains a DLL-compatible function to convert a floating-point number to a character string. A small or medium model dynamic-link library (DLL) cannot use any of the C run-time functions provided with Microsoft C version 6.0 to convert a floating-point number to a character string. However, with Microsoft C/C++ version 7.0 you can use the fcvt() and ecvt() functions. The Windows wsprintf() function does not provide any assistance because wsprintf() does not support floating-point numbers. Therefore, a DLL must be compiled with Microsoft C/C++ version 7.0 or provide its own code to perform the conversion. MORE INFORMATION The following files are available for download from the Microsoft Download Center. Click the file names below to download the files: DLLFloat.exe
Posted on 2001-02-22 20:44:00 by Xmas