Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- .section .data
- n=4
- a: .quad 1000000000000, 2000000000000, -1000000000000, 72
- b: .quad 1, 4000000000000, 2000000000000, 72
- c: .quad 0,0,0,0
- greska: .long 0
- .section .text
- .global main
- main:
- movl $0, %esi
- while:
- cmpl $n, %esi
- je whileKraj
- movl b+4(, %esi, 8), %eax
- cmpl a+4(, %esi, 8), %eax
- jl oduzmiOdA
- jg saberiSaA
- movl b(, %esi, 8), %eax
- cmpl a(, %esi, 8), %eax
- jl oduzmiOdA
- jg saberiSaA
- saberiSaA:
- movl a(, %esi, 8), %eax
- addl b(, %esi, 8), %eax
- movl a + 4(, %esi, 8), %ebx
- adcl b + 4(, %esi, 8), %ebx
- jo postaviGresku
- movl %ebx, c + 4(, %esi, 8)
- movl %eax, c(, %esi, 8)
- jmp whileBrojac
- oduzmiOdA:
- movl a(, %esi, 8), %eax
- subl b(, %esi, 8), %eax
- movl a + 4(, %esi, 8), %ebx
- sbbl b + 4(, %esi, 8), %ebx
- jo postaviGresku
- movl %ebx, c + 4(, %esi, 8)
- movl %eax, c(, %esi, 8)
- whileBrojac:
- incl %esi
- jmp while
- whileKraj:
- postaviGresku:
- movl $1, greska
- kraj:
- movl $0, %ebx
- movl $1, %eax
- int $0x80
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement