Advertisement
Guest User

Untitled

a guest
Nov 21st, 2017
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. format MZ
  2. stack stk:256
  3. entry codseg:main
  4.  
  5. macro delay time
  6. {
  7. LOCAL ext,iter
  8. push cx
  9. mov cx, time
  10.  
  11. ext:
  12. push cx
  13. mov cx,5000
  14. iter:
  15. loop iter
  16. pop cx
  17. loop ext
  18. pop cx
  19. }
  20.  
  21. segment stk use16
  22. db 256 dup (?)
  23.  
  24. segment sdat use16
  25. tone dw 500
  26.  
  27. segment codseg use16
  28.  
  29.  
  30.  
  31.  
  32. main:
  33. ;;;;;;;;;;;;;;;;;;;;;;;;;;
  34. mov ax,sdat
  35. mov ds,ax;
  36.  
  37. xor ax,ax
  38.  
  39. mov al,036h ;ustawienie danych
  40. out 43h,al
  41.  
  42. in al,61h
  43. or al,3h
  44. out 61h,al
  45.  
  46. mov ax,[tone]
  47. out 42h,al
  48. mov al,ah
  49. out 42h,al
  50.  
  51. delay 10
  52.  
  53. in al,61h
  54. and al,0fch
  55. out 61h,al
  56.  
  57.  
  58.  
  59.  
  60. ;;;;;;;;;;;;;;;;;;;; oczekiwanie na naciśnięcie klawisza
  61.  
  62. pop es
  63. mov ah,1h
  64. int 21h
  65. ;;;;;;;;;;;;;;;;;
  66.  
  67. ;;;;;;;;;;;;; wyjscie z prog
  68. mov ax,4c00h
  69. int 21h
  70. ret
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement