Advertisement
Guest User

Untitled

a guest
Feb 17th, 2019
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1. .text
  2. .global minmax
  3.  
  4. minmax:
  5. pushl %ebp
  6. movl %esp, %ebp
  7. pushl %ebx
  8. movl (%eax), %ebx
  9. movl (%eax), %ecx
  10. incl %edx
  11.  
  12. process:
  13. cmpl $0, %edx
  14. jl end
  15. addl $4, %eax
  16. cmpl %ebx, (%eax)
  17. jl newmin
  18. cmpl %ecx, (%eax)
  19. jg newmax
  20. subl $1, %edx
  21. jmp process
  22.  
  23. newmin:
  24. movl (%eax), %ebx
  25. jmp process
  26. newmax:
  27. movl (%eax), %ebx
  28. jmp process
  29.  
  30. end:
  31. pop %ebx
  32. pop %ebp
  33. movl %ecx, %edx
  34. movl %ebx, %eax
  35. ret
  36.  
  37. //eax- начало
  38. //edx - количество
  39. //eax - мин
  40. //edx - макс
  41. //в ecx - cur max, в ebx cur мин
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement