Advertisement
Guest User

Untitled

a guest
Mar 19th, 2019
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. .section .data
  2.     NELEM=10
  3.     niz: .long 6, -10, 17, -5, -3, 4, 7, 22, -13, 70, 1
  4.     min: .long 0
  5.     max: .long 0
  6. .section .text
  7. .globl main
  8. main:
  9.     movl $niz, %esi
  10.     movl niz, %eax
  11.     movl niz, %ebx
  12.  
  13. petlja:
  14.     addl $4, %esi
  15.     cmpl %eax, (%esi)
  16.     jge nastavi
  17.     jl resenje
  18.  
  19. nastavi:
  20.     cmpl %ebx, (%esi)
  21.     jle nastavi1
  22.     jg resenje1
  23.  
  24. nastavi1:
  25.     cmpl $niz+NELEM*4, %esi
  26.     jl petlja
  27.     jae kraj
  28.  
  29. resenje:
  30.      movl (%esi), %eax
  31.      jmp nastavi
  32.  
  33. resenje1:
  34.      movl (%esi), %ebx
  35.      jmp nastavi1
  36.  
  37. kraj:
  38. movl %eax, min
  39. movl %ebx, max
  40. movl $1, %eax
  41. movl $0, %ebx
  42. int $0x80
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement