// trace of 850*77.1 = 65535
// OLD EXCEL Microsoft Excel 2000, 9.0.6926 SP-3
.text:30182242 FormatOld proc near
.text:30182242
.text:30182242 ; FUNCTION CHUNK AT .text:30182238 SIZE 0000000A BYTES
.text:30182242 ; FUNCTION CHUNK AT .text:3067E9F2 SIZE 00000041 BYTES
.text:30182242

// Hexdump of function
.text:30182240  20 C3 66 8B 46 06 66 8B  D0 66 25 F0 7F 74 E9 66 
.text:30182250  C1 E8 04 66 2D FE 03 66  8B D8 98 69 C0 21 9A 00 
.text:30182260  00 C1 F8 11 66 05 01 40  66 81 E2 00 80 66 0B D0 
.text:30182270  66 89 57 20 66 2D 00 40  66 0B DB 0F 8C A1 00 00 
.text:30182280  00 66 83 FB 10 0F 8F 97  00 00 00 57 51 8B 16 8B 
.text:30182290  76 04 96 25 FF FF 0F 00  0D 00 00 10 00 B1 15 2A  
.text:301822A0  CB 8B D8 D3 E8 F6 D9 0F  A5 D3 D3 E2 8B CA 66 4E 
.text:301822B0  66 D1 E6 66 3B 86 E0 38  18 30 0F 82 5F 01 00 00 
.text:301822C0  E3 13 D1 E6 03 8E F0 38  18 30 83 D3 00 0F 82 58  
.text:301822D0  01 00 00 D1 FE 0B F6 0F  8C 70 01 00 00 74 21 66  
.text:301822E0  33 D2 66 F7 B6 E0 38 18  30 32 E4 0C 30 66 AB 66 
.text:301822F0  0B D2 74 12 66 8B C2 83  EE 02 77 E3 0A C0 74 06 
.text:30182300  32 E4 0C 30 66 AB 8B C3  0B C1 0F 85 40 01 00 00 
.text:30182310  66 C7 07 30 00 59 5B 8B  D7 2B D3 D1 FA E9 D2 00  
.text:30182320  00 00 66 83 F9 0F 73 13  66 03 C8 0F 8C 07 FF FF 
.text:30182330  FF 66 83 F9 0F 0F 83 B7  C6 4F 00 51 57 66 8B CB 
.text:30182340  8B 3E 8B 76 04 81 CE 00  00 10 00 0F A4 FE 0B C1 
.text:30182350  E7 0B 66 F7 D8 E8 1A 02  00 00 66 85 C9 74 0E 0F 
.text:30182360  8D 96 C6 4F 00 66 F7 D9  0F AD F7 D3 EE 81 FF 99 
.text:30182370  99 99 99 8B C6 1D 99 99  99 19 B8 9A 03 00 00 72 
.text:30182380  05 B8 07 24 00 00 03 F8  83 D6 00 8B DF 5F 0F 82  


// Divisor table
.text:301838C0  0C 0C 0C 00 AA 02 0D 09  08 0C 0C 0C 0C 0C 0C 0C
.text:301838D0  0C 0C 0C 0C 0C 00 00 00  00 00 00 00 00 00 00 00 
.text:301838E0  01 00 0A 00 64 00 E8 03  10 27 FF FF 07 24 00 00  
.text:301838F0  49 68 01 00 E1 12 0E 00  CC BC 8C 00 F8 5F 7F 05 
.text:30183900  B3 BF F9 36 00 00 00 00  00 00 00 00 00 00 00 00 

