Advertisement
DMG

Poredjenje dva broja u dvostrukoj preciznosti

DMG
Oct 28th, 2014
219
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. # Poredjenje dva oznacena broja a i b u dvostrukoj preciznosti
  2. # dmarjanovic
  3.  
  4. .section .data
  5.     a: .quad 0x87654321123A1234
  6.     b: .quad 0x876543211234FDEB
  7.  
  8. .section .text
  9. .globl main
  10.  
  11. main:
  12.     movl a+4, %eax
  13.     movl b+4, %ebx
  14.  
  15.     cmpl %ebx, %eax
  16.     jg a_bigger
  17.     jl b_bigger
  18.  
  19.     movl a, %eax
  20.     movl b, %ebx
  21.  
  22.     cmpl %ebx, %eax
  23.     jg a_bigger
  24.     jl b_bigger
  25.    
  26.     # a = b
  27.     movl $0, %eax
  28.     jmp end
  29.  
  30. a_bigger:
  31.     movl $1, %eax
  32.     jmp end
  33.  
  34. b_bigger:
  35.     movl $-1, %eax
  36.  
  37. end:
  38.     movl $1, %eax
  39.     int $0x80
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement