Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

266 lines
16 KiB

  1. ;
  2. ; M024 MD 01/28/91 Added new keyboard commands
  3. ;
  4. ;----------------------------------------------------------------------------
  5. ; EQUATES :
  6. ;----------------------------------------------------------------------------
  7. TTEST EQU 0 ; CONDITIONAL ASM (TEST2.SRC)
  8. KY_LOCK EQU 0 ; CONDITIONAL ASM (TEST2.SRC)
  9. KEY_NUMS EQU 0 ; CONDITIONAL ASM (KYBD.SRC)
  10. ;----------------------------------------------------------------------------
  11. X287 EQU 0F0H ; MATH PROCESSOR
  12. ;----------------------------------------------------------------------------
  13. LOOP_POST EQU 020H ; MFG LOOP POST JUMPER
  14. ;----------------------------------------------------------------------------
  15. REFRESH_BIT EQU 010H ; REFRESH TEST BIT
  16. ;----------------------------------------------------------------------------
  17. POST_SS EQU 0H ; POST STACK SEGMENT
  18. POST_SP EQU 8000H ; POST STACK POINTER
  19. TEMP_STACK_LO EQU 0FFFFH ;
  20. TEMP_STACK_HI EQU 0 ; SET PROTECTED MODE TEMP_SS
  21. ; 0:FFFFH
  22. ;----------------------------------------------------------------------------
  23. PORT_A EQU 60H ; 8042 KEYBOARD SCAN/DIAG OUTPUTS
  24. PORT_B EQU 61H ; 8042 READ WRITE REGISTER
  25. PARITY_ERR EQU 0C0H ; RAM/IO CHANNEL PARITY ERROR
  26. RAM_PAR_ON EQU 11110011B ; AND THIS VALUE
  27. RAM_PAR_OFF EQU 00001100B ; OR THIS VALUE
  28. IO_CHK EQU 01000000B ; IO CHECK?
  29. PRTY_CHK EQU 10000000B ; PARITY CHECK?
  30. STATUS_PORT EQU 64H ;8042 STATUS PORT
  31. OUT_BUF_FULL EQU 01H ; 0 = +OUTPUT BUFFER FULL
  32. INPT_BUF_FULL EQU 02H ; 1 = +INPUT BUFFER FULL
  33. SYS_FLAG EQU 04H ; 2 = -SYSTEM FLAG -POR/-SELF TEST
  34. CMD_DATA EQU 08H ; 3 = -COMMAND/+DATA
  35. KYBD_INH EQU 10H ; 4 = +KEYBOARD INHIBITED
  36. TRANS_TMOUT EQU 20H ; 5 = +TRANSMIT TIMEOUT
  37. RCV_TMOUT EQU 40H ; 6 = +RECEIVE TIME OUT
  38. PARITY_EVEN EQU 80H ; 7 = +PARITY IS EVEN
  39. SHUT_CMD EQU 0FEH ; CAUSE A SHUTDOWN COMMAND
  40. INTR_FACE_CK EQU 0ABH ; CHECK 8042 INTERFACE CMD
  41. KYBD_CLK_DATA EQU 0E0H ; GET KYBD CLOCK AND DATA CMD
  42. KYBD_CLK EQU 001H ; KEYBOARD CLOCK BIT 0
  43. ;----------MANUFACTURING PORT------------------------------------------------
  44. MFG_PORT EQU 80H ; MANUFACTURING CHECKPOINT PORT
  45. ;----------MANUFACTURING BIT DEFINITION FOR MFG_ERR_FLAG+1-------------------
  46. MEM_FAIL EQU 00000001B ; STORAGE TEST FAILED (ERROR 20X)
  47. PRO_FAIL EQU 00000010B ; VIRTUAL MODE TEST FAILED (ERROR 104)
  48. LMCS_FAIL EQU 00000100B ; LOW MEG CHIP SELECT FAILED (ERROR 109)
  49. KYCLK_FAIL EQU 00001000B ; KEYBOARD CLOCK TEST FAILED (ERROR 304)
  50. KY_SYS_FAIL EQU 00010000B ; KEYBOARD OR SYSTEM FAILED (ERROR 303)
  51. KYBD_FAIL EQU 00100000B ; KEYBOARD FAILED (ERROR 301)
  52. DSK_FAIL EQU 01000000B ; DISKETTE TEST FAILED (ERROR 601)
  53. KEY_FAIL EQU 10000000B ; KEYBOARD LOCKED (ERROR 302)
  54. ;----------8042 INPUT PORT BIT DEFINITION------------------------------------
  55. BASE_RAM EQU 10H ;BASE R/W MEMORY
  56. MFG_JMP EQU 20H ;LOOP POST JUMPER
  57. DSP_JMP EQU 40H ;DISPLAY TYPE JUMPER
  58. KEY_BD_INHIB EQU 80H ;KEYBOARD INHIBIT SWITCH
  59. ;----------8042 RAM DEFINITION-----------------------------------------------
  60. INH_KEYBOARD EQU 10H ;BYTE 0 BIT 4 OF 8042 RAM
  61. ;-------------- COMMANDS ----------------------------------------------------
  62. READ_8042_RAM EQU 20H ; BITS 0-4 = ADDRESS (20-3F)
  63. WRITE_8042_RAM EQU 60H ;
  64. SELF_8042_TEST EQU 0AAH ; 8042 SELF TEST
  65. READ_8042_INPUT EQU 0C0H ; READ 8042 INPUT PORT
  66. ENA_KBD EQU 0AEH ; ENABLE KEYBOARD COMMAND
  67. DIS_KBD EQU 0ADH ; DISABLE KEYBOARD COMMAND
  68. ENABLE_BIT20 EQU 0DFH ; ENABLE ADDR LINE BIT 20
  69. DISABLE_BIT20 EQU 0DDH ; DISABLE ADDR LINE BIT 20
  70. ENABLE_AUX EQU 0A8H ; ENABLE AUX DEVICE COMMAND ;M024
  71. DISABLE_AUX EQU 0A7H ; DISABLE AUX DEVICE COMMAND ;M024
  72. ;-------------- KEYBOARD/LED COMMANDS --------------------------------------
  73. KB_MENU EQU 0F1H ; SELECT MENU COMMAND
  74. KB_TYPA_RD EQU 0F3H ; SET TYPAMATIC RATE/DELAY RWV 10-07-85
  75. KB_ENABLE EQU 0F4H ; KEYBOARD ENABLE
  76. KB_MAKE_BREAK EQU 0F7H ; TYPAMATIC
  77. KB_ECHO EQU 0FEH ; ECHO COMMAND
  78. KB_RESET EQU 0FFH ; SELF DIAGNOSTIC COMMAND
  79. LED_CMD EQU 0EDH ; LED WRITE COMMAND
  80. ;--------------- KEYBOARD RESPONSE -----------------------------------------
  81. KB_OK EQU 0AAH ; RESPONSE FROM SELF DIAG
  82. KB_ACK EQU 0FAH ; ACKNOWLEDGE FROM TRANSMISSION
  83. KB_OVER_RUN EQU 0FFH ; OVER RUN
  84. KB_RESEND EQU 0FEH ; RESEND REQUEST
  85. KB_BREAK EQU 0F0H ; KEYBOARD BREAK CODE
  86. ;-------------- CMOS EQUATES -------------------------------------------------
  87. CMOS_PORT EQU 070H ; IO ADDRESS OF CMOS PORT
  88. CLK_UP EQU 08AH ; CLOCK UPDATE STATUS
  89. CMOS_ALARM EQU 08BH ;
  90. CMOS_BEGIN EQU 090H ;
  91. CMOS_END EQU 0ADH ;
  92. SHUT_DOWN EQU 08FH ; SHUTDOWN OFFSET
  93. BATTERY_COND_STATUS EQU 08DH ; BATTERY STATUS
  94. M_SIZE_HI EQU 0B1H ; IO MEMORY SIZE HIGH BYTE (POST)
  95. M_SIZE_LO EQU 0B0H ; IO MEMORY SIZE LO BYTE (POST)
  96. M1_SIZE_HI EQU 096H ; 0->640K CONFIG MEMORY SIZE (SETUP)
  97. M1_SIZE_LO EQU 095H ; LOW BYTE (SETUP)
  98. M2_SIZE_HI EQU 098H ; 640K->UP CONFIG MEMORY SIZE (SETUP)
  99. M2_SIZE_LO EQU 097H ; LOW BYTE (SETUP)
  100. C_EQUIP EQU 094H ; CMOS EQUIPMENT FLAG
  101. HD_FILE_TYPE EQU 092H ; HARD FILE TYPE BYTE
  102. PAGE
  103. ;--------------- CMOS DIAG_STATUS ERROR FLAGS--------------------------------
  104. DIAG_STATUS EQU 08EH ; CMOS ADDRESS OF DIAG_STATUS
  105. BAD_BAT EQU 080H ; DEAD BATTERY
  106. BAD_CKSUM EQU 040H ; CHECKSUM ERROR
  107. BAD_CONFIG EQU 020H ; MINIMUM CONFIG USED INSTEAD OF CMOS
  108. W_MEM_SIZE EQU 010H ; MEMORY SIZE NOT EQUAL TO CONFIG
  109. HF_FAIL EQU 008H ; HARD FILE FAILURE ON INIT
  110. CMOS_CLK_FAIL EQU 004H ; CMOS CLK NOT UPDATING OR NOT VALID
  111. ;--------------- CMOS INFORMATION FLAGS--------------------------------------
  112. INFO_STATUS EQU 0B3H ; CMOS ADDRESS OF INFO BYTE
  113. M640K EQU 080H ; 512K -> 640K CARD INSTALLED
  114. NEW_INST EQU 040H ; FLAG USED BY CMOS SETUP UTILITY
  115. HF_BOOT EQU 020H ; BOOT HARD FILE FLAG
  116. ;--------------- INTERRUPT EQUATES ------------------------------------------
  117. INTA00 EQU 20H ; 8259 PORT
  118. INTA01 EQU 21H ; 8259 PORT
  119. EOI EQU 20H
  120. INTB00 EQU 0A0H ; 2ND 8259
  121. INTB01 EQU 0A1H ;
  122. INT_TYPE EQU 070H ; START OF 8259 INTERRUPT TABLE LOCATION
  123. INT_VIDEO EQU 010H ; VIDEO VECTOR
  124. ;---------------------------------------------------------------------------
  125. TIMER EQU 40H
  126. TIM_CTL EQU 43H ; 8253 TIMER CONTROL PORT ADDR
  127. TIMER0 EQU 40H ; 8253 TIMER/CNTER 0 PORT ADDR
  128. TMINT EQU 01 ; TIMER 0 INTR RECVD MASK
  129. ;--------------------------------------------------------------------------
  130. DMA08 EQU 08 ; DMA STATUS REG PORT ADDR
  131. DMA EQU 00 ; DMA CH.0 ADDR. REG PORT ADDR
  132. ;--------------------------------------------------------------------------
  133. DMA18 EQU 0D0H ; 2ND DMA STATUS PORT ADDR
  134. DMA1 EQU 0C0H ; 2ND DMA CH.0 ADDR. REG PORT ADDR
  135. ;--------------------------------------------------------------------------
  136. DMA_PAGE EQU 81H ; START OF DMA PAGE REGISTERS
  137. LAST_DMA_PAGE EQU 8FH ; LAST DMA PAGE REGISTER
  138. ;--------------------------------------------------------------------------
  139. MAX_PERIOD EQU 540H
  140. MIN_PERIOD EQU 410H
  141. KBD_IN EQU 60H ; KEYBOARD DATA IN ADDR PORT
  142. KBDINT EQU 02 ; KEYBOARD INTR MASK
  143. KB_DATA EQU 60H ; KEYBOARD SCAN CODE PORT
  144. KB_CTL EQU 61H ; CONTROL BITS FOR KEYBOARD SENSE DATA
  145. KB_ERR EQU 80H ; KEYBOARD TRANSMIT ERROR FLAG
  146. ;----- SHIFT FLAG EQUATES WITHIN KB_FLAG
  147. INS_STATE EQU 80H ; INSERT STATE IS ACTIVE
  148. CAPS_STATE EQU 40H ; CAPS LOCK STATE HAS BEEN TOGGLED
  149. NUM_STATE EQU 20H ; NUM LOCK STATE HAS BEEN TOGGLED
  150. SCROLL_STATE EQU 10H ; SCROLL LOCK STATE HAS BEEN TOGGLED
  151. ALT_SHIFT EQU 08H ; ALTERNATE SHIFT KEY DEPRESSED
  152. CTL_SHIFT EQU 04H ; CONTROL SHIFT KEY DEPRESSED
  153. LEFT_SHIFT EQU 02H ; LEFT SHIFT KEY DEPRESSED
  154. RIGHT_SHIFT EQU 01H ; RIGHT SHIFT KEY DEPRESSED
  155. ;----- SHIFT FLAG EQUATES WITHIN KB_FLAG_1
  156. INS_SHIFT EQU 80H ; INSERT KEY IS DEPRESSED
  157. CAPS_SHIFT EQU 40H ; CAPS LOCK KEY IS DEPRESSED
  158. NUM_SHIFT EQU 20H ; NUM LOCK KEY IS DEPRESSED
  159. SCROLL_SHIFT EQU 10H ; SCROLL LOCK KEY IS DEPRESSED
  160. HOLD_STATE EQU 08H ; SUSPEND KEY HAS BEEN TOGGLED
  161. SYS_SHIFT EQU 04H ; SYSTEM KEY DEPRESSED AND HELD
  162. L_ALT_SHIFT EQU 02H ; LEFT ALT KEY DOWN RWV 8-28-85
  163. L_CTL_SHIFT EQU 01H ; LEFT CTL KEY DOWN RWV 8-28-85
  164. ;---------------FLAGS WITHIN KB_FLAG_2
  165. KB_ERR EQU 80H ; KEYBOARD TRANSMIT ERROR FLAG
  166. KB_PR_LED EQU 40H ; MODE INDICATOR UPDATE
  167. KB_FE EQU 20H ; RESEND RECEIVED FLAG
  168. KB_FA EQU 10H ; ACK RECEIVED
  169. CIRCUS_SYSTEM EQU 08H ; CIRCUS SYSTEM INDICATOR
  170. KB_LEDS EQU 07H ; KEYBOARD LED STATE BITS
  171. ; 04H ; CAPS LOCK INDICATOR
  172. ; 02H ; NUM LOCK INDICATOR
  173. ; 01H ; SCROLL LOCK INDICATOR
  174. ;---------------FLAGS WITHIN KB_FLAG_3
  175. RD_ID EQU 80H ; DOING A READ ID (MUST BE BIT0) AEV
  176. LC_AB EQU 40H ; LAST CHAR WAS FIRST ID CHAR AEV
  177. SET_NUM_LK EQU 20H ; FORCE NUM LOCK IF RD ID & KBX AEV
  178. KBX EQU 10H ; ENHANCED KEYBOARD INSTALLED RWV 7-18-85
  179. R_ALT_SHIFT EQU 08H ; RIGHT ALT KEY DOWN RWV 7-18-85
  180. GRAPH_ON EQU 08H ; ALT GRAPHICS KEY DOWN (WT ONLY) AEV
  181. R_CTL_SHIFT EQU 04H ; RIGHT CTL KEY DOWN RWV 7-18-85
  182. LC_E0 EQU 02H ; LAST CODE WAS THE E0 HIDDEN CODE RWV 7-18-85
  183. LC_E1 EQU 01H ; LAST CODE WAS THE E1 HIDDEN CODE RWV 7-18-85
  184. ;----- SCAN CODE EQUATES FOR THE KEYBOARD
  185. NUM_KEY EQU 69 ; SCAN CODE FOR NUMBER LOCK
  186. SCROLL_KEY EQU 70 ; SCAN CODE FOR SCROLL LOCK
  187. ALT_KEY EQU 56 ; SCAN CODE FOR ALTERNATE KEY
  188. CTL_KEY EQU 29 ; SCAN CODE FOR CONTROL KEY
  189. CAPS_KEY EQU 58 ; SCAN CODE FOR SHIFT LOCK
  190. LEFT_KEY EQU 42 ; SCAN CODE FOR LEFT SHIFT
  191. RIGHT_KEY EQU 54 ; SCAN CODE FOR RIGHT SHIFT
  192. INS_KEY EQU 82 ; SCAN CODE FOR INSERT KEY
  193. DEL_KEY EQU 83 ; SCAN CODE FOR DELETE KEY
  194. SYS_KEY EQU 84 ; SCAN CODE FOR SYSTEM KEY
  195. ;-------------- ENHANCED KEYBOARD EQUATES
  196. ID_1 EQU 0ABH ; 1ST ID CHAR FOR KBX
  197. ID_2 EQU 041H ; 2ND ID CHAR FOR KBX AEV
  198. ID_2A EQU 054H ; ALTERNATE 2ND ID CHAR FOR KBX RWV 8-16-85
  199. F11_M EQU 87 ; F11 KEY MAKE
  200. F12_M EQU 88 ; F12 KEY MAKE
  201. MC_E0 EQU 224 ; GENERAL MARKER CODE
  202. MC_E1 EQU 225 ; PAUSE KEY MARKER CODE
  203. ;-------------- DISKETTE EQUATES
  204. INT_FLAG EQU 080H ; INTERRUPT OCCURRENCE FLAG
  205. MOTOR_WAIT EQU 37 ; 2 SECS OF COUNTS FOR MOTOR TURN OFF
  206. TIME_OUT EQU 80H ; ATTACHMENT FAILED TO RESPOND
  207. BAD_SEEK EQU 40H ; SEEK OPERATION FAILED
  208. BAD_NEC EQU 20H ; NEC CONTROLLER HAS FAILED
  209. BAD_CRC EQU 10H ; BAD CRC ON DISKETTE READ
  210. DMA_BOUNDARY EQU 09H ; ATTEMPT TO DMA ACROSS 64K BOUNDARY
  211. BAD_DMA EQU 08H ; DMA OVERRUN ON OPERATION
  212. MEDIA_CHANGE EQU 06H ; MEDIA REMOVED ON DUAL ATTACH CARD
  213. RECORD_NOT_FND EQU 04H ; REQUESTED SECTOR NOT FOUND
  214. WRITE_PROTECT EQU 03H ; WRITE ATTEMPTED ON WRITE PROT DISK
  215. BAD_ADDR_MARK EQU 02H ; ADDRESS MARK NOT FOUND
  216. BAD_CMD EQU 01H ; BAD COMMAND PASSED TO DISKETTE I/O
  217. XRATE EQU 02H ; 250KBS DATA TRANSFER RATE
  218. DUAL EQU 01H ; DUAL ATTACH CARD PRESENT FLAG
  219. DSK_CHG EQU 080H ; DISKETTE CHANGE FLAG MASK BIT
  220. STATE_MSK EQU 007H ; USED TO STRIP OFF STATE OF MEDIA
  221. REV_STATE EQU 0F8H ; USED AS MASK FOR STATE BITS
  222. DETERMINED EQU 010H ; SET STATE DETERMINED IN STATE BITS
  223. TRAN_MSK EQU 03H ; ISOLATE SHIFTED TRANSFER RATE BITS
  224. DOUBLE_STEP EQU 020H ; MASK TO TURN ON DOUBLE STEPPING
  225. MOTOR_MSK EQU 0F0H ; MASK TO CLEAR MOTOR ON BITS
  226. MAX_DRV EQU 002H ; MAX NUMBER OF DRIVES
  227. ;HOME EQU 010H ; TRACK 0 MASK
  228. SENSE_DRV_ST EQU 004H ; SENSE DRIVE STATUS COMMAND
  229. ONE EQU 001H ; SEEK ONE TRACK
  230. TRK_SLAP EQU 030H ; CRASH STOP (48 TPI DRIVES)
  231. QUIET_SEEK EQU 00AH ; SEEK TO TRACK 10
  232. HD12_SETTLE EQU 015D ; 1.2 M HEAD SETTLE TIME
  233. HD320_SETTLE EQU 020D ; 320 K HEAD SETTLE TIME
  234. WRITE_OP EQU 080H ; WRITE OPERATION FLAG
  235. DD_MASK EQU 010H ; MASK TO INDICATE DRIVE IS 80 TRACKS
  236. PAGE
  237. ;------ DISK CHANGE LINE EQUATES
  238. NOCHGLN EQU 001H ; NO DISK CHANGE LINE AVAILABLE
  239. CHGLN EQU 002H ; DISK CHANGE LINE AVAILABLE
  240. ;------ MEDIA/DRIVE STATE INDICATORS
  241. M326D326 EQU 093H ; STATE MACHINE - 320/360 MEDIA/DRIVE
  242. M326D12 EQU 074H ; STATE MACHINE - 320/360 MEDIA,1.2DRIVE
  243. M12D12 EQU 015H ; STATE MACHINE - 1.2 MEDIA/DRIVE
  244. POA_DUAL EQU 061H ; 300K DATA TRANSFER RATE & STATE 1
  245. POA_START EQU 080H ; 250K DATA TRANSFER RATE & STATE 0
  246. TRK_80 EQU 008H ; DISKETTE DRIVE HAS 80 TRACKS
  247. ;------ CMOS NON-VOLATILE RAM EQUATES
  248. CMOSDSB_ADDR EQU 00EH ; DISKETTE STATUS BYTE ADDRESS
  249. CADR_PRT EQU 070H ; CMOS ADDRESS PORT ADDRESS
  250. CDATA_PRT EQU 071H ; CMOS DATA PORT ADDRESS
  251. CMOS_GOOD EQU 0C0H ; BATTERY AND CHECKSUM INDICATOR
  252. CMOSDSK_BYTE EQU 010H ; DISKETTE BYTE ADDRESS
  253. LOWNIB EQU 00FH ; ISOLATE LOW NIBBLE IN REGISTER MASK
  254. INVALID_DRV EQU 002H ; FIRST INVALID DISKETTE TYPE
  255. ;----------------------------------------
  256. ; TIMER DATA AREA :
  257. ;----------------------------------------
  258. ; COUNTS_SEC EQU 18
  259. ; COUNTS_MIN EQU 1092
  260. ; COUNTS_HOUR EQU 65543
  261. ; COUNTS_DAY EQU 1573040 = 1800B0H
  262. PAGE
  263.