Guest User

lol optimized opsize

a guest
Oct 2nd, 2018
59
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ;----------------------------------
  2. ;opsize(2)/1
  3. ;Get size between 2 labels
  4. ;----------------------------------
  5. ;push2  : Label (reg32,add32)
  6. ;push1  : Label (reg32,add32)
  7. ;----------------------------------
  8. ;Ret    : Size
  9. ;Note   : Order of label is irrelevant
  10. ;----------------------------------
  11. align 4
  12. opsize: ; code is basically abs(arg1 - arg2)
  13.         push    ebx
  14.         mov     eax, [esp+8]
  15.         sub     eax, [esp+4]
  16.        
  17.         cdq ; Get absolute value
  18.         xor     eax, edx
  19.         sub     eax, edx
  20.        
  21.         pop     edx
  22.         ret     8
RAW Paste Data