Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Program koji nalazi najveci u .quad nizu
- # dmarjanovic
- length = 7
- .section .data
- array: .quad 54646878787, 47684641864, 84684361654, 15646846841, 564564654, 54365465, 646787878784
- .section .text
- .globl main
- main:
- movl $array, %eax
- movl $0, %esi
- movl 4(%eax,%esi,4), %ecx
- movl (%eax,%esi,4), %edx
- addl $2, %esi
- for_array:
- cmpl $length*2, %esi
- je end
- # Visih 32 bita
- cmpl 4(%eax,%esi,4), %ecx
- jl new_max
- jg jmp_for
- # Nizih 32 bita
- cmpl (%eax,%esi,4), %edx
- jl new_max
- jmp_for:
- addl $2, %esi
- jmp for_array
- new_max:
- movl 4(%eax,%esi,4), %ecx
- movl (%eax,%esi,4), %edx
- jmp jmp_for
- addl $2, %esi
- jmp for_array
- end:
- movl $1, %eax
- int $0x80
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement