News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests
NB: Posting URL's See here: Posted URL Change

Main Menu

Converting string to real10

Started by RuiLoureiro, May 14, 2013, 11:32:26 PM

Previous topic - Next topic

RuiLoureiro

Hi
    Here we have 3 ASM procedures to convert
    a null terminated string to real10:

        1. ConvertString10D:

           - convert integer part to a qword
           - convert decimal part to a qword
           - convert the exponent to a dword

             than load it and compute the real10

           - this is to be used for 18 digits
           
        2. ConvertString10BR

           - get the integer part to a BCD - 10 bytes
           - get the decimal part to a BCD - 10 bytes
           - convert the exponent to a dword

             than load the BCD values and compute
             the real10

        3. ConvertString10DX:

           - convert integer part to a qword
           - convert decimal part to a qword
           - convert the exponent to a dword

             than load it and compute the real10
             
           - this is to be used for 19 digits

    note: in all 3 cases there is an error if carry set
          this is a general rule in all converters.

    The strings may have spaces like this:

            "+000000 012 34.56 7 E + 000012"

    The procedures are in the include file Convert10D.inc
    and we need to include PowerTable.inc also to use it.

    We have also ConverterQQ.inc, which contains the asm
    files ConvertFloat10DS and ConvertFloat10DSD to convert
    from real10 to string used in the test files.   

    We have also Convert10DXD.inc, which contains the asm
    files used to convert from real10 to string
    used in the test files.   
   
    We can test using TestString10_D.asm and TestString10_BR.asm
    and TestString10_DX.

    All those files are in Convert10S folder.

Quote
***** Time table *****

Intel(R) Pentium(R) 4 CPU 3.40GHz (SSE3)

527  cycles, ConvertString10Y0, direct, no spaces,18 digits
531  cycles, ConvertString10D, direct, spaces,18 digits
544  cycles, ConvertString10Y, direct, spaces,18 digits
545  cycles, ConvertString10DF, direct,18 digits
562  cycles, ConvertString10DM, direct, spaces,19 digits
724  cycles, ConvertString10BS, BCD, no spaces
759  cycles, ConvertString10BR, BCD, spaces
891  cycles, ConvertString10ZF, BCD
920  cycles, ConvertString10DB, direct, spaces,19 digits
952  cycles, ConvertString10DX, direct, spaces, zeroes,19 digits
1051  cycles, ConvertString10ZX, BCD
1087  cycles, ConvertString10Z, BCD
3170  cycles, ConvertString10X, BCD, save FPU
3173  cycles, ConvertString10, BCD, save FPU
********** END **********

RuiLoureiro


Mikl__


RuiLoureiro

Quote from: Mikl__ on June 12, 2016, 09:11:16 PM
Olá, Rui! Como você está?
:biggrin:
Olá meu grande amigo Mikl__, como estás ?
Por aí tudo bem contigo ?
É sempre com muito prazer que te vejo por aqui !
Muitas Felicidades!
See you !  :t