home *** CD-ROM | disk | FTP | other *** search
/ The Party 1994: Try This At Home / disk_image.bin / source / vexsrc / keyboard.asm < prev    next >
Assembly Source File  |  1995-03-29  |  1KB  |  66 lines

  1. comment #
  2. /*****************************************************************************
  3.                                   ATTENTION!
  4.                            this source is VOTEWARE,
  5.               you may only use it to the conditions listed below:
  6.  
  7.   -You may modify it, or use parts of it in your own source as long as
  8.     this header stays on top of all files containing this source.
  9.   -You must give proper credit to the author, Niklas Beisert / pascal.
  10.   -You may not use it in commercial productions without the written
  11.     permission of the author.
  12.   -AND MOST IMPORTANT: you have to buy an Assembly '94 CD-ROM
  13.     by Sound Solutions (if you don't have it already) and vote for VEX-InTrO
  14.     in the PC-64k-Intro-Compo! (if you have already sent your voting card,
  15.     buy another one and fill it out CORRECTLY!!!)
  16. *****************************************************************************/
  17. #
  18.  
  19.  
  20.  
  21. ;// disables the keyboard, bug: leaves one pressed key in the buffer
  22.  
  23. .model large, c
  24. .386
  25. locals
  26.  
  27. .code
  28.  
  29. public InitKey
  30. public CloseKey
  31.  
  32. oldirq db 0
  33.  
  34. InitKey proc
  35.   in al,21h
  36.   mov cs:oldirq,al
  37.   or al,2
  38.   out 21h,al
  39.   ret
  40. InitKey endp
  41.  
  42. CloseKey proc
  43. @@2:
  44.   in al,64h
  45.   test al,1
  46.   jz @@1
  47.   in al,60h
  48.   jmp @@2
  49. @@1:
  50.   mov al,cs:oldirq
  51.   out 21h,al
  52.  
  53. @@flush:
  54.     mov ah,11h
  55.     int 16h
  56.     jz @@ok
  57.     mov ah,10h
  58.     int 16h
  59.   jmp @@flush
  60. @@ok:
  61.  
  62.   ret
  63. CloseKey endp
  64.  
  65. end
  66.