Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Program za sortiranje niza
- # dmarjanovic
- LENGTH = 15
- .section .data
- array: .long 1, 7, 52, 14, 19, 3, 40, 32, 3, 111, 64, 70, 9, 7, 3
- .section .text
- .globl main
- main:
- movl $LENGTH, %esi
- for_1:
- subl $2, %esi
- cmpl $0, %esi
- je end
- movl $0, %ebx
- incl %esi
- for_2:
- cmpl %esi, %ebx
- je for_1
- movl array(,%ebx,4), %edx
- incl %ebx
- cmpl array(,%ebx, 4), %edx
- jle goto_for_2
- movl array(,%ebx, 4), %ecx
- movl %edx, array(,%ebx, 4)
- decl %ebx
- movl %ecx, array(,%ebx, 4)
- incl %ebx
- goto_for_2:
- jmp for_2
- end:
- movl $1, %eax
- int $0x80
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement