The MASM Forum

General => The Campus => Topic started by: RuiLoureiro on May 14, 2013, 11:32:26 PM

Title: Converting string to real10
Post by: RuiLoureiro on May 14, 2013, 11:32:26 PM
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 **********
Title: Re: Converting string to real10
Post by: RuiLoureiro on June 12, 2016, 08:40:22 AM

:biggrin: Hi all

Title: Re: Converting string to real10
Post by: Mikl__ on June 12, 2016, 09:11:16 PM
Olá, Rui! Como você está?
Title: Re: Converting string to real10
Post by: RuiLoureiro on June 13, 2016, 08:12:06 AM
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