Advertisement
Guest User

Zbir prvih N brojeva u NASM

a guest
May 29th, 2019
180
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ;Ucitati n brojeva i izracunati njihov zbir
  2. %include "io.inc"
  3.  
  4. section .data
  5.  
  6. section .text
  7. GLOBAL CMAIN
  8. CMAIN:
  9.     mov ebp, esp; for correct debugging
  10.  
  11. mov ebx , 0
  12. GET_DEC 4 , eax
  13. inc eax
  14.  
  15.  
  16. petlja1:
  17. dec eax
  18. cmp eax , 1
  19. jb kraj
  20. GET_DEC 4 , ecx
  21. ADD ebx , ecx
  22. jmp petlja1
  23.  
  24. kraj:
  25.  
  26. PRINT_DEC 4 , ebx
  27.  
  28. xor eax , eax
  29. ret
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement