Advertisement
shssoichiro

Untitled

Jan 22nd, 2023
1,604
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. example::divu_gen:
  2.         lzcnt   ecx, esi
  3.         mov     eax, 32
  4.         mov     edx, -1
  5.         mov     r9, rdi
  6.         sub     eax, ecx
  7.         blsr    ecx, esi
  8.         mov     ecx, -1
  9.         lea     r8, [rax - 1]
  10.         je      .LBB0_2
  11.         mov     edx, 2147483648
  12.         mov     ecx, esi
  13.         shlx    rax, rdx, rax
  14.         xor     edx, edx
  15.         div     rcx
  16.         mov     ecx, 1
  17.         shlx    r10, rcx, r8
  18.         xor     edx, edx
  19.         xor     ecx, ecx
  20.         mov     edi, eax
  21.         imul    edi, esi
  22.         add     edi, esi
  23.         cmp     rdi, r10
  24.         setbe   cl
  25.         cmova   edx, eax
  26.         add     ecx, eax
  27. .LBB0_2:
  28.         mov     dword ptr [r9], ecx
  29.         mov     dword ptr [r9 + 4], edx
  30.         mov     rax, r9
  31.         mov     dword ptr [r9 + 8], r8d
  32.         ret
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement