Guest User

MTGos strcmp

a guest
Feb 3rd, 2016
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. .global strlen
  2. strlen:
  3. mov $0x1, %eax
  4. cpuid
  5. test $0x100000, %eax
  6. beq .unoptim
  7. enter $0x10
  8. mov 0x8(%ebp), %ecx
  9. mov %ecx, %edx
  10. mov $0xFFFFFFF0, %eax
  11. pxor %xmm0, %xmm0
  12. .strlen_start:
  13. add $0x10, %eax
  14. pcmpistri $0x8,(%eax,%edx,1),%xmm0
  15. jne .strlen_start
  16. add %ecx, %eax
  17. leave
  18. ret
  19. .unoptim:
  20. push %esi
  21. xor %ecx, %ecx
  22. dec %ecx
  23. .loop:
  24. inc %ecx
  25. lodsb
  26. jne .loop:
  27. mov %ecx, %eax
  28. pop %esi
  29. leave
  30. ret
Advertisement
Add Comment
Please, Sign In to add comment