Advertisement
lukicdarkoo

Priprema za Test12, zadatak 2

Apr 11th, 2014
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. .section .data
  2.     niz2: .quad 9456465465, 456, -6132123123
  3.     niz2_l = 3
  4.     van_opsega: .long 0
  5.  
  6.     min: .quad -5000000000
  7.     max: .quad 6000000000
  8.  
  9. .section .text
  10. .global main
  11.  
  12. main:
  13.     movl $0, %esi
  14.  
  15.     while:
  16.     cmpl $niz2_l, %esi
  17.     jge whileKraj
  18.        
  19.  
  20.         movl $4, %ebx #asembler je glup
  21.  
  22.         #poredim znacajnije dijelove
  23.         movl (max + 4), %eax
  24.         cmpl niz2(%ebx, %esi, 8), %eax
  25.         jl ifUvecaj
  26.         je provjeriMaxNizi
  27.  
  28.         movl (min + 4), %eax
  29.         cmpl niz2(%ebx, %esi, 8), %eax
  30.         jg ifUvecaj
  31.         je provjeriMinNizi
  32.        
  33.         jmp whileBrojac
  34.        
  35.         #poredim manje znacajne dijelove
  36.         provjeriMaxNizi:
  37.             movl (max), %eax
  38.             cmpl niz2(, %esi, 8), %eax
  39.             jl ifUvecaj
  40.             jmp whileBrojac
  41.        
  42.         provjeriMinNizi:
  43.             movl (min), %eax
  44.             cmpl niz2(, %esi, 8), %eax
  45.             jg ifUvecaj
  46.             jmp whileBrojac
  47.        
  48.  
  49.         jmp whileBrojac
  50.         ifUvecaj:
  51.             incl van_opsega
  52.    
  53.     whileBrojac:
  54.     addl $1, %esi
  55.     jmp while
  56.     whileKraj:
  57.  
  58. kraj:
  59.     movl $1, %eax
  60.     movl $0, %ebx
  61.     int $0x80
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement