Advertisement
lukicdarkoo

Najveci zajednicki djelilac

Apr 8th, 2014
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. .section .data
  2.     a: .long 16
  3.     b: .long 24
  4.     n: .long 0
  5.  
  6. .section .text
  7. .global main
  8.  
  9. nzd:
  10.     pushl %ebp
  11.     movl %esp, %ebp
  12.    
  13.     movl 8(%ebp), %eax
  14.     movl 12(%ebp), %ecx
  15.    
  16.     nzdWhile:
  17.     cmpl %eax, %ecx
  18.         je nzdWhileKraj
  19.         jg nzdWhileSmanjiDrugi
  20.             subl %ecx, %eax
  21.             jmp nzdWhileKraj
  22.        
  23.         nzdWhileSmanjiDrugi:
  24.             subl %eax, %ecx
  25.    
  26.     nzdWhileKraj:
  27.    
  28.     movl %ebp, %esp
  29.     popl %ebp
  30.     ret
  31.  
  32. main:
  33.     pushl a
  34.     pushl b
  35.     call nzd
  36.     addl $8, %esp
  37.    
  38.     movl %eax, n
  39.  
  40. kraj:
  41.     movl $1, %eax
  42.     movl $0, %ebx
  43.     int $0x80
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement