Advertisement
swarley

Untitled

Sep 3rd, 2012
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Perl 0.68 KB | None | 0 0
  1. #ifdef TEST
  2. .globl strcspn_
  3. strcspn_:
  4. #else
  5. .globl strcspn
  6. strcspn:
  7. #endif
  8. #ifdef __x86_64__
  9.     mov %rsi, %rcx
  10.     xor %rax, %rax
  11. 1:
  12.     movb    (%rsi), %cl
  13.     cmp (%rdi), %cl
  14.     je  3f
  15.     inc %rsi
  16.     cmp $0, (%rsi)
  17.     jne 1b
  18. 2:
  19.     mov %rcx, %rsi
  20.     inc %rdi
  21.     inc %rax
  22.     cmp $0, %rdi
  23.     jne 1b
  24. 3:
  25.     ret
  26. #endif
  27.  
  28.  
  29. --------------------------------------------------------------------
  30.  
  31. Breakpoint 2, strcspn_ () at ../../src/string/strcspn.S:16
  32. 16      cmp $0, (%rsi)
  33. (gdb) x/c $rsi
  34. 0x4010b4:   0 '\000'
  35. (gdb) b 18
  36. Breakpoint 3 at 0x400cf8: file ../../src/string/strcspn.S, line 18.
  37. (gdb) c
  38. Continuing.
  39.  
  40. Breakpoint 2, strcspn_ () at ../../src/string/strcspn.S:16
  41. 16      cmp $0, (%rsi)
  42. (gdb)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement