Advertisement
Guest User

Untitled

a guest
Mar 20th, 2019
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1. .text
  2. .global countrec
  3. countrec:
  4. push %ebp
  5. mov %esp, %ebp
  6.  
  7. push %edi
  8. push %esi
  9. push %ebx
  10.  
  11. mov 8(%ebp), %edi
  12. movl 0(%edi), %esi
  13. movl 4(%edi), %ecx
  14. addl %esi, %ecx
  15. mov $0, %ebx
  16.  
  17. while:
  18. mov 4(%ebp), %edx
  19. cmpl %edx, %esi
  20. jl end
  21. mov 4(%ebp), %edx
  22. cmpl %edx, %ecx
  23. jg end
  24. addl $1, %ebx
  25. movl (%ebp), %ebp
  26. jmp while
  27.  
  28. end:
  29. movl 8(%edi), %eax
  30. movl %ebx, (%eax)
  31.  
  32. pop %ebx
  33. pop %esi
  34. pop %edi
  35. mov %esp, %ebp
  36. pop %ebp
  37. ret
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement