Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- .text
- .global minmax
- minmax:
- pushl %ebp
- movl %esp, %ebp
- pushl %ebx
- movl (%eax), %ebx
- movl (%eax), %ecx
- incl %edx
- process:
- cmpl $0, %edx
- jl end
- addl $4, %eax
- cmpl %ebx, (%eax)
- jl newmin
- cmpl %ecx, (%eax)
- jg newmax
- subl $1, %edx
- jmp process
- newmin:
- movl (%eax), %ebx
- jmp process
- newmax:
- movl (%eax), %ebx
- jmp process
- end:
- pop %ebx
- pop %ebp
- movl %ecx, %edx
- movl %ebx, %eax
- ret
- //eax- начало
- //edx - количество
- //eax - мин
- //edx - макс
- //в ecx - cur max, в ebx cur мин
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement