FUnneR

Zadatak 7 - V3

Mar 22nd, 2016
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #indexe min i max
  2. #Nemanja Komadina PR140/2015
  3. .section .data
  4. min: .long 0
  5. max: .long 0
  6. niz: .long 7,2,12,4,55,6,1,8,9,10
  7. el: .long 10
  8. .section .text
  9. .globl main
  10. main:
  11.     movl $0, %esi
  12.     movl $0, %edx
  13.     movl $0, %ecx
  14.     movl niz(,%esi,4), %eax
  15.     movl niz(,%esi,4), %ebx
  16. petlja:
  17.     cmpl niz(,%esi,4), %eax
  18.     jl maxim
  19. petljam:
  20.     cmpl niz(,%esi,4), %ebx
  21.     jg minim
  22.     cmpl %esi, el
  23.     je kraj
  24.     incl %esi
  25.     jmp petlja
  26. maxim:
  27.     movl niz(,%esi,4),%eax
  28.     movl %esi, %ecx
  29.     incl %esi
  30.     jmp petlja
  31. minim:
  32.     movl niz(,%esi,4),%ebx
  33.     movl %esi, %edx
  34.     incl %esi
  35.     jmp petljam
  36. kraj:
  37.     movl %ecx, max
  38.     movl %edx, min
  39.     movl $1,%eax
  40.     int $0x80
Advertisement
Add Comment
Please, Sign In to add comment