Guest User

Untitled

a guest
May 21st, 2018
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. SECTION .data
  2. N DD 100
  3. msg DB "The result is %d",0xa,0
  4.  
  5. SECTION .text
  6. global main
  7. extern printf
  8. main:
  9. mov ecx, 1
  10. mov eax, 1
  11.  
  12. L1:
  13. cmp ecx, [N]
  14. jg L2
  15. mov eax, ecx
  16. imul eax, eax
  17. push eax
  18. inc ecx
  19. jmp L1
  20. L2:
  21. mov eax, 0
  22. dec ecx
  23. L3:
  24. cmp ecx, 0
  25. jle L4
  26. pop edx
  27. add eax, edx
  28. dec ecx
  29. jmp L3
  30. L4:
  31. push eax
  32. push msg
  33. call printf
  34. add esp, 8
  35. ende:
  36. mov ebx, 0
  37. mov eax, 1
  38. int 0x80
Add Comment
Please, Sign In to add comment