kamasazi99

zadanie 1 asm lab3

Nov 3rd, 2019
226
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. zadanie 1
  2.  
  3. .386
  4. .MODEL flat, STDCALL
  5. GetStdHandle PROTO: DWORD
  6. WriteConsoleA PROTO: DWORD,:DWORD,:DWORD,:DWORD,:DWORD
  7. ReadConsoleA PROTO :DWORD,:DWORD,:DWORD,:DWORD,:DWORD
  8. ExitProcess PROTO:DWORD
  9. .data
  10. source BYTE 10 dup(0)
  11. destination BYTE 10 dup(0)
  12. licznik DWORD 10
  13. odczyt DWORD 0
  14. wpis DWORD 0
  15. odczytane_znaki DWORD 0
  16. zacheta byte "podaj 10 znakow: ",0
  17. .code
  18. main proc
  19. push -11;odczyt
  20. call GetStdHandle
  21. mov wpis,eax
  22.  
  23. push -10
  24. call GetStdHandle
  25. mov odczyt,eax
  26.  
  27. push 0
  28. push offset odczytane_znaki
  29. push lengthof zacheta
  30. push offset zacheta
  31. push wpis
  32. call WriteConsoleA
  33.  
  34. push 0
  35. push offset odczytane_znaki
  36. push 13
  37. push offset  source
  38. push odczyt
  39. call ReadConsoleA
  40.  
  41. mov ebx,0
  42. mov ECX, licznik
  43. petla:
  44. push ecx
  45. mov al,0
  46. add al,source[ebx]
  47. mov destination[ebx],al
  48. add ebx,1
  49. pop ecx
  50. LOOP petla
  51.  
  52. push 0
  53. push offset odczytane_znaki
  54. push 13
  55. push offset destination
  56. push wpis
  57. call WriteConsoleA
  58.  
  59.  
  60.  
  61. push 0
  62. call ExitProcess
  63. main endp
  64. END
Add Comment
Please, Sign In to add comment