
Software Optimization Guide for AMD64 Processors | 25112 Rev. 3.06 September 2005 |
lea | edx, [edx*4+edx] | ; 5 * fraction, new fraction |
cmp | ebx, 1 | ; Any nonzero digit yet? |
sbb | edi, | ; Yes, increment ptr. No, keep old ptr. |
shr | eax, 27 | ; Next digit |
and | edx, 07ffffffh | ; Fraction part |
or | ebx, eax | ; Accumulate next digit. |
or | eax, '0' | ; Convert digit to ASCII. |
mov | [edi], al | ; Store digit in memory. |
lea | eax, [edx*4+edx] | ; 5 * fraction, new digit |
lea | edx, [edx*4+edx] | ; 5 * fraction, new fraction |
cmp | ebx, 1 | ; Any nonzero digit yet? |
sbb | edi, | ; Yes, increment ptr. No, keep old ptr. |
shr | eax, 26 | ; Next digit |
and | edx, 03ffffffh | ; Fraction part |
or | ebx, eax | ; Accumulate next digit. |
or | eax, '0' | ; Convert digit to ASCII. |
mov | [edi], al | ; Store digit in memory. |
lea | eax, [edx*4+edx] | ; 5 * fraction, new digit |
lea | edx, [edx*4+edx] | ; 5 * fraction, new fraction |
cmp | ebx, 1 | ; Any nonzero digit yet? |
sbb | edi, | ; Yes, increment ptr. No, keep old ptr. |
shr | eax, 25 | ; Next digit |
and | edx, 01ffffffh | ; Fraction part |
or | ebx, eax | ; Accumulate next digit. |
or | eax, '0' | ; Convert digit to ASCII. |
mov | [edi], al | ; Store digit in memory. |
lea | eax, [edx*4+edx] | ; 5 * fraction, new digit |
lea | edx, [edx*4+edx] | ; 5 * fraction, new fraction |
cmp | ebx, 1 | ; Any nonzero digit yet? |
sbb | edi, | ; Yes, increment ptr, No, keep old ptr. |
shr | eax, 24 | ; Next digit |
and | edx, 00ffffffh | ; Fraction part |
or | ebx, eax | ; Accumulate next digit. |
or | eax, '0' | ; Convert digit to ASCII. |
mov | [edi], al | ; Store digit in memory. |
lea | eax, [edx*4+edx] | ; 5 * fraction, new digit |
lea | edx, [edx*4+edx] | ; 5 * fraction, new fraction |
cmp | ebx, 1 | ; Any nonzero digit yet? |
sbb | edi, | ; Yes, increment ptr. No, keep old ptr. |
shr | eax, 23 | ; Next digit |
and | edx, 007fffffh | ; Fraction part |
or | ebx, eax | ; Accumulate next digit. |
or | eax, '0' | ; Convert digit to ASCII. |
mov | [edi], al | ; Store digit out to memory. |
lea | eax, [edx*4+edx] | ; 5 * fraction, new digit |
lea | edx, [edx*4+edx] | ; 5 * fraction, new fraction |
cmp | ebx, 1 | ; Any nonzero digit yet? |
sbb | edi, | ; Yes, increment ptr. No, keep old ptr. |
shr | eax, 22 | ; Next digit |
and | edx, 003fffffh | ; Fraction part |
OR | ebx, eax | ; Accumulate next digit. |
184 | Integer Optimizations | Chapter 8 |