// trace of 850*77.1 = 65535
ST0= 0.0 ST1= 0.0 ST2= 0.0 ST3= 0.0 ST4= 0.0 ST5= 1.0 ST6= 1.0 ST7= 6.5534999999999995168e4 CTRL=137F 
CS=1B DS=23 ES=23 FS=3B GS=0 SS=23 EAX=8 EBX=FFEC4C36 ECX=F EDX=13B3CA ESI=306A3D08 EDI=13B3CA EBP=306A3FC0 ESP=13B2E4 EFL=202  
FormatOld              mov     ax, [esi+6]                 EAX=40EF                          
FormatOld+4            mov     dx, ax                      EDX=1340EF                        
FormatOld+7            and     ax, 7FF0h                   EAX=40E0                          
FormatOld+B            jz      short loc_30182238                                            
FormatOld+D            shr     ax, 4                       EAX=40E AF=1                      
FormatOld+11           sub     ax, 3FEh                    EAX=10 AF=0                       
FormatOld+15           mov     bx, ax                      EBX=FFEC0010                      
FormatOld+18           cwde                                                                  
FormatOld+19           imul    eax, 9A21h                  EAX=9A210                         
FormatOld+1F           sar     eax, 11h                    EAX=4 CF=1 AF=1                   
FormatOld+22           add     ax, 4001h                   EAX=4005 CF=0 PF=1 AF=0           
FormatOld+26           and     dx, 8000h                   EDX=130000 ZF=1                   
FormatOld+2B           or      dx, ax                      EDX=134005 ZF=0                   
FormatOld+2E           mov     [edi+20h], dx                                                 
FormatOld+32           sub     ax, 4000h                   EAX=5                             
FormatOld+36           or      bx, bx                      PF=0                              
FormatOld+39           jl      loc_30182322                                                  
FormatOld+3F           cmp     bx, 10h                     PF=1 ZF=1                         
FormatOld+43           jg      loc_30182322                                                  
FormatOld+49           push    edi                         ESP=13B2E0                        
FormatOld+4A           push    ecx                         ESP=13B2DC                        
FormatOld+4B           mov     edx, [esi]                  EDX=FFFFFFFF                      
FormatOld+4D           mov     esi, [esi+4]                ESI=40EFFFDF                      
FormatOld+50           xchg    eax, esi                    EAX=40EFFFDF ESI=5                
FormatOld+51           and     eax, 0FFFFFh                EAX=FFFDF PF=0 ZF=0               
FormatOld+56           or      eax, 100000h                EAX=1FFFDF                        
FormatOld+5B           mov     cl, 15h                     ECX=15                            
FormatOld+5D           sub     cl, bl                      ECX=5 PF=1                        
FormatOld+5F           mov     ebx, eax                    EBX=1FFFDF                        
FormatOld+61           shr     eax, cl                     EAX=FFFE CF=1 PF=0 AF=1           
FormatOld+63           neg     cl                          ECX=FB SF=1                       
FormatOld+65           shld    ebx, edx, cl                EBX=FFFFFFFF CF=0 PF=1 OF=1       
FormatOld+68           shl     edx, cl                     EDX=F8000000 CF=1 OF=0            
FormatOld+6A           mov     ecx, edx                    ECX=F8000000                      
FormatOld+6C           dec     si                          ESI=4 PF=0 AF=0 SF=0              
FormatOld+6E           shl     si, 1                       ESI=8 CF=0 AF=1                   
FormatOld+71           cmp     ax, ds:word_301838E0[esi]   PF=1 AF=0 SF=1                    
FormatOld+78           jb      loc_3018241F                                                  
FormatOld:loc_301822C0 jecxz   short loc_301822D5                                            
FormatOld+80           shl     esi, 1                      ESI=10 PF=0 AF=1 SF=0             
FormatOld+82           add     ecx, ds:dword_301838F0[esi] ECX=2EF9BFB3 CF=1 AF=0            
FormatOld+88           adc     ebx, 0                      EBX=0 PF=1 AF=1 ZF=1              
FormatOld+8B           jb      loc_3018242B                                                  
FormatOld:loc_3018242B xor     ecx, ecx                    ECX=0 CF=0 AF=0                   
FormatOld+1EB          sar     esi, 1                      ESI=8 PF=0 AF=1 ZF=0              
FormatOld+1ED          mov     dx, 1                       EDX=F8000001                      
FormatOld+1F1          inc     ax                          EAX=FFFF PF=1 AF=0 SF=1           
FormatOld+1F3          jz      loc_301822E2                                                  
FormatOld+1F9          cmp     ax, ds:word_301838E2[esi]   ZF=1 SF=0                         
FormatOld+200          jb      loc_301822D5                                                  
FormatOld+206          jmp     loc_3067EA1D                                                  
FormatOld:loc_3067EA1D cmp     ax, 0FFFFh                                                    
FormatOld+4FC7DF       jz      Digits                                                        

FormatOld:Digits       xor     dx, dx                      EDX=F8000000                      
FormatOld:loc_301822E2 div     ds:word_301838E0[esi]       EAX=6 EDX=F800159F PF=0 AF=1 ZF=0 
FormatOld+A7           xor     ah, ah                      PF=1 AF=0 ZF=1                    
FormatOld+A9           or      al, 30h                     EAX=36 ZF=0                       // '6' character 
FormatOld+AB           stosw                               EDI=13B3CC                        
FormatOld+AD           or      dx, dx                                                        
FormatOld+B0           jz      short loc_30182306                                            
FormatOld+B2           mov     ax, dx                      EAX=159F                          
FormatOld+B5           sub     esi, 2                      ESI=6                             
FormatOld+B8           ja      short Digits                                                  

FormatOld:Digits       xor     dx, dx                      EDX=F8000000 ZF=1                 
FormatOld:loc_301822E2 div     ds:word_301838E0[esi]       EAX=5 EDX=F8000217 PF=0 AF=1 ZF=0 
FormatOld+A7           xor     ah, ah                      PF=1 AF=0 ZF=1                    
FormatOld+A9           or      al, 30h                     EAX=35 ZF=0                       // '5' character 
FormatOld+AB           stosw                               EDI=13B3CE                        
FormatOld+AD           or      dx, dx                                                        
FormatOld+B0           jz      short loc_30182306                                            
FormatOld+B2           mov     ax, dx                      EAX=217                           
FormatOld+B5           sub     esi, 2                      ESI=4 PF=0                        
FormatOld+B8           ja      short Digits                                                  

FormatOld:Digits       xor     dx, dx                      EDX=F8000000 PF=1 ZF=1            
FormatOld:loc_301822E2 div     ds:word_301838E0[esi]       EAX=5 EDX=F8000023 PF=0 AF=1 ZF=0 
FormatOld+A7           xor     ah, ah                      PF=1 AF=0 ZF=1                    
FormatOld+A9           or      al, 30h                     EAX=35 ZF=0                       
FormatOld+AB           stosw                               EDI=13B3D0                        
FormatOld+AD           or      dx, dx                      PF=0                              
FormatOld+B0           jz      short loc_30182306                                            
FormatOld+B2           mov     ax, dx                      EAX=23                            
FormatOld+B5           sub     esi, 2                      ESI=2                             
FormatOld+B8           ja      short Digits                                                  

FormatOld:Digits       xor     dx, dx                      EDX=F8000000 PF=1 ZF=1            
FormatOld:loc_301822E2 div     ds:word_301838E0[esi]       EAX=3 EDX=F8000005 PF=0 AF=1 ZF=0 
FormatOld+A7           xor     ah, ah                      PF=1 AF=0 ZF=1                    
FormatOld+A9           or      al, 30h                     EAX=33 ZF=0                       
FormatOld+AB           stosw                               EDI=13B3D2                        
FormatOld+AD           or      dx, dx                                                        
FormatOld+B0           jz      short loc_30182306                                            
FormatOld+B2           mov     ax, dx                      EAX=5                             
FormatOld+B5           sub     esi, 2                      ESI=0 ZF=1                        
FormatOld+B8           ja      short Digits                                                  
FormatOld+BA           or      al, al                      ZF=0                              
FormatOld+BC           jz      short loc_30182306                                            
FormatOld:loc_30182300 xor     ah, ah                      ZF=1                              
FormatOld+C0           or      al, 30h                     EAX=35 ZF=0                       
FormatOld+C2           stosw                               EDI=13B3D4                        
FormatOld:loc_30182306 mov     eax, ebx                    EAX=0                             
FormatOld+C6           or      eax, ecx                    ZF=1                              
FormatOld+C8           jnz     loc_30182450                                                  
FormatOld+CE           mov     word ptr [edi], 30h                                           
FormatOld+D3           pop     ecx                         ECX=F ESP=13B2E0                  
FormatOld+D4           pop     ebx                         EBX=13B3CA ESP=13B2E4             
FormatOld+D5           mov     edx, edi                    EDX=13B3D4                        
FormatOld+D7           sub     edx, ebx                    EDX=A AF=1 ZF=0                   
FormatOld+D9           sar     edx, 1                      EDX=5                             
FormatOld+DB           jmp     loc_301823F4                                                  
FormatOld:loc_301823F4 mov     eax, edx                    EAX=5                             
FormatOld+1B4          shl     eax, 10h                    EAX=50000                         
FormatOld+1B7          mov     [ebx+1Eh], dl                                                 
FormatOld+1BA          mov     ax, [ebx+20h]               EAX=54005                         
FormatOld+1BE          and     eax, 0FFFF7FFFh             AF=0                              
FormatOld+1C3          sub     ax, 4000h                   EAX=50005                         
FormatOld+1C7          retn                                ESP=13B2E8                        
