Hi
Here we have 2
ASM procedures to
convert a
null terminated string to real8:
1.
ConvertString8D:
- convert integer part to a qword
- convert decimal part to a qword
- convert the exponent to a dword
than load it and compute the real8
2.
ConvertString8BR - 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 real8
The strings may have spaces like this:
"+000000 012 34.56 7 E + 000012"
The procedures are in the include file
Convert8D.inc and the we need to include
PowerTable.inc also.
We have also
Convert8DRD to
convert from real8 to string used in the test files.
We can test using
TestString8_D.asm and
TestString8_BR.asm.
All those files are in
Convert8S folder.
EDIT: Please after your tests,
remove these prints:
_error: ;print str$(eax)," ERROR eax-ConvertString8D",13,10
_error: ;print str$(eax)," ERROR eax-ConvertString8BR",13,10
___
I would like to know your tests, if you dont mind___
note:
see also converting string to real4 note 2: i found a bug in the file
Convert8DRD to convert real8 to string
so i removed the old
Quote
***** Time table *****
Intel(R) Pentium(R) 4 CPU 3.40GHz (SSE3)
538 cycles, ConvertString8Y0, direct, no spaces
550 cycles, ConvertString8D, direct, spaces
562 cycles, ConvertString8Y, direct
572 cycles, ConvertString8DF, direct
762 cycles, ConvertString8BS, BCD, no spaces
776 cycles, ConvertString8BR, BCD, spaces
899 cycles, ConvertString8BW, BCD
941 cycles, ConvertString8BF, BCD
1041 cycles, ConvertString8BY, BCD
1116 cycles, ConvertString8BZ, BCD
3188 cycles, ConvertString8B, BCD, save FPU
3248 cycles, ConvertString8BX, BCD, save FPU
********** END **********