Advertisement
kamasazi99

asm lab 5, 1 zad

Nov 21st, 2019
283
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. .386
  2. .Model flat,STDCALL
  3. ExitProcess PROTO: DWORD
  4. WriteConsoleA PROTO: DWORD,:DWORD,:DWORD,:DWORD,:DWORD
  5. ReadConsoleA PROTO :DWORD,:DWORD,:DWORD,:DWORD,:DWORD
  6. GetStdHandle PROTO: DWORD
  7.  
  8. .data
  9. odczyt DWORD ?
  10. wypisz DWORD ?
  11. znaki DWORD ?
  12. varA DWORD 5
  13. varB DWORD 8
  14. varEqual Byte "Sa rowne",0
  15. varEqualNot Byte "Nie sa rowne",0
  16. .code
  17. main proc
  18. push -11
  19. call GetStdHandle
  20. mov wypisz,eax
  21.  
  22. push -10
  23. call GetStdHandle
  24. mov odczyt,eax
  25.  
  26. push 0
  27. push offset znaki
  28. push 13
  29. push offset varA
  30. push odczyt
  31. call ReadConsoleA
  32.  
  33. push 0
  34. push offset znaki
  35. push 13
  36. push offset varB
  37. push odczyt
  38. call ReadConsoleA
  39.  
  40. mov eax,varA
  41.  
  42. .IF eax==varB
  43. push 0
  44. push offset znaki
  45. push lengthof varEqual
  46. push offset varEqual
  47. push wypisz
  48. call WriteConsoleA
  49. .ENDIF
  50. mov eax,varA
  51. .IF eax!=varB
  52. push 0
  53. push offset znaki
  54. push lengthof varEqualNot
  55. push offset varEqualNot
  56. push wypisz
  57. call WriteConsoleA
  58. .ENDIF
  59.  
  60.  
  61.  
  62. push 0
  63. call ExitProcess
  64.  
  65. main endp
  66.  
  67. END
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement