Advertisement
DMG

Mnozenje sabiranjem

DMG
Oct 28th, 2014
175
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. # Mnozenje pomocu sabiranja
  2. # dmarjanovic
  3.  
  4. .section .data
  5.     rezultat: .long 0
  6.     a: .long 3
  7.     b: .long 8
  8.  
  9. .section .text
  10. .globl main
  11.  
  12. main:
  13.  
  14.     movl a, %eax
  15.     movl rezultat, %ebx
  16.    
  17. for:
  18.     cmpl $0, %eax
  19.     je end
  20.  
  21.     addl b, %ebx
  22.     subl $1, %eax
  23.     jmp for
  24.  
  25. end:
  26.     movl %ebx, rezultat
  27.     movl $1, %eax
  28.     int $0x80
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement