Advertisement
kamasazi99

zadanie 2 asm lab3

Nov 3rd, 2019
286
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. zadanie 2
  2.  
  3. .386
  4. .MODEL flat, STDCALL
  5.  
  6. GetStdHandle PROTO :DWORD
  7. WriteConsoleA PROTO :DWORD,:DWORD,:DWORD,:DWORD,:DWORD
  8. ReadConsoleA PROTO :DWORD,:DWORD,:DWORD,:DWORD,:DWORD
  9. ExitProcess PROTO :DWORD
  10.  
  11. .data
  12. sorce BYTE 10 dup(0)
  13. destination BYTE 10 dup(0)
  14. buffor BYTE 255 dup(0)
  15. odczyt DWORD 0
  16. wpis DWORD 0
  17. odczytane_znaki DWORD 0
  18.  
  19. .code
  20. main proc
  21. push -11
  22. call GetStdHandle
  23. mov wpis,EAX
  24.  
  25. push -10
  26. call GetStdHandle
  27. mov odczyt,EAX
  28.  
  29. push 0
  30. push OFFSET odczytane_znaki
  31. push 10d
  32. push OFFSET sorce
  33. push odczyt
  34. call ReadConsoleA
  35.  
  36. MOV ESI, OFFSET sorce
  37. MOV EDI, OFFSET destination
  38.  
  39. MOV ECX,10d
  40. rep MOVSB
  41.  
  42. push 0
  43. push OFFSET odczytane_znaki
  44. push 10d
  45. push OFFSET destination
  46. push wpis
  47. call WriteConsoleA
  48.  
  49. push 0
  50. call ExitProcess
  51. main endp
  52. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement