Advertisement
joker546645

f * f -> f asm

Jan 8th, 2018
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. .686
  2. .model flat
  3. public _fmf
  4. .data
  5.  
  6. .code
  7. _fmf PROC
  8.     push ebp
  9.     mov ebp, esp
  10.     push esi
  11.     push edi
  12.     push ebx
  13.  
  14.     mov esi, [ebp + 8] ; a
  15.     mov edi, [ebp + 12] ; b
  16.  
  17.     mov eax, esi ; wykl a
  18.     mov ebx, esi ; mant a
  19.     mov ecx, edi ; wykl b
  20.     mov edx, edi ; mant b
  21.  
  22.     and eax, 7F800000h
  23.     rol eax, 9
  24.     sub eax, 127
  25.  
  26.     and ebx, 007FFFFFh
  27.  
  28.     and ecx, 7F800000h
  29.     rol ecx, 9
  30.     sub ecx, 127
  31.  
  32.     and edx, 007FFFFFh
  33.  
  34.     add eax, ecx
  35.     add eax, 127
  36.     mov esi, eax
  37.  
  38.     mov eax, ebx
  39.     bts eax, 23
  40.     bts edx, 23
  41.     mul edx
  42.  
  43.     bt edx, 15
  44.     jnc ptl
  45.     inc esi
  46. ptl:
  47.     shl eax, 1
  48.     rcl edx, 1
  49.     jnc ptl
  50.  
  51.     shr edx, 9
  52.     mov eax, 0
  53.     mov eax, esi
  54.     shl eax, 23
  55.     or eax, edx
  56.  
  57.     push eax
  58.     fld dword ptr [esp]
  59.     add esp, 4
  60.  
  61.  
  62.  
  63.  
  64.     pop ebx
  65.     pop edi
  66.     pop esi
  67.     pop ebp
  68.     ret
  69. _fmf ENDP
  70.  
  71. END
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement