kokokozhina

cycle

Apr 20th, 2016
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. section .data
  2. fmt db "%d", 10, 0
  3.  
  4. section .bss
  5. s: resd 1
  6.  
  7. section .text
  8. extern _printf
  9. global _cycle
  10. global _fin
  11. global _main
  12.  
  13. _main:
  14. mov ecx, dword 1
  15. mov [s], dword 0
  16. _cycle: cmp ecx, dword 5
  17. jg _fin
  18. add [s], ecx
  19. add ecx, dword 1
  20. jmp _cycle
  21.  
  22. _fin:
  23. push dword [s]
  24. push fmt
  25. call _printf
  26. add esp, 8
  27. xor ecx, ecx
  28. xor eax, eax
  29. ret
Add Comment
Please, Sign In to add comment