home *** CD-ROM | disk | FTP | other *** search
/ CD Actual 15 / CDACTUAL15.iso / cdactual / program / asm / KBSTUF.ZIP / KBSTUFF.INC < prev   
Encoding:
Text File  |  1992-06-01  |  3.9 KB  |  110 lines

  1. ;********************************************************************
  2. ;    (c) Copyright 1989-1992 Magic Box Designs, David J. Crone
  3. ;    all rights reserved
  4. ;
  5. ; Filename: kbstuff.inc
  6. ;
  7. ; Function: Include file for assembly language files which are part
  8. ;               of the keyboard driver 
  9. ;
  10. ; NOTE:  This file has a '.h' equivalent.  If this file changes,
  11. ;        then the same changes need to be made to it.
  12. ;
  13. ; Author: David J. Crone
  14. ; Version: 2.0
  15. ; Last Edit:    23-Apr-90    DJC
  16. ;        22-Sep-89       DJC  End-Of-Interrupt definitions
  17. ;           17-Aug-89       DJC  Creation
  18. ;
  19. ;********************************************************************
  20.  
  21.  
  22. ; --- keyboard flag bits --- 
  23. INS_STATE       equ     80h
  24. CAPS_STATE      equ     40h
  25. NUM_STATE       equ     20h
  26. SCROLL_STATE    equ     10h
  27. ALT_SHIFT       equ     08h
  28. CTL_SHIFT       equ     04h
  29. LEFT_SHIFT      equ     02h
  30. RIGHT_SHIFT     equ     01h
  31.  
  32.  
  33. ; --- keyboard flag_1 bits --- 
  34. INS_SHIFT       equ     80h
  35. CAPS_SHIFT      equ     40h
  36. NUM_SHIFT       equ     20h
  37. SCROLL_SHIFT    equ     10h
  38. HOLD_STATE      equ     08h
  39.  
  40. ; --- keyboard flag_2 bits --- 
  41. KB_ERR_BIT      equ     80h
  42. KB_LED_BIT      equ     40h
  43. KB_RESEND_BIT   equ     20h
  44. KB_ACK_BIT      equ     10h
  45. ; LED current state mask is 07h
  46.  
  47.  
  48. ; --- BIOS area addresses --- 
  49. bios_head       equ     1Ah    ;head ptr
  50. bios_tail       equ     1Ch    ;tail ptr
  51. bios_buffer     equ     1Eh    ;buffer
  52. bios_end        equ     82h    ;ptr to end of buffer
  53. bios_start      equ     80h    ;ptr to start of buffer
  54. bios_flag       equ     17h
  55. bios_flag_1     equ     18h
  56. bios_flag_2     equ     97h
  57. reset_flag    equ    72h    ;system reset flag
  58. BIOS_SEG        equ     40h    ;bios data segment
  59.  
  60.  
  61. ;--- standard keyboard controller definitions --- 
  62. pc_k_data       equ     60h     ;keyboard input/output data port
  63. pc_k_control    equ     64h     ;keyboard controller port 
  64. pc_k_status     equ     64h     ;keyboard controller status register 
  65.  
  66.  
  67. ; --- keyboard command codes --- 
  68. ; -   data port (60h) codes    - 
  69. ;These are sent to the keyboard unit 
  70. KB_RESET        equ     0FFh    ;hard keyboard reset 
  71. KB_RESEND       equ     0FEh    ;resend last command 
  72. KB_ACK          equ     0FAh    ;ack 
  73. KB_DEFAULT      equ     0F6h    ;set keyboard to defaults 
  74. KB_DISABLE      equ     0F5h    ;disable keyboard 
  75. KB_ENABLE       equ     0F4h    ;enable (soft reset) keyboard 
  76. KB_RATE         equ     0F3h    ;set typematic rate 
  77. KB_ECHO         equ     0EEh    ;echo 
  78. KB_LED          equ     0EDh    ;set/reset keyboard leds
  79. ;These are received from the keyboard
  80. KB_OVERRUN      equ     0FFh    ;keyboard character overrun
  81. KB_BATDONE      equ     0AAh    ;BAT (Basic Assurance Test) done
  82.  
  83. ; - control port (64h) commands -
  84. ; These are sent to the 8042 controller 
  85. KC_READ         equ     20h     ;returns current command reg 
  86. KC_WRITE        equ     60h     ;write next byte to command reg 
  87. KC_SELFTEST     equ     0AAh    ;returns 55h if O.K. 
  88. KC_INTERFACE    equ     0ABh    ;test clock & data lines 
  89. KC_DUMP         equ     0ACh    ;dump controller's RAM 
  90. KC_DISABLE      equ     0ADh    ;disable keyboard interface 
  91. KC_ENABLE       equ     0AEh    ;enable keyboard interface 
  92. KC_READIN       equ     0C0h    ;read input port 
  93. KC_READOUT      equ     0D0h    ;read output port 
  94. KC_WRITEOUT     equ     0D1h    ;write output port 
  95. KC_TESTIN       equ     0E0h    ;read test inputs 
  96.  
  97. ; -  status port (64h) bits  -
  98. KS_OBF          equ     01h     ;output buffer full 
  99. KS_IBF          equ     02h     ;input buffer full 
  100. KS_SYSFLAG      equ     04h     ;system flag 
  101. KS_COMMAND      equ     08h     ;next byte will go to command reg 
  102. KS_INHIBIT      equ     10h     ;0=keyboard inhibited 
  103. KS_TXTIMOUT     equ     20h     ;transmit timeout 
  104. KS_RXTIMOUT     equ     40h     ;receive timeout 
  105. KS_PARITY       equ     80h     ;parity error 
  106.  
  107.  
  108. ;----- end of kbstuff.inc -----
  109.  
  110.