Advertisement
Guest User

Untitled

a guest
Feb 19th, 2018
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1. .data
  2. str: .int 8
  3. lng: .int 12
  4. .text
  5. .global _mystrspn
  6. _mystrspn:
  7. push %ebp
  8. movl %esp, %ebp
  9. push %esi // Счетчик
  10. movl $0, %esi
  11.  
  12. movl str(%ebp), %ecx // Строка
  13. movl lng(%ebp), %edx // Язык
  14.  
  15.  
  16. while:
  17. mov (%ecx), %eax
  18. test %eax, %eax
  19. jz end
  20. mov (%edx), %ebx
  21. test %ebx, %ebx
  22. jz end
  23. cmp %eax, %ebx
  24. jz if
  25. addl $1, %edx
  26. jmp while
  27. if:
  28. addl $1, %esi
  29. addl $1, %ecx
  30. movl lng(%ebp), %edx
  31. jmp while
  32. end:
  33. movl %esi, %eax
  34. pop %esi
  35. movl %ebp, %esp
  36. pop %ebp
  37. ret
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement