Advertisement
Aseron

asm

Apr 30th, 2017
366
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. INCLUDE Irvine32.inc
  2.  
  3. .stack 4096
  4.  
  5. .data
  6.  
  7. INPUT DB 10 DUP (0)
  8. szam DD 0
  9.  
  10. .code
  11.  
  12. main PROC
  13.  
  14.     mov edx, offset INPUT
  15.     call ReadString
  16.     dec eax
  17.     mov ecx, eax
  18.     mov eax, 1
  19.  
  20. atalakit:
  21.     movzx ebx, INPUT[ecx]
  22.     sub ebx, 48
  23.     imul ebx, eax
  24.     push edx
  25.     mov edx, szam
  26.     add edx, ebx
  27.     mov szam, edx
  28.     pop edx
  29.     imul eax, 10
  30. loop atalakit
  31.  
  32. movzx ebx, INPUT[ecx]
  33. sub ebx, 48
  34. imul ebx, eax
  35. add szam, ebx
  36. mov eax, szam
  37.  
  38. CALL WriteDec
  39.  
  40. INVOKE  ExitProcess, 0
  41. main ENDP
  42.  
  43. END main
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement