Advertisement
Guest User

Untitled

a guest
Nov 14th, 2018
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.88 KB | None | 0 0
  1. .686
  2. .model flat
  3.  
  4. .data
  5. extern _ExitProcess@4 : PROC
  6. extern __write : PROC
  7. public _main
  8. znaki db 12 dup(?)
  9.  
  10. .code
  11. wyswietl_EAX PROC
  12. pusha
  13.  
  14. mov esi, 10 ; index for znaki array
  15. mov ebx, 10 ; dzielnik
  16. mov edx, 0 ; set number to convert
  17.  
  18. convert:
  19. div ebx
  20. add dl, 30H
  21. mov znaki[esi], dl
  22. dec esi
  23. mov edx, 0 ; usun reszte z czesci liczby
  24. cmp eax, 0
  25. jna wypelnij
  26. cmp esi, 0
  27. jna wyswietl
  28. jmp convert
  29.  
  30. wypelnij:
  31. mov znaki[esi], 20H
  32. dec esi
  33. cmp esi, 0
  34. je wyswietl
  35. jmp wypelnij
  36.  
  37.  
  38.  
  39. wyswietl:
  40. mov znaki[0], 0AH
  41. mov znaki[11], 0AH
  42.  
  43. push 12
  44. push offset znaki
  45. push 1
  46. call __write
  47. add esp, 12
  48.  
  49. popa
  50. ret
  51. wyswietl_EAX ENDP
  52.  
  53.  
  54. _main PROC
  55. mov esi, 50
  56. mov ebx, 0
  57. mov eax, 1
  58. petla:
  59. add eax, ebx
  60. inc ebx
  61. call wyswietl_EAX
  62. dec esi
  63. cmp esi, 0
  64. ja petla
  65.  
  66. push dword ptr 0
  67. call _ExitProcess@4
  68. _main ENDP
  69. END
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement