home *** CD-ROM | disk | FTP | other *** search
/ io Programmo 23 / IOPROG_23.ISO / SOFT / ASM / SSD60.ZIP / SSD.DOC < prev    next >
Encoding:
Text File  |  1997-02-08  |  133.2 KB  |  2,959 lines

  1.                            
  2.  
  3.                            SERVILE SOFTWARE DECODER
  4.  
  5.  
  6.  
  7.  
  8.  
  9.                                   Version 6.0
  10.  
  11.  
  12.  
  13.  
  14.  
  15.  
  16.                          Shareware Version Disk Manual
  17.  
  18.  
  19.  
  20.  
  21.  
  22.  
  23. 2
  24.                                   DISCLAIMER
  25.  
  26.  
  27.  
  28. The Servile Software Decoder is supplied as a tool to assist in the reverse-
  29. engineering of IBM PC software, with special attention to computer viruses. 
  30. Because of the nature of the subject, no guarrantees can be made that a 
  31. program analysed with SSD will behave in the same manner when executed outside 
  32. of the SSD environment. 
  33.  
  34. Years of development and rigourous testing have gone into SSD, including 
  35. testing it on hundreds of Shareware, freeware and commercial programs, 
  36. including computer viruses. Some programs, by their nature, exhibit pecuiliar 
  37. behaviour when analysed with SSD which they do not exhibit otherwise. 
  38.  
  39. Use of SSD is at your own risk. The author accepts no liability in any form 
  40. and makes no guarrantees as to the suitability of this product for any purpose 
  41. what so ever. 
  42.  
  43. Please note that in particular some software may bypass SSD's safety measures 
  44. and could damage data or hardware. It is impossible to make a completely safe 
  45. environment for testing malicious software.
  46.  
  47. 3
  48.                                  INTRODUCTION
  49.  
  50.  
  51.  
  52.  
  53.  
  54. The Servile Software Decoder (SSD) is a powerful code and program analyser for 
  55. the IBM PC. SSD is neither a disassembler nor a debugger, although it shares 
  56. some similarities with both. Unlike a disassembler, SSD activately analyses 
  57. the code of a program, this allows SSD to analyse encrypted programs, unlike a 
  58. disassemler. Unlike a debugger, SSD interprets the program under analysis. 
  59. This has the advantage that SSD is safe to use with computer viruses as 
  60. dangerous commands are inhibited. It also implies that SSD is not prone to 
  61. anti-debugger instructions which are often contained in computer viruses. 
  62.  
  63. Because SSD interprets programs, rather than passing them straight to DOS for 
  64. execution, some programs may exhibit slightly different behaviour when 
  65. analysed than when executed. This is unfortunately unavoidable.
  66.  
  67. When SSD starts execution, or loads a new file, the PC interrupt vector table 
  68. is copied into memory. All subsequent reads and writes to the first 1024 bytes 
  69. of RAM (vector table) are then redirected to the SSD copy of the interrupt 
  70. vector table. This allows programs to think they have changed an interrupt  
  71. vector, but at the same time retains security by not changing the real vector.
  72.  
  73.  
  74. Execute            Record             Utility               File            Exit
  75.                                                                                 
  76. ╔═══════════Trace════════════╦════════════════════Analysis═════════════════════╗
  77. ║                            ║                                                 ║
  78. ║                            ║                                                 ║
  79. ║                            ║                                                 ║
  80. ║                            ║                                                 ║
  81. ║                       ╔════════════About═════════════╗                       ║
  82. ║                       ║   Servile Software Decoder   ║                       ║
  83. ║                       ║                              ║                       ║
  84. ║                       ║         Version 6.0          ║                       ║
  85. ║                       ║     (Shareware Version)      ║                       ║
  86. ║                       ║                              ║                       ║
  87. ║                       ║     Copyright (c)1996 by     ║                       ║
  88. ║                       ║                              ║                       ║
  89. ║                       ║       Servile Software       ║                       ║
  90. ║                       ╚══════════════════════════════╝                       ║
  91. ║                            ║                                                 ║
  92. ║                            ║                                                 ║
  93. ║                            ║                                                 ║
  94. ╠════════════════════════════╩═════════════════════════════════════════════════╣
  95. ║  AX  0000   BX  0000   CX  0000   DX  0000   SI  0000   DI  0000   BP  0000  ║
  96. ║  CS  53C8   DS  53B8   ES  53B8   SS  552C   SP  0080   IP  0000    0000000  ║
  97. ║                                                                     ZCSOAPD  ║
  98. ╚═════════Registers════════════════════════════════════════════════════════════╝
  99.  
  100. 4
  101.                                     DISPLAY
  102.  
  103.  
  104.  
  105. SSD uses two display pages. Page 0, the normal default DOS display page is 
  106. used for output from the program being analysed. Page 1 is used for the SSD 
  107. main display which is divided into the following component parts: Menu bar, 
  108. containing drop-down menus of facilities. Code window, which displays the 
  109. dissasembly of each instruction as it occurs. Analysis window, which displays 
  110. analysis information about the running program and also data dumps when 
  111. requested. And the registers window which displays the current contents of the 
  112. CPU registers as they appear to the program being analysed. 
  113.  
  114.  
  115.  
  116.  
  117. Execute            Record             Utility               File            Exit
  118.                                                                                 
  119. ╔═══════════Trace════════════╦════════════════════Analysis═════════════════════╗
  120. ║                            ║                                                 ║
  121. ║                            ║                                                 ║
  122. ║                            ║                                                 ║
  123. ║                            ║                                                 ║
  124. ║                            ║                                                 ║
  125. ║                            ║                                                 ║
  126. ║                            ║                                                 ║
  127. ║                            ║                                                 ║
  128. ║                            ║                                                 ║
  129. ║                            ║                                                 ║
  130. ║                            ║                                                 ║
  131. ║                            ║                                                 ║
  132. ║                            ║                                                 ║
  133. ║                            ║                                                 ║
  134. ║                            ║                                                 ║
  135. ║                            ║                                                 ║
  136. ║                            ║                                                 ║
  137. ╠════════════════════════════╩═════════════════════════════════════════════════╣
  138. ║  AX  0000   BX  0000   CX  0000   DX  0000   SI  0000   DI  0000   BP  0000  ║
  139. ║  CS  4B4B   DS  4B4B   ES  0000   SS  4C8D   SP  0200   IP  0100    0000000  ║
  140. ║  4B4B:0423  01 A5 12 48 00 E9                                       ZCSOAPD  ║
  141. ╚═════════Registers════════════════════════════════════════════════════════════╝
  142. 5
  143.                                   FACILITIES
  144.  
  145.  
  146. This section describes the various facilities available from the drop-down 
  147. menus. Each menu is tackled in turn, with the menu name shown in CAPITALS, 
  148. followed by the facilities available from that menu.
  149.  
  150.  
  151.  
  152. Execute:
  153.  
  154. The "Execute" menu provides access to the various facilities for "running" the 
  155. loaded program. In brief, the loaded program may be single stepped, run at 
  156. maximum speed or traced at three different speeds. A program which is being 
  157. either traced or run may be stopped by pressing the Esc key. When single 
  158. stepping a program each instruction is fetched and interpreted and then 
  159. execution pauses. You may then repeatedly press return whilst the "Step" 
  160. prompt is highlighted to facilitate single-stepping through the code.
  161.  
  162.  
  163. Execute            Record             Utility               File            Exit
  164. ╔════════╗                                                                      
  165. ║ Step   ║══Trace════════════╦════════════════════Analysis═════════════════════╗
  166. ║ Run    ║                   ║                                                 ║
  167. ║ Slow   ║                   ║                                                 ║
  168. ║ Medium ║                   ║                                                 ║
  169. ║ Fast   ║                   ║                                                 ║
  170. ╚════════╝                   ║                                                 ║
  171. ║                            ║                                                 ║
  172. ║                            ║                                                 ║
  173. ║                            ║                                                 ║
  174. ║                            ║                                                 ║
  175. ║                            ║                                                 ║
  176. ║                            ║                                                 ║
  177. ║                            ║                                                 ║
  178. ║                            ║                                                 ║
  179. ║                            ║                                                 ║
  180. ║                            ║                                                 ║
  181. ║                            ║                                                 ║
  182. ║                            ║                                                 ║
  183. ╠════════════════════════════╩═════════════════════════════════════════════════╣
  184. ║  AX  0000   BX  0000   CX  0000   DX  0000   SI  0000   DI  0000   BP  0000  ║
  185. ║  CS  53C8   DS  53B8   ES  53B8   SS  552C   SP  0080   IP  0000    0000000  ║
  186. ║                                                                     ZCSOAPD  ║
  187. ╚═════════Registers════════════════════════════════════════════════════════════╝
  188.  
  189.  
  190. 6
  191. Step:
  192.  
  193. Single step the loaded program. Only the next instruction is interpreted, and 
  194. then SSD returns to the Execute menu.
  195.  
  196. Run:
  197.  
  198. Run the program at maximum speed. SSD does not display the results of
  199. the analysis, but will echo all selected "trace" output analysis to the 
  200. selected file as normal. This allows a program to be executed at the fastest 
  201. possible speed and then the analysis may be reviewed later.
  202.  
  203. Slow:
  204.  
  205. Trace the program slowly. As each instruction is fetched and interpreted, it's 
  206. dissamembly and any resulting analysis are displayed along with the new 
  207. contents of all the registers. However, should the program be in a loop 
  208. command, only the effect upon the registers is displayed untill the loop 
  209. finishes. When looping the "trace" window will appear to pause, but the 
  210. "registers" window will be animated displaying the changes to the registers 
  211. during the loop (most commonly CX will increment or decrement by single 
  212. values).
  213.  
  214. Medium:
  215.  
  216. Trace the program fairly slowly. As each instruction is fetched and 
  217. interpreted, its dissamembly and analysis are displayed togther with the new 
  218. contents of all the registers. However, should the program be in a loop 
  219. command, only the effect upon the registers is displayed untill the loop 
  220. finishes. 
  221.  
  222. Fast:
  223.  
  224. Trace the program quickly. As each instruction is fetched and interpreted, its 
  225. dissamembly and analysis are displayed togther with the new contents of all 
  226. the registers. However, should the program be in a loop command, only the 
  227. effect upon the registers is displayed untill the loop finishes. 
  228.  
  229.  
  230. 7
  231. RECORD:
  232.  
  233. Toggle which trace and analysis details will be echoed to an output file. The 
  234. details are cumulative. Selecting an option low in the list will result in 
  235. details higher in the list also being recorded. Selecting the "Code & Regs" 
  236. option results in all trace and analysis details being recorded. 
  237.  
  238. A tick (√) appears next to the currently selected level of recording.
  239.  
  240. SSD requires you to enter a name of a file to which the details will be 
  241. echoed. If you want the details echoed to the printer directly, rather than 
  242. to a disk file, then enter the file name PRN. This can be useful for tracing 
  243. code which destroys the display, such as tracing interrupt 10h for example. 
  244. Notice that if the printer is switched off, off-line or out-of-paper SSD will 
  245. continue regardless, but nothing will be echoed to the printer until the 
  246. problem is resolved. 
  247.  
  248.  
  249. Execute            Record             Utility               File            Exit
  250.                    ╔══════════════╗                                             
  251. ╔═══════════Trace══║ √None        ║═══════════════Analysis═════════════════════╗
  252. ║                  ║  Analysis    ║                                            ║
  253. ║                  ║  Code        ║                                            ║
  254. ║                  ║  Code & Regs ║                                            ║
  255. ║                  ╚══════════════╝                                            ║
  256. ║                            ║                                                 ║
  257. ║                            ║                                                 ║
  258. ║                            ║                                                 ║
  259. ║                            ║                                                 ║
  260. ║                            ║                                                 ║
  261. ║                            ║                                                 ║
  262. ║                            ║                                                 ║
  263. ║                            ║                                                 ║
  264. ║                            ║                                                 ║
  265. ║                            ║                                                 ║
  266. ║                            ║                                                 ║
  267. ║                            ║                                                 ║
  268. ║                            ║                                                 ║
  269. ╠════════════════════════════╩═════════════════════════════════════════════════╣
  270. ║  AX  0000   BX  0000   CX  0000   DX  0000   SI  0000   DI  0000   BP  0000  ║
  271. ║  CS  53C8   DS  53B8   ES  53B8   SS  552C   SP  0080   IP  0000    0000000  ║
  272. ║                                                                     ZCSOAPD  ║
  273. ╚═════════Registers════════════════════════════════════════════════════════════╝
  274.                     The Record Menu (no recording selected)
  275.                                                                                 
  276.                                                                                 
  277. 8
  278. UTILITY:
  279.  
  280. Miscellaneous utility facilities.
  281.  
  282. About....: 
  283.  
  284. Displays information about SSD. After reading the information displayed, press 
  285. any key to remove the "about" window from the display. 
  286.  
  287. Change Regs:
  288.  
  289. Allows any register value to be changed. Highlight the required register, and 
  290. press return to enter a new value.
  291.  
  292. Trace Int:
  293.  
  294. Allows an interrupt to be specified instead of a program. To trace the 
  295. interrupt use the Execute facilities as for a program. (CS and IP are set to 
  296. the values stored in the appropriate interrupt vector). In effect, the ROM 
  297. code pointed to by the interrupt vector may be viewed like a COM file, but 
  298. rather than loading it with the "file" facility, you load it with the "Trace 
  299. Int." facility. SSD sets execution to commence at the start of the code - just 
  300. as it does when you load a program.
  301.  
  302. For Example; if you want to trace interrupt 10 you should first select the 
  303. Trace Int facility from the Utility menu and enter the number, in hexadecimal 
  304. notation, of the interrup to trace. In this case 10. Then set the registers to 
  305. any required values. Finally the interrupt may be called and traced with the 
  306. Execute facilities: Step, Slow etc.
  307.  
  308.  
  309. Dump:
  310.  
  311. Display the values in RAM at a specified segment:offset address. Registers may 
  312. be specified for the address, eg: es:di is a valid address. This facility is 
  313. typically used to view messages within encrypted programs, thus allowing the 
  314. true identity of encrypted computer viruses to be determined. You may also 
  315. like to execute an encrypted .COM program until it finishes decrypting and 
  316. then use the "write" facility to write the memory image to disk where from you 
  317. may view it using a hex disk editor.
  318.  
  319. Watch:
  320.  
  321. The Watch facility is similar Dump, but displays the six bytes at the 
  322. specified address. These bytes are reread and displayed as the program is 
  323. executed - like the register's display. This allows you to watch the values at 
  324. a specified memory address. The data is displayed as the segment:offset of the 
  325. address followed by each data byte in hexadecimal format.
  326.  
  327.  
  328. Output:
  329.  
  330. Display the program's output screen. Press a key to return to the analysis 
  331. screen.
  332.  
  333. 9
  334. Interrupts:
  335.  
  336. Displays the values recorded in the interrupt vector table (SSD's copy). The 
  337. listing is displayed onescreen page at a time. To continue the listing press 
  338. any key except the Esc key, pressing the Esc key will terminate the listing. 
  339.  
  340. 10
  341. Execute            Record             Utility               File            Exit
  342.                                       ╔═════════════╗                           
  343. ╔═══════════Trace════════════╦════════║ About....   ║lysis═════════════════════╗
  344. ║                            ║        ║ Change Regs ║                          ║
  345. ║                            ║        ║ Trace Int   ║                          ║
  346. ║                            ║        ║ Dump        ║                          ║
  347. ║                            ║        ║ Watch       ║                          ║
  348. ║                            ║        ║ Output      ║                          ║
  349. ║                            ║        ║ Interrupts  ║                          ║
  350. ║                            ║        ╚═════════════╝                          ║
  351. ║                            ║                                                 ║
  352. ║                            ║                                                 ║
  353. ║                            ║                                                 ║
  354. ║                            ║                                                 ║
  355. ║                            ║                                                 ║
  356. ║                            ║                                                 ║
  357. ║                            ║                                                 ║
  358. ║                            ║                                                 ║
  359. ║                            ║                                                 ║
  360. ║                            ║                                                 ║
  361. ╠════════════════════════════╩═════════════════════════════════════════════════╣
  362. ║  AX  0000   BX  0000   CX  0000   DX  0000   SI  0000   DI  0000   BP  0000  ║
  363. ║  CS  4B4B   DS  4B4B   ES  4B4B   SS  4C8D   SP  0200   IP  0100    0000000  ║
  364. ║                                                                     ZCSOAPD  ║
  365. ╚═════════Registers════════════════════════════════════════════════════════════╝
  366.  
  367. 11
  368. FILE:
  369.  
  370. The "File" menu provides facilities for opening and writing program files and 
  371. also for specifying command line arguments to be supplied to the program 
  372. under analysis. 
  373.  
  374. Open:
  375.  
  376. Allows you to specify a program to load and analyse. You may also specify the 
  377. name of a program on the command line when you start SSD, for example:
  378.  
  379.                                 SSD myprog.exe
  380.  
  381. Write:
  382.  
  383. Writes a memory image of the current .COM program to disk. As EXE files 
  384. are not binary images (they contain redirection code for example) they cannot 
  385. be written to disk and an error is reported if the loaded program is a .EXE 
  386. program and you try to write the memory image to disk. This facility is used 
  387. for decoding and unencrypting .COM files which may then be written to disk for 
  388. disassembly with more traditional tools such as "Sourcer" and "The Interactive 
  389. Disassembler". 
  390.  
  391.  
  392. 12
  393. Arguments:
  394.  
  395. Allows command line arguments to be specified. These are then passed to the 
  396. program being analysed. For example; if a program normally expects a command 
  397. line to include parameters, such as the DOS "type" command, as in 
  398.  
  399.                                TYPE myfile.doc
  400.  
  401. Then you may need to supply command line arguments to the program when 
  402. analysing it with SSD. This facility allows you to do this.
  403.  
  404.                                                                                 
  405. Execute            Record             Utility               File            Exit
  406.                                                             ╔═══════════╗       
  407. ╔═══════════Trace════════════╦════════════════════Analysis══║ Open      ║══════╗
  408. ║                            ║                              ║ Write     ║      ║
  409. ║                            ║                              ║ Arguments ║      ║
  410. ║                            ║                              ╚═══════════╝      ║
  411. ║                            ║                                                 ║
  412. ║                            ║                                                 ║
  413. ║                            ║                                                 ║
  414. ║                            ║                                                 ║
  415. ║                            ║                                                 ║
  416. ║                            ║                                                 ║
  417. ║                            ║                                                 ║
  418. ║                            ║                                                 ║
  419. ║                            ║                                                 ║
  420. ║                            ║                                                 ║
  421. ║                            ║                                                 ║
  422. ║                            ║                                                 ║
  423. ║                            ║                                                 ║
  424. ║                            ║                                                 ║
  425. ╠════════════════════════════╩═════════════════════════════════════════════════╣
  426. ║  AX  0000   BX  0000   CX  0000   DX  0000   SI  0000   DI  0000   BP  0000  ║
  427. ║  CS  53C8   DS  53B8   ES  53B8   SS  552C   SP  0080   IP  0000    0000000  ║
  428. ║                                                                     ZCSOAPD  ║
  429. ╚═════════Registers════════════════════════════════════════════════════════════╝
  430.                                  The File Menu
  431.  
  432. EXIT:
  433.  
  434. Returns to DOS. When you have finished analysing programs select this option 
  435. to exit SSD and return to the operating system.
  436. 13
  437.                                    USING SSD
  438.  
  439.  
  440. SSD may be started with an optional command line parameter describing a 
  441. program to be loaded and analysed. This program may include a path statement 
  442. such as:
  443.  
  444.                             SSD C:\TEST\MYPROG.EXE
  445.  
  446. Also the program need not be suffixed with the usual .EXE or .COM as required 
  447. by DOS. SSD will attempt to load and interpret any file specified, for 
  448. example:
  449.  
  450.                                SSD C:\MYBOOT.BIN
  451.  
  452. Will cause SSD to start and load the file "myboot.bin" from the root directory 
  453. of drive C. If this file is a valid binary image, such as a capture of a disk 
  454. boot sector program, then it may be traced and analysed with SSD.
  455.  
  456.  
  457. 14
  458.                                     EXAMPLE
  459.  
  460.  
  461. Tracing a boot sector virus:
  462.  
  463. In order to trace a boot sector virus one must first capture the boot sector 
  464. into a file, using a tool such as Servile Software's "Getboot" facility. The 
  465. created file may then be treated like a COM file.
  466.  
  467. For example. Say you have captured the ExeBug virus into a file named 
  468. "exebug.bin". This may then be traced through SSD as follows. First start SSD 
  469. with the command line: 
  470.  
  471.                                 SSD exebug.bin
  472.  
  473.  
  474. You may then use the step command to follow each command, as illustrated in 
  475. the following screen shots:
  476.  
  477. Execute            Record             Utility               File            Exit
  478.                                                                                 
  479. ╔═══════════Trace════════════╦════════════════════Analysis═════════════════════╗
  480. ║0100 jmp short 011E         ║                                                 ║
  481. ║                            ║                                                 ║
  482. ║                            ║                                                 ║
  483. ║                            ║                                                 ║
  484. ║                            ║                                                 ║
  485. ║                            ║                                                 ║
  486. ║                            ║                                                 ║
  487. ║                            ║                                                 ║
  488. ║                            ║                                                 ║
  489. ║                            ║                                                 ║
  490. ║                            ║                                                 ║
  491. ║                            ║                                                 ║
  492. ║                            ║                                                 ║
  493. ║                            ║                                                 ║
  494. ║                            ║                                                 ║
  495. ║                            ║                                                 ║
  496. ║                            ║                                                 ║
  497. ╠════════════════════════════╩═════════════════════════════════════════════════╣
  498. ║  AX  0000   BX  0000   CX  0000   DX  0000   SI  0000   DI  0000   BP  0000  ║
  499. ║  CS  507A   DS  507A   ES  507A   SS  507A   SP  FFFE   IP  011E    0000000  ║
  500. ║                                                                     ZCSOAPD  ║
  501. ╚═════════Registers════════════════════════════════════════════════════════════╝
  502.                                 Tracing ExeBug
  503.  
  504.  
  505. 15
  506. Execute            Record             Utility               File            Exit
  507.                                                                                 
  508. ╔═══════════Trace════════════╦════════════════════Analysis═════════════════════╗
  509. ║0100 jmp short 011E         ║                                                 ║
  510. ║011E xor ax,ax              ║                                                 ║
  511. ║                            ║                                                 ║
  512. ║                            ║                                                 ║
  513. ║                            ║                                                 ║
  514. ║                            ║                                                 ║
  515. ║                            ║                                                 ║
  516. ║                            ║                                                 ║
  517. ║                            ║                                                 ║
  518. ║                            ║                                                 ║
  519. ║                            ║                                                 ║
  520. ║                            ║                                                 ║
  521. ║                            ║                                                 ║
  522. ║                            ║                                                 ║
  523. ║                            ║                                                 ║
  524. ║                            ║                                                 ║
  525. ║                            ║                                                 ║
  526. ╠════════════════════════════╩═════════════════════════════════════════════════╣
  527. ║  AX  0000   BX  0000   CX  0000   DX  0000   SI  0000   DI  0000   BP  0000  ║
  528. ║  CS  507A   DS  507A   ES  507A   SS  507A   SP  FFFE   IP  0120    1000010  ║
  529. ║                                                                     ZCSOAPD  ║
  530. ╚═════════Registers════════════════════════════════════════════════════════════╝
  531.                                 Tracing ExeBug
  532.  
  533. Execute            Record             Utility               File            Exit
  534.                                                                                 
  535. ╔═══════════Trace════════════╦════════════════════Analysis═════════════════════╗
  536. ║0100 jmp short 011E         ║                                                 ║
  537. ║011E xor ax,ax              ║                                                 ║
  538. ║0120 mov ds,ax              ║                                                 ║
  539. ║0122 mov di,ax              ║                                                 ║
  540. ║0124 mov ss,ax              ║                                                 ║
  541. ║0126 mov sp,7C00            ║                                                 ║
  542. ║0129 mov cl,06              ║                                                 ║
  543. ║012B mov si,sp              ║                                                 ║
  544. ║012D mov bx,sp              ║                                                 ║
  545. ║012F les ax,[004C]          ║                                                 ║
  546. ║0133 mov [7CAD],ax          ║                                                 ║
  547. ║0136 mov ax,[0413]          ║                                                 ║
  548. ║0139 mov [7CAF],es          ║                                                 ║
  549. ║013D dec ax                 ║                                                 ║
  550. ║013E mov [0413],ax          ║                                                 ║
  551. ║0141 shl ax,cl              ║                                                 ║
  552. ║                            ║                                                 ║
  553. ╠════════════════════════════╩═════════════════════════════════════════════════╣
  554. ║  AX  9F80   BX  7C00   CX  0006   DX  0000   SI  7C00   DI  0000   BP  0000  ║
  555. ║  CS  507A   DS  0000   ES  08A9   SS  0000   SP  7C00   IP  0143    0011100  ║
  556. ║                                                                     ZCSOAPD  ║
  557. ╚═════════Registers════════════════════════════════════════════════════════════╝
  558.                                 Tracing ExeBug
  559.  
  560.  
  561. 16
  562. Execute            Record             Utility               File            Exit
  563.                                                                                 
  564. ╔═══════════Trace════════════╦════════════════════Analysis═════════════════════╗
  565. ║0122 mov di,ax              ║Set vector 13 segment to 0122:                   ║
  566. ║0124 mov ss,ax              ║                                                 ║
  567. ║0126 mov sp,7C00            ║                                                 ║
  568. ║0129 mov cl,06              ║                                                 ║
  569. ║012B mov si,sp              ║                                                 ║
  570. ║012D mov bx,sp              ║                                                 ║
  571. ║012F les ax,[004C]          ║                                                 ║
  572. ║0133 mov [7CAD],ax          ║                                                 ║
  573. ║0136 mov ax,[0413]          ║                                                 ║
  574. ║0139 mov [7CAF],es          ║                                                 ║
  575. ║013D dec ax                 ║                                                 ║
  576. ║013E mov [0413],ax          ║                                                 ║
  577. ║0141 shl ax,cl              ║                                                 ║
  578. ║0143 mov es,ax              ║                                                 ║
  579. ║0145 push ax                ║                                                 ║
  580. ║0146 mov [004C],0122        ║                                                 ║
  581. ║                            ║                                                 ║
  582. ╠════════════════════════════╩═════════════════════════════════════════════════╣
  583. ║  AX  9F80   BX  7C00   CX  0006   DX  0000   SI  7C00   DI  0000   BP  0000  ║
  584. ║  CS  507A   DS  0000   ES  9F80   SS  0000   SP  7BFE   IP  014C    0011100  ║
  585. ║                                                                     ZCSOAPD  ║
  586. ╚═════════Registers════════════════════════════════════════════════════════════╝
  587.             Tracing ExeBug - A crafty write to the BIOS disk vector
  588.  
  589.  
  590. Execute            Record             Utility               File            Exit
  591.                                                                                 
  592. ╔═══════════Trace════════════╦════════════════════Analysis═════════════════════╗
  593. ║0124 mov ss,ax              ║Set vector 13 segment to 0122:                   ║
  594. ║0126 mov sp,7C00            ║Set vector 13 offset to :9F80                    ║
  595. ║0129 mov cl,06              ║                                                 ║
  596. ║012B mov si,sp              ║                                                 ║
  597. ║012D mov bx,sp              ║                                                 ║
  598. ║012F les ax,[004C]          ║                                                 ║
  599. ║0133 mov [7CAD],ax          ║                                                 ║
  600. ║0136 mov ax,[0413]          ║                                                 ║
  601. ║0139 mov [7CAF],es          ║                                                 ║
  602. ║013D dec ax                 ║                                                 ║
  603. ║013E mov [0413],ax          ║                                                 ║
  604. ║0141 shl ax,cl              ║                                                 ║
  605. ║0143 mov es,ax              ║                                                 ║
  606. ║0145 push ax                ║                                                 ║
  607. ║0146 mov [004C],0122        ║                                                 ║
  608. ║014C mov [004E],ax          ║                                                 ║
  609. ║                            ║                                                 ║
  610. ╠════════════════════════════╩═════════════════════════════════════════════════╣
  611. ║  AX  9F80   BX  7C00   CX  0006   DX  0000   SI  7C00   DI  0000   BP  0000  ║
  612. ║  CS  507A   DS  0000   ES  9F80   SS  0000   SP  7BFE   IP  014F    0011100  ║
  613. ║                                                                     ZCSOAPD  ║
  614. ╚═════════Registers════════════════════════════════════════════════════════════╝
  615.             Tracing ExeBug - A crafty write to the BIOS disk vector
  616.  
  617.  
  618. 17
  619.                               INHIBITED COMMANDS
  620.  
  621.  
  622.  
  623. SSD inhibits all attempts to disable hardware by writing to I/O ports, 
  624. generation of audible tones, attempts to create new files, closing of the 
  625. standard files; stdin, stdout, stderr, stdaux and stdprn, write to disk and 
  626. disk formatting instructions. Instructions which attempt to write to memory 
  627. occupied by SSD are also rejected. 
  628.  
  629. Inhibiting operations allows a greater degree of safety when analysing 
  630. computer viruses, but has the disadvantage that subsequent program behaviour 
  631. may be altered in some circumstances.
  632.  
  633. SSD inhibits attempts to change the following interrupt vectors:
  634.  
  635. 08, 0A, 0B, 0C, 0D, 0E, 0F, 1C, 21, 24, 70
  636.  
  637. However, subsequent reads of these vectors will return a value as though the 
  638. change had occured.
  639. 18
  640.                                 DOS ERROR CODES
  641.  
  642.  
  643. DOS error codes are usually returned in the AX register following an abortive 
  644. DOS interrupt call, usually indicated by a set carry flag.
  645.  
  646.  
  647. Code    Meaning
  648.  
  649.  01     Invalid function
  650.  02     File not found
  651.  03     Path not found
  652.  04     No handles available
  653.  05     Access denied
  654.  06     Invalid handle
  655.  07     Memory control blocks destroyed
  656.  08     Insufficient memory
  657.  09     Invalid memory block address
  658.  0A     Invalid environment
  659.  0B     Invalid format
  660.  0C     Invalid access code
  661.  0D     Invalid data
  662.  0F     Invalid drive
  663.  10     Attempt to remove current directory
  664.  11     Not the same device
  665.  12     No more files
  666.  13     Disk write-protected
  667.  14     Unknown unit
  668.  15     Drive not ready
  669.  16     Unknown command
  670.  17     CRC error
  671.  18     Bad request structure length
  672.  19     Seek error
  673.  1A     Unknown media type
  674.  1B     Sector not found
  675.  1C     Out of paper
  676.  1D     Write fault
  677.  1E     Read fault
  678.  1F     General failure
  679.  20     Sharing violation
  680.  21     Lock violation
  681.  22     Invalid disk change
  682.  23     FCB unavailable
  683.  24     Sharing buffer overflow
  684.  
  685.  
  686.  
  687. 19
  688.                                   MEMORY MAP
  689.  
  690.  
  691. The following table describes the layout of conventional RAM (memory) within 
  692. the IBM PC and compatibles. Each address is shown in the format 
  693. segment:offset, as is conventional with Intel's approach to memory addressing 
  694. with the 8080 family of CPUs. 
  695.  
  696.  
  697.  
  698. 0000:0000               RAM
  699.                         Vector Table
  700.                         256 entries stored as segment word
  701.                                                offset word
  702.  
  703. 0040:0000               BIOS data area
  704.     :0000               Base I/O address of 1st serial I/O port, zero if none
  705.     :0002               Base I/O address of 2nd serial I/O port, zero if none
  706.     :0004               Base I/O address of 3rd serial I/O port, zero if none
  707.     :0006               Base I/O address of 4th serial I/O port, zero if none
  708.     :0008               Base I/O address of 1st parallel I/O port, zero if none
  709.     :000A               Base I/O address of 2nd parallel I/O port, zero if none
  710.     :000C               Base I/O address of 3rd parallel I/O port, zero if none
  711.     :000E               Base I/O address of 4th parallel port, zero if none
  712.                         Segment of Extended BIOS Data Segment (PS/2)
  713.     :0010               Installed hardware
  714.     :0012               POST status
  715.     :0013               Base memory size in kbytes (0-640)
  716.     :0015               Manufacturing test scratch pad
  717.     :0016               Manufacturing test scratch pad
  718.                         BIOS control flags (PS/2 mod 30)
  719.                         Keyclick loudness 00h-7Fh (Compaq Deskpro 386K)
  720.     :0017               Keyboard status flags 1
  721.     :0018               Keyboard status flags 2
  722.     :0019               Keyboard: Alt-nnn keypad workspace
  723.     :001A               Keyboard: ptr to next character in keyboard buffer
  724.     :001C               Keyboard: ptr to first free slot in keyboard buffer
  725.     :001E               Keyboard circular buffer 
  726.     :003E               Diskette recalibrate status
  727.     :003F               Diskette motor status
  728.     :0040               Diskette motor turn-off time-out count
  729.     :0041               Diskette last operation status
  730.     :0042               XT: command byte to hard disk controller
  731.                         AT: write precompensation cylinder number / 4
  732.     :0043               XT: bit 5 = drive number, bits 3-0=head number
  733.                         AT: sector count
  734.     :0044               XT: bits 6,7 = high bits of track, bits 5-0 = start 
  735.                             sector-1 
  736.                         AT: starting sector
  737.     :0045               low byte of track number
  738.     :0046               XT: sector count
  739.                         AT: high bits of track number
  740.     :0047               XT: control byte from HD parameters (step rate,...)
  741.                         AT: 101DHHHH, D=drive number, HHHH=head number
  742. 20
  743.     :0048               XT: INT 13 subfunction number
  744.                         AT: comand byte to hard disk controller
  745.     :0049               Current video mode
  746.     :004A               Video columns on screen
  747.     :004C               Video page (regen buffer) size in bytes
  748.     :004E               Video current page start address in regen buffer
  749.     :0050               Video cursor position (col, row) for eight pages
  750.     :0060               Video cursor type, hi=startline, lo=endline
  751.     :0062               Video current page number
  752.     :0063               Video CRT controller base address
  753.     :0065               Video current setting of mode select register 
  754.     :0066               Video current setting of CGA palette register 03D9h
  755.     :0067               POST real mode re-entry point after certain resets
  756.                         pointer to reset code upon system reset (PS/2 except 
  757.                         mod 25,30) with memory preserved 
  758.     :006B               POST last unexpected interrupt
  759.     :006C               Timer ticks since midnight
  760.     :0070               Timer overflow
  761.     :0071               Ctrl-Break flag
  762.     :0072               POST reset flag
  763.     :0074               Fixed disk last operation status, except ESDI drives
  764.     :0075               Number of fixed disk drives
  765.     :0076               Fixed disk control byte   
  766.     :0077               Fixed disk I/O port offset 
  767.     :0078               Parallel devices 1-3 time-out counters
  768.     :007B               parallel device 4 time-out counter (non-PS/2 and PS/2 
  769.                         Mod 25,30)
  770.     :007C               Serial devices 1-4 time-out counters
  771.     :0080               Keyboard buffer start as offset from segment 40h 
  772.     :0082               Keyboard buffer end+1 as offset from segment 40h 
  773.     :0084               Video EGA/MCGA/VGA rows on screen minus one
  774.     :0085               Video EGA/MCGA/VGA character height in scan-lines
  775.     :0087               Video EGA/VGA control
  776.     :0088               Video EGA/VGA switches
  777.     :0089               Video MCGA/VGA mode-set option control
  778.     :008A               Video MCGA/VGA index into Display Combination Code 
  779.                         table
  780.     :008B               Diskette media control (not XT)
  781.     :008C               Fixed disk controller status (not XT)
  782.     :008D               Fixed disk controller Error Status (not XT)
  783.     :008E               Fixed disk Interrupt Control (not XT)
  784.     :008F               Diskette controller information (not XT)
  785.     :0090               Diskette drive 0 media state
  786.     :0091               Diskette drive 1 media state
  787.     :0092               Diskette drive 0 media state at start of operation
  788.     :0093               Diskette drive 1 media state at start of operation
  789.     :0094               Diskette drive 0 current track number
  790.     :0095               Diskette drive 1 current track number
  791.     :0096               Keyboard status byte 1
  792.     :0097               Keyboard status byte 2
  793.     :0098               Timer2
  794.     :009C               Timer2
  795.     :00A0               Timer2
  796.     :00A1               LAN Support Program Interrupt Arbitrator present
  797. 21
  798.     :00A2               Reserved for network adapters
  799.     :00A4               Saved Fixed Disk Interrupt Vector (PS/2 Mod 30)
  800.     :00A8               Video: EGA/MCGA/VGA ptr to Video Save Pointer Table 
  801.     :00AC               Reserved
  802.     :00B0               Vendor specific
  803.     :00CE               Count of days since last boot
  804.     :00D0               Reserved
  805.     :00F0               Reserved for user
  806.     :0100               Print Screen Status byte
  807.     :010E               State of BREAK at start of BASICA.COM execution
  808.     :010F               BASICA v2.10 running flag
  809.     :0116               INT 1B at start of BASICA.COM execution
  810.     :011A               INT 24 at start of BASICA.COM execution
  811. 0040:011E               DOS kernel
  812. ????:????               Device drivers
  813. ????:????               Resident part of COMMAND.COM
  814. ????:????               FREE SPACE
  815. A000:0000               EGA/VGA Video RAM
  816. B000:0000               Video RAM
  817. C000:0000               EGA/VGA BIOS ROM extension      ) DOS
  818. C000:8000               Hard drive ROM extension        ) HIGH MEMORY
  819. E000:0000               Other BIOS ROM extensions       ) AREA
  820. F000:0000               BIOS ROM
  821.     :EFC7               Floppy disk parameters
  822.     :F0A4               Video hardware table
  823.     :FEF3               Initial interrupt vector table values
  824.     :FFF5               BIOS version date code
  825.     :FFFE               Model type 
  826.     :FFFF               Model sub type 
  827. 22
  828.                       XT, AT and PS/2  I/O port addresses
  829.  
  830.  
  831. This data is provided for the purpose of providing an understanding into the 
  832. nature of a program being analysed which accesses hardware ports. It is not 
  833. intended to describe how to program the IBM PC hardware ports since this can 
  834. lead to damage of the hardware. Note, although SSD has several safeguards 
  835. inbuilt to prevent programs carrying out harmful port writes, it is not 
  836. possible to catch all and a determined program may still damage your hardware 
  837. even when analysed with SSD. 
  838.  
  839.  
  840. "r" indicates port may be read. "w" indicates port may be written to 
  841. (programmed). "r/w" indicates that the port may be both read and written to. 
  842.  
  843. 0000-001F ----  DMA 1   (first Direct Memory Access controller 8237)
  844.  
  845. 0000    r/w     DMA channel 0 address    byte 0, then byte 1.
  846. 0001    r/w     DMA channel 0 word count byte 0, then byte 1.
  847. 0002    r/w     DMA channel 1 address    byte 0, then byte 1.
  848. 0003    r/w     DMA channel 1 word count byte 0, then byte 1.
  849. 0004    r/w     DMA channel 2 address    byte 0, then byte 1.
  850. 0005    r/w     DMA channel 2 word count byte 0, then byte 1.
  851. 0006    r/w     DMA channel 3 address    byte 0, then byte 1.
  852. 0007    r/w     DMA channel 3 word count byte 0, then byte 1.
  853.  
  854. 0008    r       DMA channel 0-3 status register
  855.                  bit 7 = 1  channel 3 request
  856.                  bit 6 = 1  channel 2 request
  857.                  bit 5 = 1  channel 1 request
  858.                  bit 4 = 1  channel 0 request
  859.                  bit 3 = 1  channel terminal count on channel 3
  860.                  bit 2 = 1  channel terminal count on channel 2
  861.                  bit 1 = 1  channel terminal count on channel 1
  862.                  bit 0 = 1  channel terminal count on channel 0
  863.  
  864. 0008    w       DMA channel 0-3 command register
  865.                  bit 7 = 1  DACK sense active high
  866.                        = 0  DACK sense active low
  867.                  bit 6 = 1  DREQ sense active high
  868.                        = 0  DREQ sense active low
  869.                  bit 5 = 1  extended write selection
  870.                        = 0  late write selection
  871.                  bit 4 = 1  rotating priority
  872.                        = 0  fixed priority
  873.                  bit 3 = 1  compressed timing
  874.                        = 0  normal timing
  875.                  bit 2 = 1  enable controller
  876.                        = 0  enable memory-to-memory
  877.  
  878. 0009    w       DMA write request register
  879.  
  880. 23
  881. 000A    r/w     DMA channel 0-3 mask register
  882.                  bit 7-3 = 0   reserved
  883.                  bit 2   = 0   clear mask bit
  884.                          = 1   set mask bit
  885.                  bit 1-0 = 00  channel 0 select
  886.                          = 01  channel 1 select
  887.                          = 10  channel 2 select
  888.                          = 11  channel 3 select
  889.  
  890. 000B    w       DMA channel 0-3 mode register
  891.                  bit 7-6 = 00  demand mode
  892.                          = 01  single mode
  893.                          = 10  block mode
  894.                          = 11  cascade mode
  895.                  bit 5   = 0   address increment select
  896.                          = 1   address decrement select
  897.                  bit 3-2 = 00  verify operation
  898.                          = 01  write to memory
  899.                          = 10  read from memory
  900.                          = 11  reserved
  901.                  bit 1-0 = 00  channel 0 select
  902.                          = 01  channel 1 select
  903.                          = 10  channel 2 select
  904.                          = 11  channel 3 select
  905.  
  906. 000C    w       DMA clear byte pointer flip-flop
  907. 000D    r       DMA read temporary register
  908. 000D    w       DMA master clear
  909. 000E    w       DMA clear mask register
  910. 000F    w       DMA write mask register
  911.  
  912.  
  913. 0010-001F ----  DMA controller (8237) on PS/2 model 60 & 80
  914.  
  915.  
  916. 0018    w       PS/2 extended function register
  917.  
  918. 001A            PS/2 extended function execute
  919.  
  920.  
  921. 0020-003F ----  PIC 1   (Programmable Interrupt Controller 8259)
  922.  
  923. 0020    w       PIC initialization command word ICW1
  924.                  bit 7-5 = 0  only used in 80/85 mode
  925.                  bit 4   = 1  ICW1 is being issued
  926.                  bit 3   = 0  edge triggered mode
  927.                          = 1  level triggered mode
  928.                  bit 2   = 0  successive interrupt vectors use 8 bytes
  929.                          = 1  successive interrupt vectors use 4 bytes
  930.                  bit 1   = 0  cascade mode
  931.                          = 1  single mode, no ICW3 needed
  932.                  bit 0   = 0  no ICW4 needed
  933.                          = 1  ICW4 needed
  934.  
  935. 24
  936. 0021    w       PIC  ICW2,ICW3,ICW4 after ICW1 to 0020
  937.                 ICW2:
  938.                  bit 7-3 = address lines A0-A3 of base vector address for PIC
  939.                  bit 2-0 = reserved
  940.                 ICW3:
  941.                  bit 7-0 = 0  slave controller not attached to corresponding
  942.                               interrupt pin
  943.                          = 1  slave controller attached to corresponding
  944.                               interrupt pin
  945.                 ICW4:
  946.                  bit 7-5 = 0  reserved
  947.                  bit 4   = 0  no special fully-nested mode
  948.                          = 1  special fully-nested mode
  949.                  bit 3-2 = 0x nonbuffered mode
  950.                          = 10 buffered mode/slave
  951.                          = 11 buffered mode/master
  952.                  bit 1   = 0  normal EOI
  953.                          = 1  Auto EOI
  954.                  bit 0   = 0  8085 mode
  955.                          = 1  8086/8088 mode
  956.  
  957. 0021    r/w     PIC master interrupt mask register
  958.                 OCW1:
  959.                  bit 7 = 0  enable parallel printer interrupt
  960.                  bit 6 = 0  enable diskette interrupt
  961.                  bit 5 = 0  enable fixed disk interrupt
  962.                  bit 4 = 0  enable serial port 1 interrupt
  963.                  bit 3 = 0  enable serial port 2 interrupt
  964.                  bit 2 = 0  enable video interrupt
  965.                  bit 1 = 0  enable keyboard, mouse, RTC interrupt
  966.                  bit 0 = 0  enable timer interrupt
  967.                 OCW2:
  968.                  bit 7-5 = 000  rotate in auto EOI mode (clear)
  969.                          = 001  nonspecific EOI
  970.                          = 010  no operation
  971.                          = 011  specific EOI
  972.                          = 100  rotate in auto EOI mode (set)
  973.                          = 101  rotate on nonspecific EOI command
  974.                          = 110  set priority command
  975.                          = 111  rotate on specific EOI command
  976.                  bit 4   = 0    reserved
  977.                  bit 3   = 0    reserved
  978.                  bit 2-0        interrupt request to which the command applies
  979.  
  980. 0020    r       PIC  interrupt request/in-service registers by OCW3
  981.                 request register:
  982.                  bit 7-0 = 0  no active request for the corresponding int. line
  983.                          = 1  active request for corresponding interrupt line
  984.                 in-service register:
  985.                  bit 7-0 = 0  corresponding line not currently being serviced
  986.                          = 1  corresponding int. line currently being serviced
  987.  
  988. 25
  989. 0020    w       PIC OCW3
  990.                  bit 7   = 0   reserved
  991.                  bit 6-5 = 0x  no operation
  992.                          = 10  reset special mask
  993.                          = 11  set special mask
  994.                  bit 4   = 0   reserved
  995.                  bit 3   = 1   reserved
  996.                  bit 2   = 0   no poll command
  997.                          = 1   poll command
  998.                  bit 1-0 = 0x  no operation
  999.                          = 10  read int.request register on next read at 0020
  1000.                          = 11  read int.in-service register on next read 0020
  1001.  
  1002.  
  1003. 0022-002B ----  Intel 82355, part of chipset for 386sx
  1004.                  initialisation in POST will disable these addresses,
  1005.                  only a hard reset will enable them again.
  1006.  
  1007. 0022    r/w     82335 MCR memory configuration register
  1008. 0024            82335 RC1 roll compare register
  1009. 0026            82335 RC2 roll compare register
  1010. 0028            82335 CC0 compare register
  1011. 002A            82335 CC1 compare register
  1012.  
  1013.                   values for CC0 and CC1:
  1014.                   00F9,0000  enable range compare CC0 0-512K  CC1 disable
  1015.                   00F1,0000  enable range compare CC0 0-1024K CC1 disable
  1016.                   00F1,10F9  enable range compare CC0 0-1M    CC1 1M-1M5
  1017.                   00E1,0000  enable range compare CC0 0-2M    CC1 disable
  1018.                   00E1,0000  enable range compare CC0 0-2M    CC1 disable
  1019.                   00C1,0000  enable range compare CC0 0-4M    CC1 disable
  1020.                   00C1,40E1  enable range compare CC0 0-4M    CC1 4M-6M
  1021.                   0081,0000  enable range compare CC0 0-8M    CC1 disable
  1022.  
  1023.  
  1024. 0040-005F ----  PIT  (Programmable Interrupt Timer  8253, 8254)
  1025.                  XT & AT uses 40-43    PS/2 uses 40, 42,43,44, 47
  1026.  
  1027. 0040    r/w     PIT  counter 0, counter divisor       (XT, AT, PS/2)
  1028. 0041    r/w     PIT  counter 1, RAM refresh counter   (XT, AT)
  1029. 0042    r/w     PIT  counter 2, cassette & speaker    (XT, AT, PS/2)
  1030.  
  1031. 26
  1032. 0043    r/w     PIT  mode port, control word register for counters 0-2
  1033.                  bit 7-6 = 00  counter 0 select
  1034.                          = 01  counter 1 select   (not PS/2)
  1035.                          = 10  counter 2 select
  1036.                  bit 5-4 = 00  counter latch command
  1037.                          = 01  read/write counter bits 0-7 only
  1038.                          = 10  read/write counter bits 8-15 only
  1039.                          = 11  read/write counter bits 0-7 first, then 8-15
  1040.                  bit 3-1 = 000 mode 0 select
  1041.                          = 001 mode 1 select - programmable one shot
  1042.                          = x10 mode 2 select - rate generator
  1043.                          = x11 mode 3 select - square wave generator
  1044.                          = 100 mode 4 select - software triggered strobe
  1045.                          = 101 mode 5 select - hardware triggered strobe
  1046.                  bit 0   = 0   binary counter 16 bits
  1047.                          = 1   BCD counter
  1048.  
  1049. 0044    r/w     PIT  counter 3 (PS/2, EISA)
  1050.                 used as fail-safe timer. generates an NMI on time out.
  1051.                 for user generated NMI see at 0462.
  1052.  
  1053. 0047    w       PIT  control word register counter 3 (PS/2, EISA)
  1054.                  bit 7-6 = 00  counter 3 select
  1055.                          = 01  reserved
  1056.                          = 10  reserved
  1057.                          = 11  reserved
  1058.                  bit 5-4 = 00  counter latch command counter 3
  1059.                          = 01  read/write counter bits 0-7 only
  1060.                          = 1x  reserved
  1061.                  bit 3-0 = 00
  1062.  
  1063. 0048            EISA
  1064. 004A            EISA
  1065. 004B            EISA
  1066.  
  1067.  
  1068. 27
  1069. 0060-006F ----  Keyboard controller (8041, 8042)  (or PPI (8255) on XT)
  1070.                  XT uses 60-63,  AT uses 60-64
  1071.  
  1072.                  AT keyboard controller input port bit definitions
  1073.                   bit 7   = 0  keyboard inhibited
  1074.                   bit 6   = 0  CGA, else MDA
  1075.                   bit 5   = 0  manufacturing jumper installed
  1076.                   bit 4   = 0  system RAM 512K, else 640K
  1077.                   bit 3-0      reserved
  1078.  
  1079.                  AT keyboard controller input port bit definitions by Compaq
  1080.                   bit 7   = 0  security lock is locked
  1081.                   bit 6   = 0  Compaq dual-scan display
  1082.                           = 1  non-Compaq display
  1083.                   bit 5   = 0  system board dip switch 5 is ON
  1084.                   bit 4   = 0  auto speed selected 
  1085.                           = 1  high speed selected
  1086.                   bit 3   = 0  slow (4MHz) 
  1087.                           = 1  fast (8MHz)
  1088.                   bit 2   = 0  80287 installed 
  1089.                           = 1  no NDP installed
  1090.                   bit 1-0      reserved
  1091.  
  1092.                  AT keyboard controller output port bit definitions
  1093.                   bit 7 =    keyboard data output
  1094.                   bit 6 =    keyboard clock output
  1095.                   bit 5 = 0  input buffer full
  1096.                   bit 4 = 0  output buffer empty
  1097.                   bit 3 =    reserved (see note)
  1098.                   bit 2 =    reserved (see note)
  1099.                   bit 1 =    gate A20
  1100.                   bit 0 =    system reset
  1101.                 Note:   bits 2 and 3 are the turbo speed switch or password
  1102.                           lock on Award/AMI/Phoenix BIOSes.  These bits make
  1103.                           use of nonstandard keyboard controller BIOS
  1104.                           functionality to manipulate
  1105.                             pin 23 (8041 port 22) as turbo switch for AWARD
  1106.                             pin 35 (8041 port 15) as turbo switch/pw lock for
  1107.                                 Phoenix
  1108.  
  1109. 0060    r/w     KB controller data port or keyboard input buffer (ISA, EISA)
  1110.                 should only be read from after status port bit0 = 1
  1111.                 should only be written to if status port bit1 = 0
  1112.                 keyboard commands (data goes also to port 0060):
  1113.                  ED     dbl   set/reset mode indicators Caps Num Scrl
  1114.                  EE     sngl  diagnostic echo. returns EE.
  1115.                  EF-F2  sngl  NOP (No OPeration). reserved for future use
  1116.                  F3     dbl   set typematic rate/delay
  1117.                  F4     sngl  enable keyboard
  1118.                  F5     sngl  disable keyboard. set default parameters
  1119.                  F6     sngl  set default parameters
  1120.                  F7-FD  sngl  NOP
  1121.                  FE     sngl  resend last scancode
  1122.                  FF     sngl  perform internal power-on reset function
  1123.  
  1124.  
  1125. 28
  1126. 0060    r       KeyBoard or KB controller data output buffer (via PPI on XT)
  1127.  
  1128. 0061    w       KB controller port B (ISA, EISA)   (PS/2 port A is at 0092)
  1129.                 system control port for compatibility with 8255
  1130.                  bit 7  (1= IRQ 0 reset )
  1131.                  bit 6-4    reserved
  1132.                  bit 3 = 1  channel check enable
  1133.                  bit 2 = 1  parity check enable
  1134.                  bit 1 = 1  speaker data enable
  1135.                  bit 0 = 1  timer 2 gate to speaker enable
  1136.  
  1137. 0061    r       KB controller port B control register (ISA, EISA)
  1138.                 system control port for compatibility with 8255
  1139.                  bit 7   parity check occurred
  1140.                  bit 6   channel check occurred
  1141.                  bit 5   mirrors timer 2 output condition
  1142.                  bit 4   toggles with each refresh request
  1143.                  bit 3   channel check status
  1144.                  bit 2   parity check status
  1145.                  bit 1   speaker data status
  1146.                  bit 0   timer 2 gate to speaker status
  1147.  
  1148. 0061    w       PPI  Programmable Peripheral Interface 8255 (XT only)
  1149.                 system control port
  1150.                  bit 7 = 1  clear keyboard
  1151.                  bit 6 = 0  hold keyboard clock low
  1152.                  bit 5 = 0  I/O check enable
  1153.                  bit 4 = 0  RAM parity check enable
  1154.                  bit 3 = 0  read low switches
  1155.                  bit 2      reserved, often used as turbo switch
  1156.                  bit 1 = 1  speaker data enable
  1157.                  bit 0 = 1  timer 2 gate to speaker enable
  1158.  
  1159. 0062    r/w     PPI (XT only)
  1160.                  bit 7 = 1  RAM parity check
  1161.                  bit 6 = 1  I/O channel check
  1162.                  bit 5 = 1  timer 2 channel out
  1163.                  bit 4      reserved 
  1164.                  bit 3 = 1  system board RAM size type 1
  1165.                  bit 2 = 1  system board RAM size type 2
  1166.                  bit 1 = 1  coprocessor installed
  1167.                  bit 0 = 1  loop in POST
  1168.  
  1169. 29
  1170. 0063    r/w     PPI (XT only) command mode register  (read dipswitches)
  1171.                  bit 7-6 = 00  1 diskette drive
  1172.                          = 01  2 diskette drives
  1173.                          = 10  3 diskette drives
  1174.                          = 11  4 diskette drives
  1175.                  bit 5-4 = 00  reserved
  1176.                          = 01  40*25 color (mono mode)
  1177.                          = 10  80*25 color (mono mode)
  1178.                          = 11  MDA 80*25
  1179.                  bit 3-2 = 00  256K (using 256K chips)
  1180.                          = 01  512K (using 256K chips)
  1181.                          = 10  576K (using 256K chips)
  1182.                          = 11  640K (using 256K chips)
  1183.                  bit 3-2 = 00  64K  (using 64K chips)
  1184.                          = 01  128K (using 64K chips)
  1185.                          = 10  192K (using 64K chips)
  1186.                          = 11  256K (using 64K chips)
  1187.                  bit 1-0       reserved
  1188.  
  1189. 0064    r       KB controller read status (ISA, EISA)
  1190.                  bit 7 = 1 parity error on transmission from keyboard
  1191.                  bit 6 = 1 receive timeout
  1192.                  bit 5 = 1 transmit timeout
  1193.                  bit 4 = 0 keyboard inhibit
  1194.                  bit 3 = 1 data in input register is command
  1195.                          0 data in input register is data
  1196.                  bit 2 = 0 system flag status 
  1197.                        = 0 power up or reset 
  1198.                        = 1 selftest OK
  1199.                  bit 1 = 1 input buffer full (input 60/64 has data for 8042)
  1200.                  bit 0 = 1 output buffer full (output 60 has data for system)
  1201.  
  1202. 0064    r        KB controller read status by Compaq
  1203.                  bit 7 = 1 parity error detected (11-bit format only). If an
  1204.                            error is detected, a Resend command is sent to the
  1205.                            keyboard once only, as an attempt to recover.
  1206.                  bit 6 = 1 receive timeout. transmission didn't finish in 2mS.
  1207.                  bit 5 = 1 transmission timeout error
  1208.                             bit 5,6,7  cause
  1209.                                 1 0 0  No clock
  1210.                                 1 1 0  Clock OK, no response
  1211.                                 1 0 1  Clock OK, parity error
  1212.                  bit 4 = 0 security lock engaged
  1213.                  bit 3 = 1 data in OUTPUT register is command
  1214.                          0 data in OUTPUT register is data
  1215.                  bit 2 = 0 system flag status 
  1216.                        = 0 power up or reset 
  1217.                        = 1 soft reset
  1218.                  bit 1 = 1 input buffer full (output 60/64 has data)
  1219.                  bit 0 = 0 no new data in buffer (input 60 has data)
  1220.  
  1221. 30
  1222. 0064    w       KB controller input buffer (ISA, EISA)
  1223.                 KB controller commands (data goes to port 0060):
  1224.                  20     read  read byte zero of internal RAM, this is the
  1225.                               last KB command send to 8041
  1226.                       Compaq  Put current command byte on port 0060
  1227.                                 command structure:
  1228.                                 bit 7   reserved
  1229.                                 bit 6 = 1 convert KB codes to 8086 scan codes
  1230.                                 bit 5 = 0 use 11-bit codes 
  1231.                                       = 1 use 8086 codes
  1232.                                 bit 4 = 0 enable keyboard 
  1233.                                       = 1 disable keyboard
  1234.                                 bit 3 = 1 ignore security lock state
  1235.                                 bit 2     this bit goes into bit2 status reg.
  1236.                                 bit 1 = 0 reserved
  1237.                                 bit 0 = 1 generate int. when output buffer full
  1238.                  21-3F  read  reads the byte specified in the lower 5 bits of
  1239.                               the command in the 8041's internal RAM
  1240.                  60-7F  dbl   writes the data byte to the address specified in
  1241.                               the 5 lower bits of the command.
  1242.  
  1243.                               Alternate description KB IO command 60 summary:
  1244.                                bit7 = 0 reserved
  1245.                                bit6 =   IBM PC compatibility mode
  1246.                                bit5 =   IBM PC mode
  1247.                                bit4 =   disable kb
  1248.                                bit3 =   inhibit override
  1249.                                bit2 =   system flag
  1250.                                bit1 = 0 reserved
  1251.                                bit0 =   enableoutput buffer full interrupt
  1252.  
  1253.                  60   Compaq  Load new command (60 to [64], command to [60])
  1254.                  A1   Compaq  unknown speedfunction 
  1255.                  A2   Compaq  unknown speedfunction 
  1256.                  A3   Compaq  Enable system speed control
  1257.                  A4   Compaq  Toggle speed
  1258.                  A5   Compaq  Special reed. the 8042 places the real values
  1259.                               of port 2 except for bits 4 and 5 wich are given
  1260.                               a new definition in the output buffer. No output
  1261.                               buffer full is generated.
  1262.                                 if bit 5 = 0, a 9-bit keyboard is in use
  1263.                                 if bit 5 = 1, an 11-bit keyboard is in use
  1264.                                 if bit 4 = 0, outp-buff-full interrupt disabled
  1265.                                 if bit 4 = 1, output-buffer-full int. enabled
  1266.                  A6   Compaq  unknown speedfunction 
  1267.                  AA     sngl  initiate self-test. will return 55 to data port
  1268.                       Compaq  Initializes ports 1 and 2, disables the keyboard
  1269.                               and clears the buffer pointers. It then places
  1270.                               55 in the output buffer.
  1271.                  AB     sngl  initiate interface test. result values:
  1272.                                0 = no error
  1273.                                1 = keyboard clock line stuck low
  1274.                                2 = keyboard clock line stuck high
  1275.                                3 = keyboard data line is stuck low
  1276. 31
  1277.                                4 = keyboard data line stuck high
  1278.                       Compaq   5 = Compaq diagnostic feature
  1279.                  AC     read  diagnostic dump. the contents of the 8041 RAM,
  1280.                               output port, input port, status word are send.
  1281.                  AD     sngl  disable keyboard (sets bit 4 of commmand byte)
  1282.                  AE     sngl  enable keyboard  (resets bit 4 of commmand byte)
  1283.                  AF     AWARD Enhanced Command: read keyboard version
  1284.                  C0     read  read input port
  1285.                       Compaq  Places status of input port in output buffer. use
  1286.                               this command only when the output buffer is empty
  1287.                  C1     AWARD Enhanced Command: poll input port Low nibble
  1288.                  C2     AWARD Enhanced Command: poll input port High nibble
  1289.                  D0     read  read output port
  1290.                       Compaq  Places byte in output port in output buffer. use
  1291.                               this command only when the output buffer is empty
  1292.                  D1     dbl   write output port. next byte written  to 0060
  1293.                               will be written to the 8041 output port
  1294.                       Compaq  The system speed bits are not set by this command
  1295.                               use commands A1-A6 (!) for speed functions.
  1296.                  D2     AWARD Enhanced Command: write keyboard output buffer
  1297.                  D3     AWARD Enhanced Command: write pointing device out.buf.
  1298.                  D4     AWARD Enhanced Command: write to auxiliary device
  1299.                  DD     sngl  disable address line A20. default in Real Mode
  1300.                  DF     sngl  enable address line A20
  1301.                  E0     read  read test inputs. bit0 = T0 and bit1 = T1
  1302.                  Exx    AWARD Enhanced Command: active output port
  1303.                  ED   Compaq  This is a two part command to control the state
  1304.                               of the NumLock CpasLock and ScrollLock LEDs
  1305.                               The second byte contains the state to set LEDs.
  1306.                                 bit 7-3    reserved. should be set to 0.
  1307.                                 bit 2 = 0  Caps Lock LED off
  1308.                                 bit 1 = 0  Num Lock LED off
  1309.                                 bit 0 = 0  Scroll Lock LED off
  1310.                  F0-FF  sngl  pulse output port low for 6 microseconds.
  1311.                               bits 0-3 contain the mask for the bits to be
  1312.                               pulsed. a bit is pulsed if its mask bit is zero.
  1313.                               bit0=system reset. Don't set to zero. Pulse only!
  1314.  
  1315. 0065    r       communications port (Olivetti M24)
  1316.  
  1317. 0068    w       HP-Vectra  control buffer (HP commands)
  1318. 0069    r       HP-Vectra  SVC (keyboard request SerViCe port)
  1319. 006A    w       HP-Vectra  clear processing, done
  1320.  
  1321. 006C-006F       HP-HIL  (Human Interface Link = async. serial inputs 0-7)
  1322.  
  1323.  
  1324. 0070-007F ----  CMOS RAM/RTC (Real Time Clock  MC146818)
  1325.  
  1326. 32
  1327. 0070    w       CMOS RAM index register port (ISA, EISA)
  1328.                  bit 7   = 1  NMI disabled
  1329.                          = 0  NMI enabled
  1330.                  bit 6-0      CMOS RAM index (64 bytes, sometimes 128 bytes)
  1331.  
  1332.                 any write to 0070 should be followed by an action to 0071
  1333.                 or the RTC wil be left in an unknown state.
  1334.  
  1335. 0071    r/w     CMOS RAM data port (ISA, EISA)
  1336.                 RTC registers:
  1337.                 00    current second in BCD
  1338.                 01    alarm second   in BCD
  1339.                 02    current minute in BCD
  1340.                 03    alarm minute   in BCD
  1341.                 04    current hour in BCD
  1342.                 05    alarm hour   in BCD
  1343.                 06    day of week  in BCD
  1344.                 07    day of month in BCD
  1345.                 08    month in BCD
  1346.                 09    year  in BCD (00-99)
  1347.                 0A    status register A
  1348.                        bit 7 = 1  update in progress
  1349.                        bit 6-4 divider that identifies the time-based
  1350.                                 frequency
  1351.                        bit 3-0 rate selection output  frequency and int. rate
  1352.                 0B    status register B
  1353.                        bit 7 = 0  run
  1354.                              = 1  halt
  1355.                        bit 6 = 1  enable periodic interrupt
  1356.                        bit 5 = 1  enable alarm interrupt
  1357.                        bit 4 = 1  enable update-ended interrupt
  1358.                        bit 3 = 1  enable square wave interrupt
  1359.                        bit 2 = 1  calendar is in binary format
  1360.                              = 0  calendar is in BCD format
  1361.                        bit 1 = 1  24-hour mode
  1362.                              = 0  12-hour mode
  1363.                        bit 0 = 1  enable daylight savings time. only in USA.
  1364.                                   useless in Europe. Some DOS versions clear
  1365.                                   this bit when you use the DAT/TIME command.
  1366.                 0C    status register C
  1367.                        bit 7 =    interrupt request flag
  1368.                        bit 6 =    peridoc interrupt flag
  1369.                        bit 5 =    alarm interrupt flag
  1370.                        bit 4 =    update interrupt flag
  1371.                        bit 3-0    reserved
  1372.                 0D    status register D
  1373.                        bit 7 = 1  Real-Time Clock has power
  1374.                        bit 6-0    reserved
  1375.                 0E    diagnostics status byte
  1376.                        bit 7 = 0  RTC lost power
  1377.                        bit 6 = 1  CMOS RAM checksum bad
  1378.                        bit 5 = 1  invalid configuration information at POST
  1379.                        bit 4 = 1  memory size error at POST
  1380.                        bit 3 = 1  fixed disk/adapter failed initialization
  1381. 33
  1382.                        bit 2 = 1  CMOS RAM time found invalid
  1383.                        bit 1 = 1  adapters do not match configuration (EISA)
  1384.                        bit 0 = 1  time out reading an adapter ID (EISA)
  1385.                 0F    shutdown status byte
  1386.                        00 = normal execution of POST
  1387.                        01 = chip set initialization for real mode reentry
  1388.                        04 = jump to bootstrap code
  1389.                        05 = issue an EOI an JMP to Dword ptr at 40:67
  1390.                        06 = JMP to Dword ptrv at 40:67 without EOI
  1391.                        07 = return to INT15/87 (block move)
  1392.                        08 = return to POST memory test
  1393.                        09 = return to INT15/87 (block move)
  1394.                        0A = JMP to Dword ptr at 40:67 without EOI
  1395.                        0B = return IRETS through 40:67
  1396.                 10    diskette drive type for A: and B:
  1397.                        bit 7-4  drive type of drive 0
  1398.                        bit 3-0  drive type of drive 1
  1399.                                = 0000      no drive
  1400.                                = 0001      360K
  1401.                                = 0010      1M2
  1402.                                = 0011      720K
  1403.                                = 0100      1M44
  1404.                                = 0101-1111 reserved
  1405.                 11    reserved / AMI Extended CMOS setup (AMI Hi-Flex BIOS)
  1406.                        bit 7   = 1     Typematic Rate Programming
  1407.                        bit 6-5 = 00    Typematic Rate Delay 250 mSec
  1408.                        bit 4-0 = 00011 Typematic Rate 21.8 Chars/Sec
  1409.                 12    fixed disk drive type for drive 0 and drive 1
  1410.                        bit 7-4  drive type of drive 0
  1411.                        bit 3-0  drive type of drive 1
  1412.                                 if either of the nibbles equals 0F, then bytes
  1413.                                 19 an 1A are valid
  1414.                 13    reserved / AMI Extended CMOS setup (AMI Hi-Flex BIOS)
  1415.                        bit 7 = 1  Mouse Support Option
  1416.                        bit 6 = 1  Above 1 MB Memory Test disable
  1417.                        bit 5 = 1  Memory Test Tick Sound disable
  1418.                        bit 4 = 1  Memory Parity Error Check enable
  1419.                        bit 3 = 1  Hit <ESC> Message Display disabled
  1420.                        bit 2 = 1  Hard Disk Type 47 Data Area at address 0:300
  1421.                        bit 1 = 1  Wait For <F1> If Any Error enabled
  1422.                        bit 0 = 1  System Boot Up Num Lock is On
  1423.                 14    equipment byte
  1424.                        bit 7-6   diskette drives installed
  1425.                                = 00  1 drive installed
  1426.                                = 01  2 drives installed
  1427.                                = 10  reserved
  1428.                                = 11  reserved
  1429.                        bit 5-4   primary display
  1430.                                = 00  adapter card with option ROM 
  1431.                                = 01  40*25 color
  1432.                                = 10  80*25 color
  1433.                                = 11  monochrome
  1434.                        bit 3-2   reserved
  1435.                        bit 1   = 1  coprocessor installed (non-Weitek)
  1436. 34
  1437.                        bit 0        diskette drive avaliable for boot
  1438.                 15    LSB of systemn base memory in Kb
  1439.                 16    MSB of systemn base memory in Kb
  1440.                 17    LSB of total extended memory in Kb
  1441.                 18    MSB of total extended memory in Kb
  1442.                 19    drive C extension byte
  1443.                 1A    drive D extension byte
  1444.                 1B-27 reserved
  1445.                 1B/1C word to 82335 RC1 roll compare register at [24]
  1446.                       (Phoenix)
  1447.                 1D/1E word to 82335 RC2 roll compare register at [26]
  1448.                       (Phoenix)
  1449.                 28    HP-Vectra checksum over 29-2D
  1450.                 29-2D reserved
  1451.                 29/2A word to Intel 82335 CC0 compare register at [28]
  1452.                       (Phoenix)
  1453.                 2B/2C word send to 82335 CC1 compare register at [2A]
  1454.                       (Phoenix)
  1455.                 2D    AMI Extended CMOS setup (AMI Hi-Flex BIOS)
  1456.                       (Phoenix BIOS checks for the values AA or CC)
  1457.                        bit 7 = 1  Weitek Processor Absent
  1458.                        bit 6 = 1  Floppy Drive Seek At Boot disabled
  1459.                        bit 5 = 1  System Boot Up Sequence  C:, A:
  1460.                        bit 4 = 1  System Boot Up Speed is high
  1461.                        bit 3 = 1  Cache Memory enabled
  1462.                        bit 2 = 1  Internal Cache Memory  <1>
  1463.                        bit 1-0    reserved
  1464.                 2E    CMOS MSB checksum over 10-2D
  1465.                 2F    CMOS LSB checksum over 10-2D
  1466.                 30    LSB of extended memory found above 1Mb at POST
  1467.                 31    MSB of extended memory found above 1Mb at POST
  1468.                 32    date century in BCD
  1469.                 33    information flags
  1470.                        bit4 = bit4 from CPU register CR0   (Phoenix)
  1471.                               this bit is only known as INTEL RESERVED
  1472.                 34-3F reserved  
  1473.                 34     bit4 bit5 (Phoenix BIOS)
  1474.                 3D/3E word to 82335 MCR memory config register at [22]
  1475.                       (Phoenix)
  1476.                 3D     bit3      base memsize 512/640  (Phoenix)
  1477.                 3E     bit7 = 1  relocate enable       (Phoenix)
  1478.                        bit1 = 1  shadow video enable   (Phoenix)
  1479.                        bit0 = 1  shadow BIOS enable    (Phoenix)
  1480.  
  1481.  
  1482.                 User Definable Drive Parameters are also stored in CMOS RAM:
  1483.  
  1484.                 AMI (386sx BIOS 1989) first user definable drive (type 47)
  1485.                  1B  L cylinders
  1486.                  1C  H cylinders
  1487.                  1D  heads
  1488.                  1E  L Write Precompensation Cylinder
  1489.                  1F  H Write Precompensation Cylinder
  1490.                  20  ??
  1491. 35
  1492.                  21  L cylinders parking zone
  1493.                  22  H cylinders parking zone
  1494.                  23  sectors
  1495.  
  1496.                 AMI (386sx BIOS 1989) second user definable drive (type 48)
  1497.                  24  L cylinders
  1498.                  25  H cylinders
  1499.                  26  heads
  1500.                  27  L Write Precompensation Cylinder
  1501.                  28  H Write Precompensation Cylinder
  1502.                  29  ??
  1503.                  2A  L cylinders parking zone
  1504.                  2B  H cylinders parking zone
  1505.                  2C  sectors
  1506.  
  1507.                 Phoenix (386BIOS v1.10.03 1988) 1st user definable drv (type48)
  1508.                  20  L cylinders
  1509.                  21  H cylinders
  1510.                  22  heads
  1511.                  23  L Write Precompensation Cylinder
  1512.                  24  H Write Precompensation Cylinder
  1513.                  25  L cylinders parking zone
  1514.                  26  H cylinders parking zone
  1515.                  27  sectors
  1516.  
  1517.                 Phoenix (386BIOS v1.10.03 1988) 2nd user definable drv (type49)
  1518.                 (when PS/2-style password option is not used)
  1519.                  35  L cylinders
  1520.                  36  H cylinders
  1521.                  37  heads
  1522.                  38  L Write Precompensation Cylinder
  1523.                  39  H Write Precompensation Cylinder
  1524.                  3A  L cylinders parking zone
  1525.                  3B  H cylinders parking zone
  1526.                  3C  sectors
  1527.  
  1528. 0078            HP-Vectra  Hard Reset: NMI enable/disable
  1529.                  bit 7 = 0  disable & clear hard reset from HP-HIL controller
  1530.                        = 1  enable hard reset from HP-HIL controller chip
  1531.                  bit 6-0    reserved
  1532.  
  1533.  
  1534. 007C-007D ----  HP-Vectra  PIC 3   (Programmable Interrupt Controller 8259)
  1535.                 cascaded to first controller.
  1536.                 used for keyboard and input device interface.
  1537. 007C    r/w     HP-Vectra  PIC 3  see at 0020  PIC 1
  1538. 007D    r/w     HP-Vectra  PIC 3  see at 0021  PIC 1
  1539.  
  1540.  
  1541. 0080    w       Manufacturing Diagnostics port
  1542.  
  1543.  
  1544. 36
  1545. 0080-008F ----  DMA page registers   (74612)
  1546.  
  1547. 0080    r/w     extra page register (temporary storage)
  1548. 0081    r/w     DMA channel 2 address byte 2
  1549. 0082    r/w     DMA channel 3 address byte 2
  1550. 0083    r/w     DMA channel 1 address byte 2
  1551. 0084    r/w     extra page register
  1552. 0085    r/w     extra page register
  1553. 0086    r/w     extra page register
  1554. 0087    r/w     DMA channel 0 address byte 2
  1555. 0088    r/w     extra page register
  1556. 0089    r/w     DMA channel 6 address byte 2
  1557. 0089    r/w     DMA channel 7 address byte 2
  1558. 0089    r/w     DMA channel 5 address byte 2
  1559. 008C    r/w     extra page register
  1560. 008D    r/w     extra page register
  1561. 008E    r/w     extra page register
  1562. 008F    r/w     DMA refresh page register
  1563.  
  1564.  
  1565. 0090-009F ----  PS/2 POS (Programmable Option Select)
  1566.  
  1567. 0090            Central arbitration control port
  1568. 0091            Card selection feedback
  1569.  
  1570. 0092    r/w     PS/2 system control port A  (port B is at 0061)
  1571.                  bit 7-6   any bit set to 1 turns activity light on
  1572.                  bit 5     reserved
  1573.                  bit 4 = 1 watchdog timout occurred 
  1574.                  bit 3 = 0 RTC/CMOS security lock (on password area) unlocked
  1575.                        = 1 CMOS locked (done by POST)
  1576.                  bit 2     reserved
  1577.                  bit 1 = 1 indicates A20 active
  1578.                  bit 0 = 0 system reset or write
  1579.                          1 pulse alternate reset pin (alternate CPU reset)
  1580.  
  1581. 0094    w       system board enable/setup register
  1582.                  bit 7 = 1  enable functions
  1583.                        = 0  setup functions
  1584.                  bit 5 = 1  enables VGA
  1585.                        = 0  setup VGA
  1586.  
  1587. 0095            reserved
  1588.  
  1589. 0096    w       adapter enable /setup register
  1590.                  bit 3 = 1  setup adapters
  1591.                        = 0  enable registers
  1592.  
  1593. 0097            reserved
  1594.  
  1595.  
  1596. 37
  1597. 00A0-00AF ----  PIC 2   (Programmable Interrupt Controller 8259)
  1598.  
  1599. 00A0    r/w     NMI mask register (XT)
  1600.  
  1601. 00A0    r/w     PIC 2  same as 0020 for PIC 1
  1602. 00A1    r/w     PIC 2  same as 0021 for PIC 1 except for OCW1:
  1603.                  bit 7 = 0  reserved
  1604.                  bit 6 = 0  enable fixed disk interrupt
  1605.                  bit 5 = 0  enable coprocessor exception interrupt
  1606.                  bit 4 = 0  enable mouse interrupt
  1607.                  bit 3 = 0  reserved
  1608.                  bit 2 = 0  reserved
  1609.                  bit 1 = 0  enable redirect cascade
  1610.                  bit 0 = 0  enable real-time clock interrupt
  1611.  
  1612.  
  1613. 00C0      ----  TI  SN746496 programmable tone/noise generator  PCjr
  1614.  
  1615.  
  1616. 00C0-00DF ----  DMA 2   (second Direct Memory Access controller 8237)
  1617.  
  1618. 00C0    r/w     DMA channel 4 memory address bytes 1 and 0 (low) (ISA, EISA)
  1619. 00C2    r/w     DMA channel 4 transfer count bytes 1 and 0 (low) (ISA, EISA)
  1620. 00C4    r/w     DMA channel 5 memory address bytes 1 and 0 (low) (ISA, EISA)
  1621. 00C6    r/w     DMA channel 5 transfer count bytes 1 and 0 (low) (ISA, EISA)
  1622. 00C8    r/w     DMA channel 6 memory address bytes 1 and 0 (low) (ISA, EISA)
  1623. 00CA    r/w     DMA channel 6 transfer count bytes 1 and 0 (low) (ISA, EISA)
  1624. 00CC    r/w     DMA channel 7 memory address byte 0 (low), then 1 (ISA, EISA)
  1625. 00CE    r/w     DMA channel 7 transfer count byte 0 (low), then 1 (ISA, EISA)
  1626.  
  1627. 00D0    r       DMA channel 4-7 status register (ISA, EISA)
  1628.                  bit 7 = 1  channel 7 request
  1629.                  bit 6 = 1  channel 6 request
  1630.                  bit 5 = 1  channel 5 request
  1631.                  bit 4 = 1  channel 4 request
  1632.                  bit 3 = 1  terminal count on channel 7
  1633.                  bit 2 = 1  terminal count on channel 6
  1634.                  bit 1 = 1  terminal count on channel 5
  1635.                  bit 0 = 1  terminal count on channel 4
  1636.  
  1637. 00D0    w       DMA channel 4-7 command register (ISA, EISA)
  1638.                  bit 7 = 1  DACK sense active high
  1639.                        = 0  DACK sense active low
  1640.                  bit 6 = 1  DREQ sense active high
  1641.                        = 0  DREQ sense active low
  1642.                  bit 5 = 1  extended write selection
  1643.                        = 0  late write selection
  1644.                  bit 4 = 1  rotating priority
  1645.                        = 0  fixed priority
  1646.                  bit 3 = 1  compressed timing
  1647.                        = 0  normal timing
  1648.                  bit 2 = 0  enable controller
  1649.                  bit 1 = 1  enable memory-to-memory transfer
  1650.                  bit 0      .....
  1651.  
  1652. 38
  1653. 00D2    w       DMA channel 4-7 write request register (ISA, EISA)
  1654.  
  1655. 00D4    w       DMA channel 4-7 write single mask register (ISA, EISA)
  1656.                  bit 7-3      reserved
  1657.                  bit 2   = 0  clear mask bit
  1658.                          = 1  set mask bit
  1659.                  bit 1-0 = 00 channel 4 select
  1660.                          = 01 channel 5 select
  1661.                          = 10 channel 6 select
  1662.                          = 11 channel 7 select
  1663.  
  1664. 00D6    w       DMA channel 4-7 mode register (ISA, EISA)
  1665.                  bit 7-6 = 00  demand mode
  1666.                          = 01  single mode
  1667.                          = 10  block mode
  1668.                          = 11  cascade mode
  1669.                  bit 5   = 0   address increment select
  1670.                          = 1   address decrement select
  1671.                  bit 4   = 0   autoinitialisation disable
  1672.                          = 1   autoinitialisation enable
  1673.                  bit 3-2 = 00  verify operation
  1674.                          = 01  write to memory
  1675.                          = 10  read from memory
  1676.                          = 11  reserved
  1677.                  bit 1-0 = 00  channel 4 select
  1678.                          = 01  channel 5 select
  1679.                          = 10  channel 6 select
  1680.                          = 11  channel 7 select
  1681.  
  1682. 00D8    w       DMA channel 4-7 clear byte pointer flip-flop (ISA, EISA)
  1683. 00DA    r       DMA channel 4-7 read temporary register (ISA, EISA)
  1684. 00DA    w       DMA channel 4-7 master clear (ISA, EISA)
  1685. 00DC    w       DMA channel 4-7 clear mask register (ISA, EISA)
  1686. 00DE    w       DMA channel 4-7 write mask register (ISA, EISA)
  1687.  
  1688. 00E0            split address register, memory encoding registers PS/2m80 only
  1689.  
  1690.  
  1691. 00F0-00F5 ----  PCjr Disk Controller
  1692.  
  1693. 00F0            disk controller
  1694. 00F2            disk controller control port
  1695. 00F4            disk controller status register
  1696. 00F5            disk controller data port
  1697.  
  1698.  
  1699. 00F0-00FF ----  coprocessor (8087..80387)
  1700.  
  1701. 00F0            math coprocessor clear busy latch
  1702. 00F1            math coprocessor reset
  1703. 00F8-00FF       math coprocessor
  1704.  
  1705.  
  1706. 0100-010F ----  CompaQ Tape drive adapter. alternate address at 0300
  1707.  
  1708.  
  1709. 39
  1710. 0100-0107 ----  PS/2 POS (Programmable Option Select)
  1711.  
  1712. 0100    r       POS register 0  Low adapter ID byte
  1713. 0101    r       POS register 1  High adapter ID byte
  1714.  
  1715. 0102    r/w     POS register 2  option select data byte 1
  1716.                  bit 0 is card enable (CDEN)
  1717.  
  1718. 0103    r/w     POS register 3  option select data byte 2
  1719. 0104    r/w     POS register 4  option select data byte 3
  1720. 0105    r/w     POS register 5  option select data byte 4
  1721.                  bit 7  channel active (-CHCK)
  1722.                  bit 6  channel status
  1723.  
  1724. 0106    r/w     POS register 6  Low subaddress extension
  1725. 0107    r/w     POS register 7  High subaddress extension
  1726.  
  1727.  
  1728. 0108-010F ----  8 digit LED info panel on IBM PS/2
  1729.  
  1730. 010F    w       leftmost character on display
  1731. 010E    w       second character
  1732. ....    w
  1733. 0108    w       eighth character
  1734.  
  1735.  
  1736. 0130-013F ----  CompaQ SCSI adapter. alternate address at 0330
  1737.  
  1738.  
  1739. 0130-0133 ----  Adaptec 154xB/154xC SCSI adapter.
  1740.                 alternate address at 0134, 0230, 0234 ,0330 and 0334
  1741.  
  1742.  
  1743. 0134-0137 ----  Adaptec 154xB/154xC SCSI adapter.
  1744.                 alternate address at 0130, 0230, 0234 ,0330 and 0334
  1745.  
  1746.  
  1747. 0140-014F ----  SCSI (alternate Small Computer System Interface) adapter
  1748.                 (1st at 0340-034F)
  1749.  
  1750.  
  1751. 0140-0157 ----  RTC (alternate Real Time Clock for XT)   (1st at 0340-0357)
  1752.  
  1753.  
  1754. 0170-0177 ----  HDC 2   (2nd Fixed Disk Controller)   same as 01Fx (ISA, EISA)
  1755.  
  1756.  
  1757. 01E8-01EF ----  System Control. Laptop chipset: Headland HL21 & Acer M5105
  1758.  
  1759. 01ED    r/w     select internal register. Data to/from 01EF
  1760. 01EE    r
  1761. 01EF    r/w     reg.
  1762.                 5  = 1000xxxx  for low CPU clock speed (4MHz on Morse/Mitac)
  1763.                    = 0xxxxxxx  for high CPU clock speed (16MHz on Morse/Mitac)
  1764.  
  1765.  
  1766. 40
  1767. 01F0-01F7 ----  HDC 1   (1st Fixed Disk Controller)   same as 017x (ISA, EISA)
  1768.  
  1769. 01F0    r/w     data register
  1770.  
  1771. 01F1    r       error register
  1772.                 diagnostic mode errors:
  1773.                  bit 7-3        reserved
  1774.                  bit 2-1 = 001  no error detected
  1775.                          = 010  formatter device error
  1776.                          = 011  sector buffer error
  1777.                          = 100  ECC circuitry error
  1778.                          = 101  controlling microprocessor error
  1779.                  operation mode:
  1780.                   bit 7  = 1  bad block detected
  1781.                          = 0  block OK
  1782.                   bit 6  = 1  uncorrectable ECC error
  1783.                          = 0  no error
  1784.                   bit 5       reserved
  1785.                   bit 4  = 1  ID found
  1786.                          = 0  ID not found
  1787.                   bit 3       reserved
  1788.                   bit 2  = 1  command completed
  1789.                          = 0  command aborted
  1790.                   bit 1  = 1  track 000 not found
  1791.                          = 0  track 000 found
  1792.                   bit 0  = 1  DAM not found
  1793.                          = 0  DAM found (CP-3022 always 0)
  1794.  
  1795. 01F1    w       WPC/4  (Write Precompensation Cylinder divided by 4)
  1796.  
  1797. 01F2    r/w     sector count
  1798. 01F3    r/w     sector number
  1799. 01F4    r/w     cylinder low
  1800. 01F5    r/w     cylinder high
  1801.  
  1802. 01F6    r/w     drive/head
  1803.                  bit 7   = 1
  1804.                  bit 6   = 0
  1805.                  bit 5   = 1
  1806.                  bit 4   = 0  drive 0 select
  1807.                          = 1  drive 1 select
  1808.                  bit 3-0      head select bits
  1809.  
  1810. 01F7    r       status register
  1811.                  bit 7 = 1  controller is executing a command
  1812.                  bit 6 = 1  drive is ready
  1813.                  bit 5 = 1  write fault
  1814.                  bit 4 = 1  seek complete
  1815.                  bit 3 = 1  sector buffer requires servicing
  1816.                  bit 2 = 1  disk data read successfully corrected
  1817.                  bit 1 = 1  index - set to 1 each disk revolution
  1818.                  bit 0 = 1  previous command ended in an error
  1819.  
  1820. 41
  1821. 01F7    w       command register
  1822.                 commands:
  1823.                  98 E5   check power mode       (IDE)
  1824.                  90      execute drive diagnostics
  1825.                  50      format track
  1826.                  EC      identify drive         (IDE)
  1827.                  97 E3   idle                   (IDE)
  1828.                  95 E1   idle immediatete       (IDE)
  1829.                  91      initialize drive parameters
  1830.                  1x      recalibrate
  1831.                  E4      read buffer            (IDE)
  1832.                  C8      read DMA with retry    (IDE)
  1833.                  C9      read DMA without retry (IDE)
  1834.                  C4      read multiplec         (IDE)
  1835.                  20      read sectors with retry
  1836.                  21      read sectors without retry
  1837.                  22      read long with retry
  1838.                  23      read long without retry
  1839.                  40      read verify sectors with retry
  1840.                  41      read verify sectors without retry
  1841.                  7x      seek
  1842.                  EF      set features           (IDE)
  1843.                  C6      set multiple mode      (IDE)
  1844.                  99 E6   set sleep mode         (IDE)
  1845.                  96 E2   standby                (IDE)
  1846.                  94 E0   standby immediate      (IDE)
  1847.                  E8      write buffer           (IDE)
  1848.                  CA      write DMA with retry   (IDE)
  1849.                  CB      write DMA with retry   (IDE)
  1850.                  C5      write multiple         (IDE)
  1851.                  E9      write same             (IDE)
  1852.                  30      write sectors with retry
  1853.                  31      write sectors without retry
  1854.                  32      write long with retry
  1855.                  33      write long without retry
  1856.                  3C      write verify           (IDE)
  1857.                  9A      vendor unique          (IDE)
  1858.                  C0-C3   vendor unique          (IDE)
  1859.                  8x      vendor unique          (IDE)
  1860.                  F0-F4   EATA standard          (IDE)
  1861.                  F5-FF   vendor unique          (IDE)
  1862.  
  1863.  
  1864. 42
  1865. 0200-020F ----  Game port reserved I/O address space  
  1866. 0200-0207 ----  Game port, eight identical addresses on some boards
  1867.  
  1868. 0201    r       read joystick position and status
  1869.                  bit 7  status B joystick button 2 / D paddle button
  1870.                  bit 6  status B joystick button 1 / C paddle button
  1871.                  bit 5  status A joystick button 2 / B paddle button
  1872.                  bit 4  status A joystick button 1 / A paddle button
  1873.                  bit 3  B joystick Y coordinate    / D paddle coordinate
  1874.                  bit 2  B joystick X coordinate    / C paddle coordinate
  1875.                  bit 1  A joystick Y coordinate    / B paddle coordinate
  1876.                  bit 0  A joystick X coordinate    / A paddle coordinate
  1877.  
  1878.         w       fire joysticks four one-shots
  1879.  
  1880.  
  1881. 0210-0217 ----  Expansion unit (XT)
  1882.  
  1883. 0210    w       latch expansion bus data
  1884.         r       verify expansion bus data
  1885. 0211    w       clear wait, test latch
  1886.         r       High byte data address
  1887. 0212    r       Low byte data address
  1888. 0213    w       0=enable,  1=disable expansion unit
  1889. 0214    w       latch data  (receiver card port)
  1890.         r       read data   (receiver card port)
  1891. 0215    r       High byte of address, then Low byte   (receiver card port)
  1892.  
  1893.  
  1894. 0220-0227 ----  Soundblaster PRO and SSB 16 ASP
  1895.  
  1896.  
  1897. 0220-022F ----  Soundblaster PRO 2.0
  1898.  
  1899.  
  1900. 0220-022F ----  Soundblaster PRO 6.0
  1901. 0220    r       left FM status port
  1902. 0220    w       left FM music register address port (index)
  1903. 0221    r/w     left FM music data port
  1904. 0222    r       right FM status port
  1905. 0222    w       right FM music register address port (index)
  1906. 0223    r/w     right FM music data port
  1907. 0224    w       mixer register address port (index)
  1908. 0225    r/w     mixer data port
  1909. 0226    w       DSP reset
  1910. 0228    r       FM music status port
  1911. 0228    w       FM music register address port (index)
  1912. 0229    w       FM music data port
  1913. 022A    r       DSP read data (voice I/O and Midi)
  1914. 022C    w       DSP write data / write command
  1915. 022C    r       DSP write buffer status (bit 7)
  1916. 022E    r       DSP data available status (bit 7)
  1917.  
  1918.                 The FM music is accessible on 0388/0389 for compatibility.
  1919.  
  1920.  
  1921. 43
  1922. 0230-0233 ----  Adaptec 154xB/154xC SCSI adapter.
  1923.                 alternate address at 0130, 0134, 0230, 0330 and 0334
  1924.  
  1925.  
  1926. 0234-0237 ----  Adaptec 154xB/154xC SCSI adapter.
  1927.                 alternate address at 0130, 0134, 0230 ,0330 and 0334
  1928.  
  1929.  
  1930. 0240-0257 ----  RTC (alternate Real Time Clock for XT)   (1st at 0340-0357)
  1931.                 (used by TIMER.COM v1.2 which is the 'standard' timer program)
  1932.  
  1933.  
  1934. 0258-025F ----  Intel Above Board
  1935.  
  1936.  
  1937. 0278-027E ----  parallel printer port, same as 0378 and 03BC
  1938.  
  1939. 0278    w       data port
  1940. 0279    r/w     status port
  1941. 027A    r/w     control port
  1942.  
  1943.  
  1944. 02A2-02A3 ----  MSM58321RS clock
  1945.  
  1946.  
  1947. 02B0-02BF ----  Trantor SCSI adapter
  1948.  
  1949.  
  1950. 02B0-02DF ----  alternate EGA,  primary EGA at 03C0
  1951.  
  1952.  
  1953. 02C0-02Cx ----  AST-clock
  1954.  
  1955.  
  1956. 02E0-02EF ----  GPIB (General Purpose Interface Bus, IEEE 488 interface)
  1957.                 (GAB 0 on XT)
  1958. 02E1            GPIB (adapter 0)
  1959. 02E2
  1960. 02E3
  1961.  
  1962.  
  1963. 02E0-02EF ----  data aquisition  (AT)
  1964.  
  1965. 02E2            data aquisition (adapter 0)
  1966. 02E3            data aquisition (adapter 0)
  1967.  
  1968.  
  1969. 02E8-02EF ----  serial port, same as 02F8, 03E8, and 03F8
  1970.  
  1971.  
  1972. 44
  1973. 02F8-02FF ----  serial port, same as 02E8, 02F8, and 03F8
  1974.  
  1975. 02F8    w       transmitter holding register
  1976. 02F8    r       receiver buffer register
  1977.         r/w     divisor latch, low byte   when DLAB=1
  1978. 02F9    r/w     divisor latch, high byte  when DLAB=1
  1979.         r/w     interrupt enable register when DLAB=0
  1980. 02FA    r       interrupt identification register
  1981. 02FB    r/w     line control register
  1982. 02FC    r/w     modem control register
  1983. 02FD    r       line status register
  1984. 02FF    r/w     scratch register
  1985.  
  1986.  
  1987. 0300-0301 ---- Soundblaster 16 ASP MPU-Midi
  1988.  
  1989.  
  1990. 0300-031F ----  prototype cards
  1991.                 Periscope hardware debugger
  1992.  
  1993.  
  1994. 0300-030F ----  Philips CD-ROM player CM50
  1995. 0310-031F ----  Philips CD-ROM player CM50
  1996.  
  1997.  
  1998. 0320-0323 ----  XT HDC 1   (Hard Disk Controller)
  1999.  
  2000. 0320    r/w     data register
  2001.  
  2002. 0321    w       reset controller
  2003.         r       read controller hardware status
  2004.                  bit 7-6 = 0
  2005.                  bit 5        logical unit number
  2006.                  bit 4-2 = 0
  2007.                  bit 1   = 0  no error
  2008.                  bit 0   = 0 
  2009.  
  2010. 0322    r       read DIPswitch setting on XT controller card
  2011.         w       generate controller-select pulse
  2012. 0323    w       write pattern to DMA and INT mask register
  2013.  
  2014. 0324-0327 ----  XT HDC 2   (Hard Disk Controller)
  2015. 0328-032B ----  XT HDC 3   (Hard Disk Controller)
  2016. 032C-032F ----  XT HDC 4   (Hard Disk Controller)
  2017.  
  2018.  
  2019. 0330-0331 ----  MIDI interface
  2020.  
  2021.  
  2022. 0330-0333 ----  Adaptec 154xB/154xC SCSI adapter. default address.
  2023.                 alternate address at 0130, 0134, 0230, 0234 and 0334
  2024.  
  2025.  
  2026. 0330-033F ----  CompaQ SCSI adapter. alternate address at 0130
  2027.  
  2028.  
  2029. 45
  2030. 0330-033F ----  Philips CD-ROM player CM50
  2031.  
  2032.  
  2033. 0334-0337 ----  Adaptec 154xB/154xC SCSI adapter.
  2034.                 alternate address at 0130, 0134, 0230 ,0234 and 0330
  2035.  
  2036.  
  2037. 0338      ----  AdLib soundblaster card
  2038.  
  2039.  
  2040. 0340-034F ----  Philips CD-ROM player CM50
  2041.  
  2042.  
  2043. 0340-034F ----  SCSI (1st Small Computer System Interface) adapter
  2044.                 (alternate at 0140-014F)
  2045.  
  2046.  
  2047. 0340-0357 ----  RTC (1st Real Time Clock for XT), (alternate at 0240-0257)
  2048.                 (used by TIMER.COM v1.2 which is the 'standard' timer program)
  2049.  
  2050. 0340    r/w     0.01 seconds  0-99
  2051. 0341    r/w     0.1 seconds   0-99
  2052. 0342    r/w     seconds       0-59
  2053. 0343    r/w     minutes       0-59
  2054. 0343    r/w     hours         0-23
  2055. 0345    r/w     day of week   1-7
  2056. 0346    r/w     day of month  1-31
  2057. 0347    r/w     month         1-12
  2058. 0348
  2059. 0349    r/w     year          0-99
  2060. 034A
  2061. 034B
  2062. 034C
  2063. 034D
  2064. 034E
  2065. 034F
  2066. 0350    r       status?
  2067. 0351    
  2068. 0352
  2069. 0353
  2070. 0354    r       status?
  2071. 0355
  2072. 0356
  2073. 0357
  2074.  
  2075.  
  2076. 0348-0357 ----  DCA 3278
  2077.  
  2078.  
  2079. 0360-036F ----  PC network (AT)
  2080. 0360-0367 ----  PC network (XT only)
  2081.  
  2082.  
  2083. 46
  2084. 0370-0377 ----  FDC 2  (2nd Floppy Disk Controller 8272)  same as 03F0
  2085.  
  2086. 0372    w       diskette controller DOR (Digital Output Register)
  2087. 0374    r       diskette controller status register
  2088. 0375    r/w     diskette controller data register
  2089. 0376    r/w     FIXED disk controller data register
  2090. 0377    r       diskette controller DIR (Digital Input Register)
  2091. 0377    w       select register for diskette data transfer rate
  2092.  
  2093.  
  2094. 0378-037A ----  parallel printer port, same as 0278 and 03BC
  2095.  
  2096. 0378    w       data port
  2097. 0379    r/w     status port
  2098. 037A    r/w     control port
  2099.  
  2100.  
  2101. 0380-038F ----  2nd Binary Synchronous Data Link Control adapter (see 03A0)
  2102.  
  2103. 0380    r/w      on board 8255 port A, internal/external sense
  2104. 0381    r/w      on board 8255 port B, external modem interface
  2105. 0382    r/w      on board 8255 port C, internal control and gating
  2106. 0383    r/w      on board 8255 mode register
  2107. 0384    r/w      on board 8253 channel square wave generator
  2108. 0385    r/w      on board 8253 channel 1 inactivity time-out
  2109. 0386    r/w      on board 8253 channel 2 inactivity time-out
  2110. 0387    r/w      on board 8253 mode register
  2111. 0388    r/w      on board 8273 read: status  write: command
  2112. 0389    r/w      on board 8273 read: response  write: parameter
  2113. 038A    r/w      on board 8273 transmit interrupt status
  2114. 038B    r/w      on board 8273 receiver interrupt status
  2115. 038C    r/w      on board 8273 data
  2116.  
  2117.  
  2118. 0388-0389 ---- Soundblaster PRO FM-Chip
  2119. 0388-038B ---- Soundblaster 16 ASP FM-Chip
  2120.  
  2121.  
  2122. 0390-039F ----  Cluster adapter (AT)
  2123.  
  2124. 0390-0393       (adapter 0)     (XT)
  2125.  
  2126.  
  2127. 47
  2128. 03A0-03AF ----  1st SDLC (Binary Synchronous Data Link Control adapter)
  2129.  
  2130. 0380    r/w      on board 8255 port A, internal/external sense
  2131. 0381    r/w      on board 8255 port B, external modem interface
  2132. 0382    r/w      on board 8255 port C, internal control and gating
  2133. 0383    r/w      on board 8255 mode register
  2134. 0384    r/w      on board 8253 counter 0 unused
  2135. 0385    r/w      on board 8253 channel 1 inactivity time-out
  2136. 0386    r/w      on board 8253 channel 2 inactivity time-out
  2137. 0387    r/w      on board 8253 mode register
  2138. 0388    r/w      on board 8251 data
  2139. 0389    r/w      on board 8251 command/mode/status register
  2140.  
  2141.  
  2142. 03B0-03BF ----  MDA  (Monochrome Display Adapter based on 6845)
  2143.  
  2144. 03B0            same as 03B4
  2145. 03B1            same as 03B5
  2146. 03B2            same as 03B4
  2147. 03B3            same as 03B5
  2148. 03B4    w       MDA CRT index register   (EGA/VGA)
  2149.                 selects which register (0-11h) is to be accessed through 3B5
  2150. 03B5    r/w     MDA CRT data register    (EGA/VGA)
  2151.                 selected by port 3B4. registers C-F may be read
  2152.                  00  horizontal total
  2153.                  01  horizontal displayed
  2154.                  02  horizontal sync position
  2155.                  03  horizontal sync pulse width
  2156.                  04  vertical total
  2157.                  05  vertical displayed
  2158.                  06  vertical sync position
  2159.                  07  vertical sunc pulse width
  2160.                  08  interlace mode
  2161.                  09  maximum scan lines
  2162.                  0A  cursor start
  2163.                  0B  cursor end
  2164.                  0C  start address high
  2165.                  0D  start address low
  2166.                  0E  cursor location high
  2167.                  0F  cursor location low
  2168.                  10  light pen high
  2169.                  11  light pen low
  2170. 03B6            same as 03B4
  2171. 03B7            same as 03B5
  2172. 03B8    r/w     MDA mode control register
  2173.                  bit 7 not used
  2174.                  bit 6 not used
  2175.                  bit 5 enable blink
  2176.                  bit 4 not used
  2177.                  bit 3 video enable
  2178.                  bit 2 not used
  2179.                  bit 1 not used
  2180.                  bit 0 high resolution mode
  2181.  
  2182. 48
  2183. 03B9            reserved for color select register on color adapter
  2184.  
  2185. 03BA    r       CRT status register      EGA/VGA: input status 1 register
  2186.                  bit 7-4 reserved
  2187.                  bit 3   black/white video
  2188.                  bit 2-1 reserved
  2189.                  bit 0   horizontal drive
  2190.  
  2191.                  bit 7   (MSD says) if this bit changes within 8000h reads then
  2192.                  bit 6-4 = 000 adapter is Hercules or compatible
  2193.                          = 001 adapter is Hercules+
  2194.                          = 101 adapter is Hercules InColor
  2195.                          else  adapter is unknown
  2196.  
  2197. 03BA    w       EGA/VGA feature control register
  2198.  
  2199. 03BB            reserved for light pen strobe reset
  2200.  
  2201.  
  2202. 03BC-03BF ----  parallel printer port, same as 0278 and 0378
  2203.  
  2204. 03BC    w       data port
  2205. 03BD    r/w     status port
  2206.                  bit 7 = 0  busy
  2207.                  bit 6 = 0  acknowledge
  2208.                  bit 5 = 1  out of paper
  2209.                  bit 4 = 1  printer is selected
  2210.                  bit 3 = 0  error
  2211.                  bit 2 = 0  IRQ has occurred
  2212.                  bit 1-0    reserved
  2213.  
  2214. 03BE    r/w     control port
  2215.                  bit 7-5    reserved
  2216.                  bit 4 = 1  enable IRQ
  2217.                  bit 3 = 1  select printer
  2218.                  bit 2 = 0  initialize printer
  2219.                  bit 1 = 1  automatic line feed
  2220.                  bit 0 = 1  strobe
  2221.  
  2222.  
  2223. 03BF    r/w     Hercules configuration switch register
  2224.                  bit 7-2
  2225.                  bit 1 = 0  disables upper 32K of graphics mode buffer
  2226.                          1  enables upper 32K of graphics mode buffer
  2227.                  bit 0 = 0  prevents graphics mode
  2228.                          1  allows graphics mode
  2229.  
  2230.  
  2231. 49
  2232. 03C0-03CF ----  EGA  (1st Enhanced Graphics Adapter)    alternate at 02C0
  2233.  
  2234. 03C0    (r)/w   EGA VGA ATC index/data register
  2235. 03C1    r       VGA     other attribute register
  2236. 03C2    r       EGA VGA input status 0 register
  2237.         w       VGA     miscellaneous output register
  2238. 03C3    r/w     VGA     video subsystem enable
  2239. 03C4    w       EGA     TS index register
  2240.         r/w     VGA     sequencer index register
  2241. 03C5    w       EGA     TS data register
  2242.         r/w     VGA     other sequencer register
  2243. 03C6    r/w     VGA     PEL mask register
  2244. 03C7    r/w     VGA     PEL address read mode
  2245.         r       VGA     DAC state register
  2246. 03C8    r/w     VGA     PEL address write mode
  2247. 03C9    r/w     VGA     PEL data register
  2248. 03CA    w       EGA     graphics 2 position register
  2249.         r       VGA     feature control register
  2250. 03CC    w       EGA     graphics 1 position register
  2251.         r       VGA     miscellaneous output register
  2252. 03CE    w       EGA     GDC index register
  2253.         r/w     VGA     graphics address register
  2254. 03CF    w       EGA     GDC data register
  2255.         r/w     VGA     other graphics register
  2256.  
  2257.  
  2258. 03D0-03DF ----  CGA   (Color Graphics Adapter)
  2259.  
  2260. 03D0            same as 03D4
  2261. 03D1            same as 03D5
  2262. 03D2            same as 03D4
  2263. 03D3            same as 03D5
  2264. 03D4    w       CRT (6845) index register   (EGA/VGA)
  2265.                 selects which register (0-11h) is to be accessed through 3B5
  2266. 03D5    w       CRT (6845) data register    (EGA/VGA)
  2267.                 selected by port 3B4. registers C-F may be read
  2268.                  (for registers see at 3B5)
  2269. 03D6            same as 03D4
  2270. 03D7            same as 03D5
  2271. 03D8    r/w     CGA mode control register  (except PCjr)
  2272.                  bit 7-6      not used
  2273.                  bit 5   = 1  blink enabled
  2274.                  bit 4   = 1  640*200 graphics mode
  2275.                  bit 3   = 1  video enabled
  2276.                  bit 2   = 1  monochrome signal
  2277.                  bit 1   = 0  text mode
  2278.                          = 1  320*200 graphics mode
  2279.                  bit 0   = 0  40*25 text mode
  2280.                          = 1  80*25 text mode
  2281.  
  2282. 50
  2283. 03D9    r/w     CGA palette register
  2284.                  bit 7-6      not used
  2285.                  bit 5   = 0 active color set: red, green brown
  2286.                          = 1 active color set: cyan, magenta, white
  2287.                  bit 4       intense colors in graphics, background colors text
  2288.                  bit 3       intense border in 40*25, intense background in
  2289.                              320*200, intense foreground in 640*200
  2290.                  bit 2       red border in 40*25, red background in 320*200,
  2291.                              red foreground in 640*200
  2292.                  bit 1       green border in 40*25, green background in
  2293.                              320*200, green foreground in 640*200
  2294.                  bit 0       blue border in 40*25, blue background in 320*200,
  2295.                              blue foreground in 640*200
  2296.  
  2297. 03DA    r       CGA status register     EGA/VGA: input status 1 register
  2298.                  bit 7-4     not used
  2299.                  bit 3 = 1   in vertical retrace
  2300.                  bit 2 = 1   light pen switch is off
  2301.                  bit 1 = 1   positive edge from light pen has set trigger
  2302.                  bit 0 = 0   do not use memory
  2303.                        = 1   memory access without interfering with display
  2304.  
  2305. 03DA    w       EGA/VGA feature control register
  2306.  
  2307. 03DB    w       clear light pen latch
  2308. 03DC    r/w     preset licht pen latch
  2309.  
  2310. 03DF            CRT/CPU page register  PCjr only
  2311.  
  2312.  
  2313. 03E8-03EF ----  serial port, same as 02E8, 02F8, and 03F8
  2314.  
  2315.  
  2316. 03F0-03F7 ----  FDC 1  (1st Floppy Disk Controller 8272)  same as 0370
  2317.  
  2318. 03F0            diskette controller status A (PS/2)
  2319.                  bit 7   interrupt pending
  2320.                  bit 6   second drive installed
  2321.                  bit 5   step
  2322.                  bit 4   track 0
  2323.                  bit 3   head 1 select
  2324.                  bit 2   index
  2325.                  bit 1   write protect
  2326.                  bit 0   direction
  2327.  
  2328. 03F1    r       diskette controller status B (PS/2)
  2329.                  bit 7-6  reserved
  2330.                  bit 5    drive select (0=A:, 1=B:)
  2331.                  bit 4    write data
  2332.                  bit 3    read data
  2333.                  bit 2    write enable
  2334.                  bit 1    motor enable 1
  2335.                  bit 0    motor enable 0
  2336.  
  2337. 51
  2338. 03F2    w       diskette controller DOR (Digital Output Register)
  2339.                  bit 7-6    reserved PS/2
  2340.                  bit 7 = 1  drive 3 motor enable
  2341.                  bit 6 = 1  drive 2 motor enable
  2342.                  bit 5 = 1  drive 1 motor enable
  2343.                  bit 4 = 1  drive 0 motor enable
  2344.                  bit 3 = 1  diskette DMA enable (reserved PS/2)
  2345.                  bit 2 = 1  FDC enable  (controller reset)
  2346.                        = 0  hold FDC at reset
  2347.                  bit 1-0    drive select (0=A 1=B ..)
  2348.  
  2349. 03F4    r       diskette controller status register
  2350.                  bit 7 = 1  data register is ready
  2351.                  bit 6 = 1  transfer is from controller to system
  2352.                          0  transfer is from system to controller
  2353.                  bit 5 = 1  non-DMA mode
  2354.                  bit 4 = 1  diskette controller busy
  2355.                  bit 3 = 1  drive 3 busy (reserved on PS/2)
  2356.                  bit 2 = 1  drive 2 busy (reserved on PS/2)
  2357.                  bit 1 = 1  drive 1 busy
  2358.                  bit 0 = 1  drive 0 busy
  2359.  
  2360. 03F5    r       diskette command status register 0
  2361.                  bit 7-6      last command status
  2362.                          = 00 command terminated successfully
  2363.                          = 01 command terminated abnormally
  2364.                          = 10 invalid command
  2365.                          = 11 terminated abnormally by change in ready signal
  2366.                  bit 5   = 1  seek completed
  2367.                  bit 4   = 1  equipment check occurred after error
  2368.                  bit 3   = 1  not ready
  2369.                  bit 2   = 1  head number at interrupt
  2370.                  bit 1-0 = 1  unit select (0=A 1=B .. )
  2371.                               (on PS/2  01=A  10=B)
  2372.  
  2373.                 status register 1
  2374.                  bit 7      end of cylinder; sector# greater then sectors/track
  2375.                  bit 6 = 0
  2376.                  bit 5 = 1  CRC error in ID or data field
  2377.                  bit 4 = 1  overrun
  2378.                  bit 3 = 0
  2379.                  bit 2 = 1  sector ID not found
  2380.                  bit 1 = 1  write protect detected during write
  2381.                  bit 0 = 1  ID address mark not found
  2382.  
  2383.                 status register 2
  2384.                  bit 7 = 0
  2385.                  bit 6 = 1  deleted Data Eddress Mark detected
  2386.                  bit 5 = 1  CRC error in data
  2387.                  bit 4 = 1  wrong cylinder detected
  2388.                  bit 3 = 1  scan command equal condition satisfied
  2389.                  bit 2 = 1  scan command failed, sector not found
  2390.                  bit 1 = 1  bad cylinder, ID not found
  2391.                  bit 0 = 1  missing Data Address Mark 
  2392.  
  2393. 52
  2394.                 status register 3
  2395.                  bit 7      fault status signal
  2396.                  bit 6      write protect status
  2397.                  bit 5      ready status
  2398.                  bit 4      track zero status
  2399.                  bit 3      two sided status signal
  2400.                  bit 2      side select (head select)
  2401.                  bit 1-0    unit select (0=A 1=B .. )
  2402.  
  2403. 03F6    r/w     FIXED disk controller data register
  2404.                  bit 7-4    reserved
  2405.                  bit 3 = 0  reduce write current
  2406.                          1  head select 3 enable
  2407.                  bit 2 = 1  disk reset enable
  2408.                          0  disk reset disable
  2409.                  bit 1 = 0  disk initialization enable
  2410.                          1  disk initialization disable
  2411.                  bit 0      reserved
  2412.  
  2413. 03F7    r       diskette controller DIR (Digital Input Register)
  2414.                  bit 7 = 1 diskette change
  2415.  
  2416.                  bit 6     FIXED DISK write gate
  2417.                  bit 5     FIXED DISK head select 3 / reduced write current
  2418.                  bit 4     FIXED DISK head select 2
  2419.                  bit 3     FIXED DISK head select 1
  2420.                  bit 2     FIXED DISK head select 0
  2421.                  bit 1     FIXED DISK drive 1 select
  2422.                  bit 0     FIXED DISK drive 0 select   conflicts with:
  2423.  
  2424.                  bit 0     diskette high density select
  2425.  
  2426. 03F7    w       select register for diskette data transfer rate
  2427.                  bit 7-2       reserved
  2428.                  bit 1-0 = 00  500 Kb/S mode
  2429.                          = 01  300 Kb/S mode
  2430.                          = 10  250 Kb/S mode
  2431.                          = 11  reserved
  2432.  
  2433.  
  2434. 03F8-03FF ----  serial port (8250,8251,16450,16550), same as 02E8,02F8,and 03F8
  2435.  
  2436. 03F8    w       serial port, transmitter holding register, which contains the
  2437.                 character to be sent. Bit 0 is sent first.
  2438.                  bit 7-0   data bits when DLAB=0 (Divisor Latch Access Bit)
  2439.         r       receiver buffer register, which contains the received character
  2440.                 Bit 0 is received first
  2441.                  bit 7-0   data bits when DLAB=0 (Divisor Latch Access Bit)
  2442.         r/w     divisor latch low byte when DLAB=1
  2443.  
  2444. 53
  2445. 03F9    r/w     divisor latch high byte when DLAB=1
  2446.         r/w     interrupt enable register when DLAB=0
  2447.                  bits 7-4   reserved
  2448.                  bit 3 = 1  modem-status interrupt enable
  2449.                  bit 2 = 1  receiver-line-status interrupt enable
  2450.                  bit 1 = 1  transmitter-holding-register empty interrupt enable
  2451.                  bit 0 = 1  received-data-avail.int. enable (and 16550 timeout)
  2452.  
  2453.               - 16550 will interrupt if data exists in the FIFO and isn't read
  2454.                 within the time it takes to receive four bytes or if no data is
  2455.                 received within the time it takes to receive four bytes
  2456.  
  2457. 03FA    r       interrupt identification register. Information about a pending
  2458.                 interrupt is stored here. When the ID register is addressed,
  2459.                 the highest priority interrupt is held, and no other interrupts
  2460.                 are acknowledged until the CPU services that interrupt.
  2461.                  bit 7-6 = 00  reserved on 8250, 8251, 16450
  2462.                          = 11  if FIFO queues are enabled (16550 only)
  2463.                  bit 5-4 = 0 reserved
  2464.                  bit 3   = 0 reserved  8250, 16450
  2465.                          = 1 16550  timeout int. pending
  2466.                  bit 2-1 identify pending interrupt with the highest priority
  2467.                          = 11  receiver line status interrupt. 
  2468.                                priority = highest
  2469.                          = 10  received data available register interrupt. 
  2470.                                priority = second 
  2471.                          = 01  transmitter holding register empty interrupt. 
  2472.                                priority = third 
  2473.                          = 00  modem status interrupt. 
  2474.                                priority = fourth
  2475.                  bit 0   = 0   interrupt pending. Contents of register can be 
  2476.                                used as a pointer to the appropriate 
  2477.                                interrupt service routine 
  2478.                          = 1   no interrupt pending
  2479.  
  2480.              - interrupt pending flag uses reverse logic, 0 = pending, 1 = none
  2481.              - interrupt will occur if any of the line status bits are set
  2482.              - THRE bit is set when THRE register is emptied into the TSR
  2483.  
  2484.  
  2485. 54
  2486. 03FA    w       16650 FCR  (FIFO Control Register)
  2487.                  bit 7-6 = 00  1 byte
  2488.                          = 01  4 bytes
  2489.                          = 10  8 bytes
  2490.                          = 11 14 bytes
  2491.                  bit 5-4 = 00 reserved
  2492.                  bit 3   = 1  change RXRDY  TXRDY pins from mode 0 to mode 1
  2493.                  bit 2   = 1  clear XMIT FIFO
  2494.                  bit 1   = 1  clear RCVR FIFO
  2495.                  bit 0   = 1  enable clear XMIT and RCVR FIFO queues
  2496.  
  2497.               - bit 0 must be set in order to write to other FCR bits
  2498.               - bit 1 when set  the RCVR FIFO is cleared and this bit is reset
  2499.                 the receiver shift register is not cleared
  2500.               - bit 2 when set  the XMIT FIFO is cleared and this bit is reset
  2501.                 the transmit shift register is not cleared
  2502.  
  2503. 03FB    r/w     line control register
  2504.                  bit 7 = 1  divisor latch access bit (DLAB)
  2505.                          0  receiver buffer, transmitter holding, or interrupt
  2506.                             enable register access
  2507.                  bit 6 = 1  set break enable. serial ouput is forced to spacing
  2508.                             state and remains there.
  2509.                  bit 5 =    stick parity
  2510.                  bit 4 = 1  even parity select
  2511.                  bit 3 =    parity enable
  2512.                          1  even number of ones are sent and checked in the 
  2513.                             data word bits and parity bit
  2514.                          0  odd number of ones are sent and checked
  2515.                  bit 2 = 0  one stop bit
  2516.                          1  zero stop bit
  2517.                  bit 1-0 00 word length is 5 bits
  2518.                          01 word length is 6 bits
  2519.                          10 word length is 7 bits
  2520.                          11 word length is 8 bits
  2521.  
  2522. 03FC    r/w     modem control register
  2523.                  bit 7-5 = 0  reserved
  2524.                  bit 4 = 1  loopback mode for diagnostic testing of serial port
  2525.                             output of transmitter shift register is looped back
  2526.                             to receiver shift register input. In this mode
  2527.                             transmitted data is received immediately so that
  2528.                             the CPU can verify the transmit data/receive data
  2529.                             serial port paths.
  2530.                  bit 3 = 1  auxiliary user-designated output 2
  2531.                  bit 2 = 1  auxiliary user-designated output 1
  2532.                  bit 1 = 1  force request-to-send active
  2533.                  bit 0 = 1  force data-terminal-ready active
  2534.  
  2535. 55
  2536. 03FD    r       line status register
  2537.                  bit 7 = 0  reserved
  2538.                  bit 6 = 1  transmitter shift and holding registers empty
  2539.                  bit 5 = 1  transmitter holding register empty. Controller is
  2540.                             ready toaccept a new character to send.
  2541.                  bit 4 = 1  break interrupt. the received data input is held in
  2542.                             in the zero bit state longer than the time of start
  2543.                             bit + data bits + parity bit + stop bits.
  2544.                  bit 3 = 1  framing error. the stop bit that follows the last
  2545.                             parity or data bit is a zero bit.
  2546.                  bit 2 = 1  parity error. Character has wrong parity
  2547.                  bit 1 = 1  overrun error. a character was sent to the receiver
  2548.                             buffer before the previous character in the buffer
  2549.                             could be read. This destroys the previous
  2550.                             character.
  2551.                  bit 0 = 1  data ready. a complete incoming character has been
  2552.                             received and sent to the receiver buffer register.
  2553.  
  2554. 03FE    r       modem status register
  2555.                  bit 7 = 1  data carrier detect
  2556.                  bit 6 = 1  ring indicator
  2557.                  bit 5 = 1  data set ready
  2558.                  bit 4 = 1  clear to send
  2559.                  bit 3 = 1  delta data carrier detect
  2560.                  bit 2 = 1  trailing edge ring indicator
  2561.                  bit 1 = 1  delta data set ready
  2562.                  bit 0 = 1  delta clear to send
  2563.  
  2564.               - bits 0-3 are reset when the CPU reads the MSR
  2565.               - bit 4 is the Modem Control Register RTS during loopback test
  2566.               - bit 5 is the Modem Control Register DTR during loopback test
  2567.               - bit 6 is the Modem Control Register OUT1 during loopback test
  2568.               - bit 7 is the Modem Control Register OUT2 during loopback test
  2569.  
  2570. 03FF    r/w     scratch register
  2571.  
  2572. Adresses above 03FF apply to EISA machines only
  2573.  
  2574.                          1000-1FFF      slot 1 EISA
  2575.                          2000-2FFF      slot 2 EISA
  2576.                          3000-3FFF      slot 3 EISA
  2577.                          4000-4FFF      slot 4 EISA
  2578.                          5000-5FFF      slot 5 EISA
  2579.                          6000-6FFF      slot 6 EISA
  2580.                          7000-7FFF      slot 7 EISA
  2581.  
  2582.  
  2583. 0401-04D6 ----  used by EISA systems only
  2584.  
  2585. 0401    r/w     DMA channel 0 word count byte 2 (high)
  2586. 0403    r/w     DMA channel 1 word count byte 2 (high)
  2587. 0405    r/w     DMA channel 2 word count byte 2 (high)
  2588. 0407    r/w     DMA channel 3 word count byte 2 (high)
  2589.  
  2590. 56
  2591. 040A    w       extended DMA chaining mode register, channels 0-3
  2592.                  bit 7-5      reserved
  2593.                  bit 4   = 0  generates IRQ13
  2594.                          = 1  generates terminal count
  2595.                  bit 3   = 0  do not start chaining
  2596.                          = 1  programming complete
  2597.                  bit 2   = 0  disable buffer chaining mode (default)
  2598.                          = 1  enable buffer chaining mode
  2599.                  bit 1-0      DMA channel select
  2600.  
  2601. 040A    r       channel interrupt (IRQ13) status register
  2602.                  bit 7-5  interrupt on channels 7-5
  2603.                  bit 4    reserved
  2604.                  bit 3-0  interrupt on channels 3-0
  2605.  
  2606. 040B    w       DMA extended mode register for channels 3-0.
  2607.                 bit settings same as 04D6
  2608.                  bit 7   = 0  enable stop register
  2609.                  bit 6   = 0  terminal count is an output for this channel
  2610. (default)
  2611.                  bit 5-4      DMA cycle timing
  2612.                          = 00 ISA-compatible (default)
  2613.                          = 01 type A timing mode
  2614.                          = 10 type B timing mode
  2615.                          = 11 burst DMA mode
  2616.                  bit 3-2      Address mode
  2617.                          = 00 8-bit I/O, count by bytes (default)
  2618.                          = 01 16-bit I/O, count by words, address shifted
  2619.                          = 10 32-bit I/O, count by bytes
  2620.                          = 11 16-bit I/O, count by bytes
  2621.                  bit 1-0      DMA channel select
  2622.  
  2623.  
  2624. 0461    r/w     Extended NMI status/control register
  2625.                  bit 7 = 1  NMI pending from fail-safe timer (read only)
  2626.                  bit 6 = 1  NMI pending from bus timeout NMI status (read
  2627. only)
  2628.                  bit 5 = 1  NMI pending (read only)
  2629.                  bit 4      reserved
  2630.                  bit 3 = 1  bus timeout NMI enable (read/write)
  2631.                  bit 2 = 1  fail-safe NMI enable (read/write)
  2632.                  bit 1 = 1  NMI I/O port enable (read/write)
  2633.                  bit 0      RSTDRV. bus reset (read/write)
  2634.                        = 0  normal bus reset operation
  2635.                        = 1  reset bus asserted
  2636.  
  2637. 0462    w       Software NMI register. writing to this register causes an NMI
  2638.                 if NMI's are enabled
  2639.                  bit 7 = 1  generates an NMI
  2640.  
  2641. 57
  2642. 0464    r       bus master status latch register (slots 1-8). identifies the
  2643.                 last bus master that had control of the bus
  2644.                  bit 7 = 0  slot 8 had control last
  2645.                  bit 6 = 0  slot 7 had control last
  2646.                  bit 5 = 0  slot 6 had control last
  2647.                  bit 4 = 0  slot 5 had control last
  2648.                  bit 3 = 0  slot 4 had control last
  2649.                  bit 2 = 0  slot 3 had control last
  2650.                  bit 1 = 0  slot 2 had control last
  2651.                  bit 0 = 0  slot 1 had control last
  2652.  
  2653. 0465    r       bus master status latch register (slots 9-16)
  2654.                  bit 7 = 0  slot 16 had control last
  2655.                  bit 6 = 0  slot 15 had control last
  2656.                  bit 5 = 0  slot 14 had control last
  2657.                  bit 4 = 0  slot 13 had control last
  2658.                  bit 3 = 0  slot 12 had control last
  2659.                  bit 2 = 0  slot 11 had control last
  2660.                  bit 1 = 0  slot 10 had control last
  2661.                  bit 0 = 0  slot 9  had control last
  2662.  
  2663.  
  2664. 0481    r/w     DMA channel 2 address byte 3 (high)
  2665. 0482    r/w     DMA channel 3 address byte 3 (high)
  2666. 0483    r/w     DMA channel 1 address byte 3 (high)
  2667. 0487    r/w     DMA channel 0 address byte 3 (high)
  2668. 0489    r/w     DMA channel 6 address byte 3 (high)
  2669. 048A    r/w     DMA channel 7 address byte 3 (high)
  2670. 048B    r/w     DMA channel 5 address byte 3 (high)
  2671.  
  2672. 04C6    r/w     DMA channel 5 word count byte 2 (high)
  2673. 04CA    r/w     DMA channel 6 word count byte 2 (high)
  2674. 04CE    r/w     DMA channel 7 word count byte 2 (high)
  2675.  
  2676.  
  2677. 04D0    w       IRQ 0-7 interrupt edge/level registers
  2678.                  bit 7 = 1  IRQ 7 is level sensitive
  2679.                  bit 6 = 1  IRQ 6 is level sensitive
  2680.                  bit 5 = 1  IRQ 5 is level sensitive
  2681.                  bit 4 = 1  IRQ 4 is level sensitive
  2682.                  bit 3 = 1  IRQ 3 is level sensitive
  2683.                  bit 2-0    reserved
  2684.  
  2685. 04D1    w       IRQ 8-15 interrupt edge/level registers
  2686.                  bit 7 = 1  IRQ 15 is level sensitive
  2687.                  bit 6 = 1  IRQ 14 is level sensitive
  2688.                  bit 5 = 1  reserved
  2689.                  bit 4 = 1  IRQ 12 is level sensitive
  2690.                  bit 3 = 1  IRQ 11 is level sensitive
  2691.                  bit 2 = 1  IRQ 10 is level sensitive
  2692.                  bit 1 = 1  IRQ 9  is level sensitive
  2693.                  bit 0      reserved
  2694.  
  2695. 58
  2696. 04D4    w       extended DMA chaining mode register, channels 4-7
  2697.                  bit 7-5 = 0  reserved
  2698.                  bit 4   = 0  generates IRQ 13
  2699.                          = 1  generates terminal count
  2700.                  bit 3   = 0  do not start chaining
  2701.                          = 1  programming complete
  2702.                  bit 2   = 0  disable buffer chaining mode (default)
  2703.                          = 1  enable buffer chaining mode
  2704.                  bit 1-0      DMA channel select
  2705.  
  2706. 04D6    w       DMA extended mode register for channels 4-7
  2707.                 bit settings same as 04B
  2708.                  bit 7   = 0  enable stop register
  2709.                  bit 6   = 0  terminal count is an output for this channel
  2710. (default)
  2711.                  bit 5-4      DMA cycle timing
  2712.                          = 00 ISA-compatible (default)
  2713.                          = 01 type A timing mode
  2714.                          = 10 type B timing mode
  2715.                          = 11 burst DMA mode
  2716.                  bit 3-2      Address mode
  2717.                          = 00 8-bit I/O, count by bytes (default)
  2718.                          = 01 16-bit I/O, count by words, address shifted
  2719.                          = 10 32-bit I/O, count by bytes
  2720.                          = 11 16-bit I/O, count by bytes
  2721.                  bit 1-0      DMA channel select
  2722.  
  2723.  
  2724. 0601    w       System control. Laptop chipset: Headland HL21 & Acer M5105
  2725.                  bit 7 = 1  power led on
  2726.                  bit 6 = 1  LCD backlight off
  2727.                  bit 5
  2728.                  bit 4
  2729.                  bit 3
  2730.                  bit 2 = 1  video chips disabled, screen blanked.
  2731.                  bit 1
  2732.                  bit 0 = 1  will lock up your machine!
  2733.  
  2734.         r        =04        (always reads back this value)
  2735.  
  2736.  
  2737. 0620-0627 ----  PC network (adapter 1)
  2738. 0628-062F ----  PC network (adapter 2)
  2739.  
  2740.  
  2741. 06E2-06E3 ----  data aquisition (adapter 1)
  2742.  
  2743.  
  2744. 0790-0793 ----  cluster (adapter 1)
  2745.  
  2746.  
  2747. 0800-08FF ----  I/O port access registers for extended CMOS RAM or SRAM
  2748.                 (256 bytes at a time)
  2749.                 Sometimes plain text can be seen here.
  2750.  
  2751.  
  2752. 59
  2753. 0A20-0A23 ----  Token Ring (adapter 1)
  2754. 0A24-0A27 ----  Token Ring (adapter 2)
  2755.  
  2756.  
  2757. 0AE2-0AE3 ----  cluster (adapter 2)
  2758. 0B90-0B93 ----  cluster (adapter 2)
  2759.  
  2760.  
  2761. 0C00    r/w     page register to write to SRAM or I/O
  2762.  
  2763.  
  2764. 0C80-0C83 ----  system board ID registers
  2765.  
  2766.  
  2767. 1390-1393 ----  cluster (adapter 3)
  2768.  
  2769.  
  2770. 2100-210F ----  IBM XGA (eXtended Graphics Adapter  8514/A)
  2771. 2110-211F ----  IBM XGA (eXtended Graphics Adapter  8514/A)
  2772. 2120-212F ----  IBM XGA (eXtended Graphics Adapter  8514/A)
  2773. 2130-213F ----  IBM XGA (eXtended Graphics Adapter  8514/A)
  2774. 2140-214F ----  IBM XGA (eXtended Graphics Adapter  8514/A)
  2775. 2150-215F ----  IBM XGA (eXtended Graphics Adapter  8514/A)
  2776. 2160-216F ----  IBM XGA (eXtended Graphics Adapter  8514/A)
  2777. 2170-217F ----  IBM XGA (eXtended Graphics Adapter  8514/A)
  2778.  
  2779.  
  2780. 2390-2393 ----  cluster (adapter 4)
  2781.  
  2782.  
  2783. 3220-3227 ----  serial port 3, description same as 03F8
  2784. 3228-322F ----  serial port 4, description same as 03F8
  2785.  
  2786.  
  2787. 3540-354F ----  IBM SCSI (Small Computer System Interface) adapter
  2788. 3550-355F ----  IBM SCSI (Small Computer System Interface) adapter
  2789. 3560-356F ----  IBM SCSI (Small Computer System Interface) adapter
  2790. 3570-357F ----  IBM SCSI (Small Computer System Interface) adapter
  2791.  
  2792.  
  2793. 4220-4227 ----  serial port, description same as 03F8
  2794. 4228-422F ----  serial port, description same as 03F8
  2795.  
  2796.  
  2797. 42E0-42EF ----  GPIB (General Purpose Interface Bus, IEEE 488 interface)
  2798.  
  2799. 42E1    r/w     GPIB (adapter 2)
  2800.  
  2801.  
  2802. 5220-5227 ----  serial port, description same as 03F8
  2803. 5228-522F ----  serial port, description same as 03F8
  2804.  
  2805.  
  2806. 62E0-62EF ----  GPIB (General Purpose Interface Bus, IEEE 488 interface)
  2807.  
  2808. 60
  2809. 62E1    r/w     GPIB (adapter 3)
  2810.  
  2811.  
  2812. 82E0-82EF ----  GPIB (General Purpose Interface Bus, IEEE 488 interface)
  2813.  
  2814. 82E1    r/w     GPIB (adapter 4)
  2815.  
  2816.  
  2817. 82F8-82FF ----  serial port, description same as 03F8
  2818. 83F8-83FF ----  serial port, description same as 03F8
  2819.  
  2820.  
  2821. A220      ????  soundblaster support in AMI Hi-Flex BIOS  ????
  2822.  
  2823.  
  2824. A2E0-A2EF ----  GPIB (General Purpose Interface Bus, IEEE 488 interface)
  2825.  
  2826. A2E1    r/w     GPIB (adapter 5)
  2827.  
  2828.  
  2829. AFFF    r/w     plane 0-3 system latch (video register)
  2830.  
  2831.  
  2832. B220-B227 ----  serial port, description same as 03F8
  2833. B228-B22F ----  serial port, description same as 03F8
  2834.  
  2835.  
  2836. C220-C227 ----  serial port, description same as 03F8
  2837. C228-C22F ----  serial port, description same as 03F8
  2838.  
  2839.  
  2840. D220-D227 ----  serial port, description same as 03F8
  2841. D228-D22F ----  serial port, description same as 03F8
  2842.  
  2843.  
  2844. C2E0-C2EF ----  GPIB (General Purpose Interface Bus, IEEE 488 interface)
  2845.  
  2846. C2E1    r/w     GPIB (adapter 6)
  2847.  
  2848.  
  2849. E2E0-E2EF ----  GPIB (General Purpose Interface Bus, IEEE 488 interface)
  2850.  
  2851. E2E1    r/w     GPIB (adapter 7)
  2852.  
  2853.  
  2854.  
  2855.  
  2856.                             MEMORY-MAPPED ADDRESSES
  2857.  
  2858.  
  2859. 80C00000  Compaq Deskpro 386 system memory board register
  2860.  
  2861. 61
  2862. 80C00000 w      RAM relocation register
  2863.                 bit 7-2    Reserved, always write 1's.
  2864.                 bit 1 = 0  Write-protect 128-Kbyte RAM at FE0000.
  2865.                       = 1  Do not write-protect RAM at FE0000.
  2866.                 bit 0 = 0  Relocate 128-Kbyte block at FE0000 to address 0E0000
  2867.                       = 1  128-Kbyte RAM is addressed only at FE0000.
  2868.  
  2869. 80C00000 r      Diagnostics register
  2870.                 bit 7   = 0  memory expansion board is installed
  2871.                 bit 6   = 0  second 1 MB of system memory board is installed
  2872.                 bit 5-4 = 00 base memory set to 640 KB
  2873.                         = 01 invalid
  2874.                         = 10 base memory set to 512 KB
  2875.                         = 11 base memory set to 256 KB
  2876.                 bit 3   = 0  parity error in byte 3
  2877.                 bit 2   = 0  parity error in byte 2
  2878.                 bit 1   = 0  parity error in byte 1
  2879.                 bit 0   = 0  parity error in byte 0 (in 32-bit double word)
  2880. 62
  2881.                      Program Segment Prefix Data Structure
  2882.  
  2883.  
  2884. When DOS loads a program for execution it creates a data structure in memory 
  2885. called the "Program Segment Prefix", or PSP for short. This structure occupies 
  2886. the 256 bytes of memory immediately preceeding the memory occupied by the 
  2887. loaded program. The PSP contains useful information which is often accessed by 
  2888. the running program. The following table describes the structure of the PSP.
  2889.  
  2890.  
  2891.  
  2892. Offset   Description
  2893.  
  2894.  00      INT 20 instruction for CP/M CALL 0 program termination
  2895.  02      segment of first byte beyond memory allocated to program
  2896.  04      unused filler
  2897.  05      CP/M CALL 5 service request (FAR JMP to 000C0h)
  2898.          BUG: (DOS 2+) PSPs created by INT 21/AH=4B point at 000BE
  2899.  06      CP/M compatibility - size of first segment for .COM files
  2900.  08      remainder of FAR JMP at 05
  2901.  0A      stored INT 22 termination address
  2902.  0E      stored INT 23 control-Break handler address
  2903.  12      DOS 1.1+ stored INT 24 critical error handler address
  2904.  16      segment of parent PSP
  2905.  18      DOS 2+ Job File Table, one byte per file handle, FFh = closed
  2906.  2C      DOS 2+ segment of environment for process
  2907.  2E      DOS 2+ process's SS:SP on entry to last INT 21 call
  2908.  32      DOS 3+ number of entries in JFT (default 20)
  2909.  34      DOS 3+ pointer to JFT (default PSP:0018)
  2910.  38      DOS 3+ pointer to previous PSP (default FFFFFFFFh in 3.x)
  2911.          used by SHARE in DOS 3.3
  2912.  3C      apparently unused by DOS versions <= 6.00
  2913.  3D      (APPEND) TrueName flag 
  2914.  3E      (Novell NetWare) flag: next byte initialized if CEh
  2915.  3F      (Novell NetWare) Novell task number if previous byte is CEh
  2916.  40      DOS 5+ version to return on INT 21/AH=30
  2917.  42      (MSWindows3) selector of next PSP (PDB) in linked list
  2918.          Windows keeps a linked list of Windows programs only
  2919.  44      unused by DOS versions <= 6.00
  2920.  48      (MSWindows3) bit 0 set if non-Windows application (WINOLDAP)
  2921.  49      unused by DOS versions <= 6.00
  2922.  50      DOS 2+ service request (INT 21/RETF instructions)
  2923.  53      unused in DOS versions <= 6.00
  2924.  55      unused in DOS versions <= 6.00; can be used to make first FCB
  2925.          into an extended FCB
  2926.  5C      first default FCB, filled in from first command tail argument
  2927.          overwrites second FCB if opened
  2928.  6C      second default FCB, filled in from second command tail argument
  2929.          overwrites beginning of command tail if opened
  2930.  7C      unused
  2931.  80      Length of command tail
  2932.  81      Command tail terminated by 0D
  2933. 63
  2934. Program Design & Coding: Matthew Probert
  2935.  
  2936. Version 6.0 published by Servile Software February 1997. All rights 
  2937. reserved. 
  2938.  
  2939. With effect from version 2.4, SSD became SHAREWARE and you are 
  2940. required to register your copy or stop using it. 
  2941.  
  2942. Registration costs 29.95 pounds sterling (no foreign currency). 
  2943.  
  2944. Please make cheques payable to "M. Probert" ONLY, and send with the 
  2945. enclosed order form (order.doc) to: 
  2946.  
  2947. Matthew Probert
  2948. 5 Longcroft Close
  2949. Basinsgtoke
  2950. Hampshire
  2951. RG21 8XG
  2952.  
  2953. Telephone +44 (0)1256 414072
  2954.  
  2955. EMAIL   probertm@pins.co.uk
  2956. WEB     http://www.pins.co.uk/upages/probertm/
  2957. FTP     ftp.pins.co.uk/seville
  2958.  
  2959.