home *** CD-ROM | disk | FTP | other *** search
/ Share Gallery 1 / share_gal_1.zip / share_gal_1 / LA / LA023.ZIP / DOSREF17.ZIP / CHAPTER.003 < prev    next >
Text File  |  1990-03-21  |  139KB  |  2,966 lines

  1.  
  2.    **  Programmer's  Technical  Reference  for  MSDOS  and  the  IBM  PC **
  3.                         ┌─────────────────────────────┐
  4.                         │ Shareware Version, 03/21/90 │
  5.                         │  Please Register Your Copy  │
  6.                         └─────────────────────────────┘
  7.                     Copyright (c) 1987, 1990 Dave Williams
  8.  
  9.  
  10.                           C H A P T E R    T H R E E
  11.  
  12.                  THE PC ROM BIOS - Interrupts 10h through 19h
  13.  
  14.  
  15. ┌─────────────────────────────────────────────────────────────────────────────┐
  16. │Interrupt 10h  Video I/O - services to handle video output                   │
  17. └─────────────────────────────────────────────────────────────────────────────┘
  18. (0:0040h)       The ROM video routines in the original PC BIOS are designed for
  19.                 use with the Color Graphics Adapter and incorporate code to test
  20.                 for the horizontal retrace before writing. The check is
  21.                 performed no matter what actual display adapter is installed.
  22.                 The ROM character table for the first 128 characters is located
  23.                 at 0FA6Eh in the PC. Int 01Fh can be used to point to a second
  24.                 table of 128 characters.
  25.                  CS, SS, DS, ES, BX, CX, DX are preserved during call. All
  26.                 others are destroyed.
  27.  
  28. Function 00h    Determine or Set Video State
  29. entry   AH      00h     set video mode
  30.         AL      display mode:                    CGA|PCjr|MDA|MCGA|EGA|VGA|8514
  31.                 00h     40x25 B/W text           CGA|PCjr|   |    |EGA|   |
  32.   16 color              40x25, 320x400 graphics     |    |   |MCGA|   |   |
  33.   16 color              40x25, 360x400 graphics     |    |   |    |   |VGA|
  34.   16 color      01h     40x25 color text         CGA|PCjr|   |    |EGA|   |
  35.                 02h     80x25 B/W text           CGA|PCjr|   |    |EGA|   |
  36.   16 color              80x25 640x400 graphics      |    |   |MCGA|   |   |
  37.   16 color              80x25 720x400 graphics      |    |   |    |VGA|   |
  38.   16 color      03h     80x25 color text         CGA|PCjr|   |    |EGA|VGA|
  39.   4 color       04h     320x200 color graphics   CGA|PCjr|   |    |EGA|   |
  40.   4 tone gray   05h     320x200 B/W graphics     CGA|PCjr|   |    |EGA|   |
  41.   2 color       06h     640x200 B/W graphics     CGA|PCjr|   |    |EGA|   |
  42.   monochrome    07h     80x25 monochrome text       |    |MDA|    |EGA|   |
  43.   16 color      08h     160x200 color graphics   CGA|PCjr|   |    |   |   |
  44.   16 color      09h     320x200 color graphics      |PCjr|   |    |   |VGA|
  45.   4 color       0Ah     640x200 color graphics      |PCjr|   |    |   |   |
  46.      N/A        0Bh     BIOS font load              |    |   |    |EGA|VGA|
  47.      N/A        0Ch     BIOS font load              |    |   |    |EGA|VGA|
  48.   16 color      0Dh     320x200 graphics            |    |   |    |EGA|VGA|
  49.   16 color      0Eh     640x200 graphics            |    |   |    |EGA|VGA|
  50.   monochrome    0Fh     640x350 graphics            |    |   |    |EGA|VGA|
  51.   16 & 64 color 10h     640x350 color hi-res        |    |   |    |EGA|VGA|
  52.   2 color       11h     640x480 graphics            |    |   |MCGA|   |VGA|
  53.   16 color      12h     640x480 graphics            |    |   |    |   |VGA|
  54.   256 color     13h     320x200 graphics            |    |   |MCGA|   |VGA|8514
  55.                 14h-20h used by EGA and VGA graphics modes
  56.                 18h     132x44 8x8 char mono        | Tseng Labs EVA
  57.                 19h     132x25 8x14 char mono       | Tseng Labs EVA
  58.                 1Ah     132x28 8x13 char mono       | Tseng Labs EVA
  59.  monochrome     21h     Hercules Graphics, Graphics Page 1
  60.  monochrome     22h     Hercules Graphics, Graphics Page 2
  61.                 22h     132x44                      | Tseng, Ahead
  62.                 23h     132x25                      | Tseng Labs EVA
  63.                         132x25                      | Ahead Systems EGA2001
  64.                         132x25                      | ATI EGA Wonder
  65.                 24h     132x28                      | Tseng Labs EVA
  66.                 25h     80x60  640x480              | Tseng Labs EVA
  67.  16 color               640x480                     | VEGA VGA
  68.                 26h     80x60                       | Tseng Labs EVA
  69.                         80x60   640x480             | Ahead Systems EGA2001
  70.  16 color       27h     720x512                     | VEGA VGA
  71.  monochrome             132x25                      | ATI EGA Wonder
  72.                 28h     unknown                     | VEGA VGA
  73.  16 color       29h     800x600                     | VEGA VGA
  74.  256 color      2Dh     640x350                     | VEGA VGA
  75.  256 color      2Eh     640x480                     | VEGA VGA
  76.  256 color      2Fh     720x512                     | VEGA VGA
  77.  256 color      30h     800x600                     | VEGA VGA
  78.                         unknown                     | AT&T 6300
  79.  16 color       36h     960x720                     | VEGA VGA
  80.  16 color       37h     1024x768                    | VEGA VGA
  81.  monochrome             132x44                      | ATI EGA Wonder
  82.  2 color        40h     640x400                     | AT&T 6300
  83.                         80x43                       | VEGA VGA
  84.  16 color       41h     640x200                     | AT&T 6300
  85.                         132x25                      | VEGA VGA
  86.  16 color       42h     640x400                     | AT&T 6300
  87.                         132x43                      | VEGA VGA
  88.                 43h     unsupported 640x200 of 640x400 viewport  AT&T 6300
  89.                         80x60                       | VEGA VGA
  90.                 44h     disable VDC and DEB output  | AT&T 6300
  91.                         100x60                      | VEGA VGA
  92.                 48h     80x50   640x400             | AT&T 6300
  93.                 4Dh     120x25                      | VEGA VGA
  94.                 4Eh     120x43                      | VEGA VGA
  95.                 4Fh     132x25                      | VEGA VGA
  96.  monochrome     50h     132x25                      | Ahead Systems EGA2001
  97.  16 color               640x480                     | Paradise EGA-480
  98.  monochrome             80x43                       | VEGA VGA
  99.                         640x480 mono?               | Taxan 565 EGA
  100.                 51h     80x30                       | Paradise EGA-480
  101.  monochrome             132x25                      | VEGA VGA
  102.                         640x480 ?                   | ATI EGA Wonder
  103.  monochrome     52h     132x44                      | Ahead Systems EGA2001
  104.  monochrome             132x43                      | VEGA VGA
  105.                         752x410 ?                   | ATI EGA Wonder
  106.                 53h     800x560 ?                   | ATI EGA Wonder
  107.                 54h     132x43                      | Paradise EGA-480
  108.  16 color               132x43                      | Paradise VGA
  109.  16 color               132x43                      | Paradise VGA on multisync
  110.                         132x43                      | Taxan 565 EGA
  111.                 55h     132x25                      | Paradise EGA-480
  112.  16 color               132x25                      | Paradise VGA
  113.  16 color               132x25                      | Paradise VGA on multisync
  114.                         132x25                      | Taxan 565 EGA
  115.                 56h     132x43                      | NSI Smart EGA+
  116.                         132x43                      | Paradise VGA
  117.                         132x43                      | Paradise VGA on multisync
  118.  monochrome             132x43                      | Taxan 565 EGA
  119.                 57h     132x25                      | NSI Smart EGA+
  120.                         132x25                      | Paradise VGA
  121.                         132x25                      | Paradise VGA on multisync
  122.  monochrome             132x25                      | Taxan 565 EGA
  123.                 58h     100x75   800x600 16/256k    | Paradise VGA
  124.                 59h     100x75   800x600            | Paradise VGA
  125.                 5Eh     640x400                     | Paradise VGA,VEGA VGA
  126.                 5Fh     640x480                     | Paradise VGA
  127.                 60h     80x?   ?x400                | Corona/Cordata BIOS v4.10+
  128.                         752x410                     | VEGA VGA
  129.                 60h     400 line graphics+80 col text |(Corona/Cordata)
  130.                 61h     400 line graphics           | Corona/Cordata BIOS v4.10+
  131.                         720x540                     | VEGA VGA
  132.                 62h     800x600                     | VEGA VGA
  133.  16 color       71h     100x35 800x600              | NSI Smart EGA+
  134.                 74h     640x400 graphics            | Toshiba 3100
  135.                 7Eh     Special Mode Set            | Paradise VGA (see below)
  136.                         BX      horizontal dimension of the mode desired
  137.                         CX      vertical dimension of the mode desired
  138.                                 (both BX/CX in pixels for graphics modes, rows
  139.                                 for text modes)
  140.                         DX      number of colors of the mode desired
  141.                                 (use 0 for monochrome modes)
  142.                         return  BH      7Eh if successful
  143.                 7Fh     Special Function Set        | Paradise VGA (see below)
  144.                         BH      00h     Set VGA Operation
  145.                                 01h     Set Non-VGA Operation
  146.                                 02h     Query Mode Status
  147.                         return  BL      0       if operating in VGA mode
  148.                                         1       if non-VGA mode.
  149.                                 CH      total video RAM size in 64k byte units
  150.                                 CL      video RAM used by the current mode
  151.                                 03h  Lock Current Mode
  152.                                      Allows current mode (VGA or non-VGA) to
  153.                                      survive reboot.
  154.                         BH     0Ah,0Bh,0Ch,0Dh,0Eh,0Fh
  155.                                write paradise registers 0,1,2,3,4,5
  156.                                (port 03CEh indexes A,B,C,D,E,F)
  157.                         BL     value to set in the paradise register.
  158.                         BH     1Ah,1Bh,1Ch,1Dh,1Eh,1Fh
  159.                                read paradise registers 0,1,2,3,4,5
  160.                                (port 03CEh indexes A,B,C,D,E,F)
  161.                         return BL       value of the Paradise register
  162.                                BH       7Fh if successful.
  163.                         note   Color modes (0,1,2,3,4,5,6) will set non-VGA CGA
  164.                                operation. Monochrome mode 7 will set non-VGA
  165.                                MDA/Hercules operation.
  166.                 82h     80x25 B&W                   | AT&T VDC overlay mode *
  167.                 83h     80x25                       | AT&T VDC overlay mode *
  168.                 86h     640x200 B&W                 | AT&T VDC overlay mode *
  169.                 C0h     640x400   2/prog pallet     | AT&T VDC overlay mode *
  170.                 C4h     disable output              | AT&T VDC overlay mode *
  171.                 D0h     640x400                     | DEC VAXmate AT&T mode
  172.                 unknown 640x225                     | Z-100
  173.                 unknown 640x400                     | Z-100
  174.  
  175. note 1) If the high bit in AL is set, the display buffer is not cleared when a
  176.         new mode is selected. This may be used to mix modes on the display;
  177.         for example, characters of two difference sizes might be displayed
  178.      2) Modes 8-10 are available on the PCjr, Tandy 1000, and PS/2
  179.      3) IBM claims 100% software and hardware emulation of the CGA with the
  180.         MCGA chipset. All registers may be read and written as CGA. All
  181.         characters are double-scanned to give 80x25 with 400 line resolution.
  182.         The attributes for setting border color may be set on MCGA, but the
  183.         borders will remain the default color (they cannot actually be set)
  184.      4) The IBM Color Graphics Adapter (CGA) is too slow for the screen to
  185.         be updated before the vertical retrace of the monitor is completed.
  186.         If the video RAM is addressed directly, the screen will have "snow"
  187.         or interference. IBM's default is to turn the adapter off when it is
  188.         being updated, ie "flickering" when the display is scrolled.
  189.      5) The vertical retrace signal may be ignored when using the MCGA adapter.
  190.         The MCGA will not generate snow when written to. There is no flicker
  191.         with the MCGA.
  192.      6) The PCjr Video Gate Array uses a user-defined block of main system RAM
  193.         from 4 to 32k in size instead of having dedicated memory for the
  194.         display. Vertical retrace may be ignored when writing to the PCjr.
  195.         There is no flicker with the PCjr display.
  196.      7) The Hercules Graphics Card has 750x348 resolution
  197.      8) The Hercules Graphics Card takes 64k beginning at B:000 (same as MDA)
  198.      9) The CGA, MCGA, and VGA adapters use hardware address B:800
  199.     10) The BIOS clears the screen when the mode is set or reset.
  200.     11) For AT&T VDC overlay modes, BL contains the DEB mode, which may be 06h,
  201.         40h, or 44h
  202.     12) Int 10 will take the shapes of the first 128 characters (00h-7Fh) from
  203.         the table located in ROM at absolute address F000:FA6E. The EGA and VGA
  204.         have hardware capability to change this.
  205.  
  206.  
  207. Function 01h    Set Cursor Type - set the size of the cursor or turn it off
  208. entry   AH      01h
  209.         CH      bit values:
  210.                 bits 0-4  top line for cursor in character cell
  211.                 bits 5-6  blink attribute
  212.                           00    normal
  213.                           01    invisible (no cursor)
  214.                           10    slow      (not used on original IBM PC)
  215.                           11    fast
  216.         CL      bit values:
  217.                 bits 0-4  bottom line for cursor in character cell
  218. return  none
  219. note 1) The ROM BIOS default cursors are:  start    end
  220.                      monochrome mode 07h:    11     12
  221.                       text modes 00h-03h:     6      7
  222.      2) The blinking in text mode is caused by hardware and cannot be turned
  223.         off, though some kludges can temporarily fake a nonblinking cursor
  224.      3) The cursor is automatically turned off in graphics mode
  225.      4) Another method of turning off the cursor in text mode is to position it
  226.         to a nondisplayable address, such as (X,Y)=(0,25)
  227.      5) Buggy on EGA systems - BIOS remaps cursor shape in 43 line modes, but
  228.         returns unmapped cursor shape
  229.  
  230.  
  231. Function 02h    Set Cursor Position - reposition the cursor to (X,Y)
  232. entry   AH      02h
  233.         BH      video page
  234.                 00h     graphics mode
  235.                 03h     modes 2 and 3
  236.                 07h     modes 0 and 1
  237.         DH      row    (Y=0-24)
  238.         DL      column (X=0-79 or 0-39)
  239. return  none
  240. note 1) (0,0) is upper left corner of the screen
  241.  
  242.  
  243. Function 03h    Read Cursor Position - return the position of the cursor
  244. entry   AH      03h
  245.         BH      page number
  246.                 00h     in graphics modes
  247.                 03h     in modes 2 & 3
  248.                 07h     in modes 0 & 1
  249. return  CH      top line for cursor    (bits 4-0)
  250.         CL      bottom line for cursor (bits 4-0)
  251.         DH      row number    (Y=0-24)
  252.         DL      column number (X=0-79 or 0-39)
  253.  
  254.  
  255. Function 04h    Read Light Pen - fetch light pen information
  256. entry   AH      04h
  257. return  AH      00h     light pen not triggered
  258.         AH      01h     light pen is triggered, values in resgisters
  259.         BX      pixel column               (X=0-319 or 0-639)  graphics mode
  260.         CH      raster line                (Y=0-199)        old graphics modes
  261.         CX      (EGA) raster line (0-nnn)                   new graphics modes
  262.         DH      row of current position    (Y=0-24)            text mode
  263.         DL      column of current position (X=0-79 or 0-39)    text mode
  264. note    Not supported on PS/2
  265.  
  266.  
  267. Function 05h    Select Active Page - set page number for services 6 and 7
  268. entry   AH      05h
  269.         AL      number of new active page
  270.                 0-7     modes 00h and 01h (CGA)
  271.                 0-3     modes 02h and 03h (CGA)
  272.                 0-7     modes 02h and 03h (EGA)
  273.                 0-7     mode 0Dh (EGA)
  274.                 0-3     mode 0Eh (EGA)
  275.                 0-1     mode 0Fh (EGA)
  276.                 0-1     mode 10h (EGA)
  277.                 0       set address of graphics bitmap buffer (modes 60h,61h)
  278.                         BX      segment of buffer
  279.                 0Fh     get address of graphics bitmap buffer (modes 60h,61h)
  280.                         BX      segment of buffer
  281. for PCjr only:
  282.         AL      80h to read CRT/CPU page registers
  283.                 81h to set CPU page register to value in BL
  284.                 82h to set CRT page register to value in BH
  285.                 83h to set both CPU and page registers
  286.                     (and Corona/Cordata BIOS v4.10+)
  287.         BH      CRT page number for subfunctions 82h and 83h
  288.         BL      CPU page register for subfunctions 81h and 83h
  289. return  standard PC  none
  290.         PCjr         if called with AH bit 7=1 then
  291.                      BH      CRT page register (if AL >= 80h)
  292.                      BL      CPU page register (if AL >= 80h)
  293.         DX      segment of graphics bitmap buffer (video modes 60h,61h; AL=0Fh)
  294. note 1) Mono adapter has only one display page
  295.      2) CGA has four 80x25 text pages or eight 40x25 text pages
  296.      3) A separate cursor is maintained for each display page
  297.      4) Switching between pages does not affect their contents
  298.      5) Higher page numbers indicate higher memory positions
  299.  
  300.  
  301. Function 06h    Scroll Page Up - scroll up or clear a display "window"
  302. entry   AH      06h
  303.         AL      number of lines blanked at bottom of page
  304.                 0 = blank entire window
  305.         BH      attributes to be used on blank line
  306.         CH      row    (Y) of upper left corner or window
  307.         CL      column (X) of upper left corner of window
  308.         DH      row    (Y) of lower right corner of window
  309.         DL      column (X) of lower right corner of window
  310. return  none
  311. note 1) Push BP before scrolling, pop after
  312.      2) If in CGA text mode, affects current page only
  313.  
  314.  
  315. Function 07h    Scroll Page Down - scroll down or clear a display "window"
  316. entry   AH      07h
  317.         AL      number of lines to be blanked at top of page
  318.                 0 = blank entire window
  319.         BH      attributes to be used on blank line
  320.         CH      row    (Y) of upper left corner or window
  321.         CL      column (X) of upper left corner of window
  322.         DH      row    (Y) of lower right corner of window
  323.         DL      column (X) of lower right corner of window
  324. return  none
  325. note 1) Push BP before scrolling, pop after
  326.      2) If in CGA text mode, affects current page only
  327.  
  328.  
  329. Function 08h    Read Character Attribute - of character at current cursor pos.
  330. entry   AH      08h
  331.         BH      display page number - text mode
  332. return  AH      character attribute - text mode
  333.         AL      ASCII code of character at current cursor position
  334.  
  335.  
  336. Function  09h   Write Character and Attribute - at current cursor position
  337. entry   AH      09h
  338.         AL      ASCII code of character to display
  339.         BH      display page number - text mode
  340.         BL      attribute/color of character
  341.         CX      number of characters to write
  342. return  none
  343. note 1) CX should not exceed actual rows availible, or results may be erratic
  344.      2) Setting CX to zero will cause runaway
  345.      3) All values of AL result in some sort of display; the various control
  346.         characters are not recognized as special and do not change the current
  347.         cursor position
  348.      4) Does not change cursor position when called - the cursor must be
  349.         advanced with int 10 function 0Ah.
  350.      5) If used to write characters in graphics mode with bit 7 of AH set to 1
  351.         the character will by XORed with the current display contents.
  352.      6) In graphics mode the bit patterns for ASCII character codes 80h-0FFh
  353.         are obtained from a table. On the standard PC and AT, the location is at
  354.         interrupt vector 01Fh (0000:007C). For ASCII characters 00h-07Fh, the
  355.         table is at an address in ROM. On the PCjr the table is at interrupt
  356.         vector 44h (0000:00110) and is in addressable RAM (may be replaced by
  357.         the user)
  358.      7) All characters are displayed, including CR, LF, and BS
  359.  
  360.  
  361. Function 0Ah    Write Character - display character(s) (use current attribute)
  362. entry   AH      0Ah
  363.         AL      ASCII code of character to display
  364.         BH      display page - text mode
  365.         BL      color of character (graphics mode, PCjr only)
  366.         CX      number of times to write character
  367. return  none
  368. note 1) CX should not exceed actual rows availible, or results may be erratic
  369.      2) All values of AL result in some sort of display; the various control
  370.         characters are not recognized as special and do not change the current
  371.         cursor position
  372.      3) If used to write characters in graphics mode with bit 7 of AH set to 1
  373.         the character will by XORed with the current display contents.
  374.      4) In graphics mode the bit patterns for ASCII character codes 80h-0FFh
  375.         are obtained from a table. On the standard PC and AT, the location is at
  376.         interrupt vector 01Fh (0000:007C). For ASCII characters 00h-07Fh, the
  377.         table is at an address in ROM. On the PCjr the table is at interrupt
  378.         vector 44h (0000:00110) and is in addressable RAM (may be replaced by
  379.         the user)
  380.      5) In EGA in graphics modes, replication count in CX works correctly only
  381.         if all characters written are contained on the same row
  382.      6) All characters are displayed, including CR, LF, and BS
  383.  
  384.  
  385. Function 0Bh    Set Color Palette - set palette for graphics or text border
  386. entry   AH      0Bh
  387.         BH      00h     select border (text mode)
  388.         BL      color 0-15, 16-31 for high-intensity characters
  389.         BH      01h     set graphics palette with value in BL
  390.  (CGA)  BL      0       green/red/yellow
  391.                 1       cyan/magenta/white
  392.  (EGA) (graphics modes)
  393.         BH      0
  394.         BL      has border color (0-15) & high intensity bkgr'd color (16-31)
  395.         BH      1
  396.         BL      contains palette being selected (0-1)
  397. return  none
  398. note 1) Valid in CGA mode 04h, PCjr modes 06h, 08h-0Ah
  399.       2) Although the registers in the MCGA may be set as if to change the
  400.         border, the MCGA will not display a border no matter what register
  401.         settings are used.
  402.  
  403.  
  404. Function 0Ch    Write Dot - plot one graphics pixel
  405. entry   AH      0Ch
  406.         AL      dot color code  (0/1 in mode 6, 0-3 in modes 4 and 5)
  407.                 (set bit 7 to XOR the dot with current color)
  408.                 0-3 mode 04h, 05h
  409.                 0-1 mode 06h
  410.         BH      page number (ignored if adapter supports only one page)
  411.         CX      column (X=0000h - 027Fh)
  412.                 (0 - 319 in modes 4,5,13,  0 - 639 in modes 6,14,15,16)
  413.         DX      row    (Y=0000h - 00C7h) (0 - 199 CGA)
  414. return  none
  415. note    Video graphics modes 4-6 only
  416.  
  417.  
  418. Function 0Dh    Read Dot - determine the color of one graphics pixel
  419. entry   AH      0Dh
  420.         CX      column (X=0000h - 027Fh)  (0-319 or 639)
  421.         DX      row    (Y=0000h - 00C7h)  (0-199)
  422. return  AL      color of dot
  423. note    Only valid in graphics mode
  424.  
  425.  
  426. Function 0Eh    Write TTY - write one character and update cursor. Also handles
  427.                 CR (0Dh), beep (07h), backspace (10h), and scrolling
  428. entry   AH      0Eh
  429.         AL      ASCII code of character to be written
  430.         BH      page number (text)
  431.         BL      foreground color (video modes 6 & 7 only) (graphics)
  432. return  none
  433. note 1) The ASCII codes for bell, backspace, carriage return, and linefeed are
  434.         recognized and appropriate action taken. All other characters are
  435.         written to the screen and the cursor is advanced to the next position
  436.      2) Text can be written to any CGA page regardless of current active page
  437.      3) Automatic linewrap and scrolling are provided through this function
  438.      4) This is the function used by the DOS CON console driver.
  439.      5) This function does not explicitly allow the use of attributes to the
  440.         characters written. Attributes may be provided by first writing an ASCII
  441.         27h (blank) with the desired attributes using function 09h, then
  442.         overwriting with the actual character using this function. While clumsy
  443.         this allows use of the linewrap and scrolling services provided by
  444.         this function
  445.  
  446.  
  447. Function 0Fh    Return Current Video State - mode and size of the screen
  448. entry   AH      0Fh
  449. return  AH      number of character columns on screen
  450.         AL      mode currently set (see AH=00h for display mode codes)
  451.         BH      current active display page
  452. note    If mode was set with bit 7 set ("no blanking"), the returned mode will
  453.         also have bit 7 set
  454.  
  455.  
  456. Function 10h    Set Palette Registers       (PCjr, Tandy 1000, EGA, MCGA, VGA)
  457. entry   AH      10h
  458.         AL      00h     set individual palette register
  459.                         BH      color value to store
  460.                         BL      palette register to set
  461.                                 (on MCGA, only BX = 0712h is supported)
  462.                 01h     set border color palette register
  463.                         BH      color value to store
  464.                 02h             set all palette registers and overscan
  465.                         ES:DX   pointer to 17-byte list
  466.                                 bytes 0-15   values for palette regs. 0-15
  467.                                 byte 16      value for border color register
  468.                 03h     toggle blink/intensity bit     (Jr, EGA, MCGA, VGA)
  469.                         BL      00h     enable intensity
  470.                                 01h     enable blink
  471.                 04h     unknown
  472.                 05h     unknown
  473.                 06h     unknown
  474.                 07h     read individual palette register                 (VGA)
  475.                         BL      palette register number
  476.                 return  BH      palette register value
  477.                 08h     read overscan (order color) register             (VGA)
  478.                 return  BH      value
  479.                 09h     read all palette registers and overscan register (VGA)
  480.                         ES:DX   pointer to buffer address (17 bytes)
  481.                 10h     set individual video DAC color register    (MCGA, VGA)
  482.                         BX      register number
  483.                         CH      new value for green (0-63)
  484.                         CL      new value for blue (0-63)
  485.                         DH      new value for red (0-63)
  486.                 11h     unknown
  487.                 12h     set block of video DAC color registers     (MCGA, VGA)
  488.                         BX      starting color register
  489.                         CX      number of registers to set
  490.                         ES:DX   table of 3*CX bytes where each 3 byte group
  491.                                 represents one byte each of red, green and
  492.                                 blue (0-63)
  493.                 13h     set video DAC color page                         (VGA)
  494.                         BH      00h     select 4 blocks of 64
  495.                         BH      01h     select 16 blocks of 16
  496.                         BL      00h     select paging mode
  497.                         BL      01h     select Page
  498.                         BH      page number (00h to 03h) or (00h to 0Fh)
  499.                                 (not valid in mode 13h)
  500.                 14h     unknown
  501.                 15h     read individual video DAC color register   (MCGA, VGA)
  502.                         BL      palette register number
  503.                 return  DH      red value
  504.                         CH      green value
  505.                         CL      blue value
  506.                 16h     unknown
  507.                 17h     read block of video DAC color registers    (MCGA, VGA)
  508.                         BX      starting palette register
  509.                         CX      number of palette registers to read
  510.                         ES:DX   buffer (3 * CX bytes in size)
  511.                 return  CX number of red, green and blue triples in buffer
  512.                 18h     *UNDOCUMENTED* set PEL mask
  513.                         BL      new PEL value
  514.                 19h     *UNDOCUMENTED* read PEL mask
  515.                         BL      value read
  516.                 1Ah     read video DAC color-page state                  (VGA)
  517.                 return  BL      paging mode
  518.                                 0       four pages of 64
  519.                                 1       sixteen pages of 16
  520.                         BH      current page
  521.                 1Bh     perform gray-scale summing                 (MCGA, VGA)
  522.                         BX      starting palette register
  523.                         CX      number of registers to convert
  524.  
  525.         BH      color value
  526.         BL      if AL=00h       palette register to set (00h-0Fh)
  527.                 if AL=03h       0       to enable intensity
  528.                                 1       to enable blinking
  529.         ES:DX   if AL=02h       pointer to 16-byte table of register values
  530.                                 followed by the overscan value:
  531.                                 bytes 0-15     values for palette registers 0-15
  532.                                 byte 16        value for border register
  533. return  none
  534. note    DAC is Digital to Analog Convertor circuit in MCGA/VGA chips
  535.  
  536.  
  537. Function 11h    Character Generator Routine (EGA and after)
  538. entry   AH      11h
  539.                 The following functions will cause a mode set, completely
  540.                 resetting the video environment, but without clearing the video
  541.                 buffer.
  542.         AL      00h, 10h  load user-specified patterns
  543.                         BH      number of bytes per character pattern
  544.                         BL      block to load in map 2
  545.                         CX      count of patterns to store
  546.                         DX      character offset into map 2 block
  547.                         ES:BP   pointer to user table
  548.                 01h, 11h  load ROM monochrome patterns (8 by 14)
  549.                         BL      block to load
  550.                 02h, 12h  load ROM 8 by 8 double-dot patterns
  551.                         BL      block to load
  552.                 03h       set block specifier
  553.                         BL      block specifier
  554.                (EGA/MCGA) bits 0,1   = block selected by chars with attribute
  555.                           bit  3     = 0
  556.                           bits 2,3   = block selected by chars with attribute
  557.                           bit  3     = 1
  558.                (VGA)      bits 0,1,4 = block selected by attribute bit 3 = 0
  559.                           bits 2,3,5 = block selected by attribute bit 3 = 1
  560.                 04h,14h   load 8x16 text character set (MCGA, VGA)
  561.                           The routines called with AL=1x are designed to be
  562.                           called only immediately after a mode set and are
  563.                           similar to the routines called with AL=0x, except
  564.                           that:
  565.                           Page 0 must be active.
  566.                           Bytes/character is recalculated.
  567.                           Max character rows is recalculated.
  568.                           CRT buffer length is recalculated.
  569.                           CRTC registers are reprogrammed as follows:
  570.                           reg09h    bytes/char-1; max scan line (mode 7 only)
  571.                           reg0Ah    bytes/char-2; cursor start
  572.                           reg0Bh    0           ; cursor end
  573.                           reg12h    ((rows+1)*(bytes/char))-1
  574.                                                 ; vertical display end
  575.                           reg14h    bytes/char  ; underline loc
  576.                                     (* BUG: should be 1 less *)
  577.  
  578.                         The following functions are meant to be called only
  579.                        after a mode set:
  580.                 20h     user 8 by 8 graphics characters (int 1Fh)
  581.                         ES:BP   pointer to user table
  582.                 21h     user graphics characters
  583.                         ES:BP   pointer to user table
  584.                         CX      bytes per character
  585.                         BL      row specifier
  586.                                 0       user set
  587.                                         DL      number of rows
  588.                                 1       14 rows
  589.                                 2       25 rows
  590.                                 3       43 rows
  591.                 22h     ROM 8 by 14 set
  592.                         BL      row specifier
  593.                 23h     ROM 8 by 8 double dot
  594.                         BL      row specifier
  595.                 24h     load 8x16 graphics characters (MCGA, VGA)
  596.                         BL      row specifier
  597.  
  598.                 30h     Get Font Information          (EGA, MCGA, VGA)
  599.                         BH      pointer specifier
  600.                                 0       int 1Fh pointer
  601.                                 1       int 44h pointer
  602.                                 2       ROM 8 by 14 character font pointer
  603.                                 3       ROM 8 by 8 double dot font pointer
  604.                                 4       ROM 8 by 8 DD font (top half)
  605.                                 5       ROM text alternate (9 by 14) pointer
  606. return  ES:BP   specified pointer value
  607.         CX      bytes/character
  608.         DL      character rows on screen
  609.  
  610.  
  611. Function 12h    Alternate Select (EGA and after)
  612. entry   AH      12h
  613.         BL      10h     return EGA information
  614.                 return  BH      00h     if color mode is in effect (3Dx)
  615.                                 01h     if mono mode is in effect (3Dx)
  616.                         BL      00h     if 64k EGA memory
  617.                                 01h     if 128k EGA memory
  618.                                 02h     if 192k EGA memory
  619.                                 03h     if 256k EGA memory
  620.                         CH      feature bits
  621.                         CL      switch settings
  622.                 20h     select alternate print screen routine
  623.                 30h     select vertical resolution for text modes       (VGA)
  624.                         AL      00h     200 scan lines
  625.                                 01h     350 scan lines
  626.                                 02h     400 scan lines
  627.                 return  AL      12h if function supported
  628.                 31h     enable/disable default palette loading    (MCGA, VGA)
  629.                         AL      00h     enable default palette loading
  630.                                 01h     disable default palette loading
  631.                 return  AL      12h if function was supported
  632.                 32h     enable/disable video addressing           (MCGA, VGA)
  633.                         AL      00h     enable video
  634.                                 01h     disable video
  635.                 return  AL      12h if function was supported
  636.                 33h     enable/disable default gray scale summing (MCGA, VGA)
  637.                         AL      00h     enable gray scale summing
  638.                                 01h     disable gray scale summing
  639.                 return  AL      12h if function was supported
  640.                 34h     enable/disable text cursor emulation            (VGA)
  641.                         AL      00h     enable cursor emulation
  642.                                 01h     disable cursor emulation
  643.                 return  AL      12h if function was supported
  644.                 35h     display-switch interface                        (PS/2)
  645.                         AL      00h     initial adapter video off
  646.                                 01h     initial planar video on
  647.                                 02h     switch active video off
  648.                                 03h     switch inactive video on
  649.                                 80h     *undocumented* set system board video
  650.                                         active flag
  651.                         ES:DX   buffer (128 byte save area if AL = 0, 2 or 3)
  652.                 return  AL      12h if function was supported
  653.                 36h     video refresh control                           (VGA)
  654.                         AL      00h     enable refresh
  655.                                 01h     disable refresh
  656.                 return  AL      12h     if function supported
  657.                         BX      5500h   (used by ATI and TAXAN)
  658.                         BX      5502h   (used by ATI and TAXAN)
  659.  
  660.  
  661. Function 13h    Enhanced String Write                        (AT, XT/286, PS/2)
  662. entry   AH      13h
  663.         AL      00h     Write String, Don't Move Cursor 
  664.                 01h     Write String, Move Cursor
  665.                 02h     Write String of Alternating Characters and Attributes;
  666.                         Don't Move Cursor
  667.                         bit 0: set in order to move cursor after write
  668.                         bit 1: set if string contains alternating chars and
  669.                                attributes
  670.                 03h     Write String of Alternating Characters and Attributes;
  671.                         Move Cursor
  672.                         bit 0: set in order to move cursor after write
  673.                         bit 1: set if string contains alternating characters
  674.                                and attributes
  675.         BH      display page number
  676.         BL      attribute if AL bit 1 clear
  677.         CX      length of string
  678.         DH      row of starting cursor position
  679.         DL      column of starting cursor position
  680.         ES:BP   pointer to start of string
  681. return  none
  682. note    Recognizes CR, LF, BS, and bell
  683.  
  684.  
  685. Function 14h    Load LCD Character Font                      (Convertible)
  686. entry   AH      14h
  687.         AL      00h     load user specified font
  688.                 BH      number of bytes per character
  689.  
  690.                 BL      00h     load main font (block 0)
  691.                         01h     load alternate font (block 1)
  692.                 CX      number of characters to store
  693.                 DX      character offset into RAM font area
  694.                 ES:DI   pointer to character font
  695.         AL      01h     load system ROM default font
  696.         BL      00h     load main font (block 0)
  697.                 01h     load alternate font (block 1)
  698.         AL      02h     set mapping of LCD high intensity attribute
  699.         BL      00h     ignore high intensity attribute
  700.                 01h     map high intensity to underscore
  701.                 02h     map high intensity to reverse video
  702.                 03h     map high intensity to seleected alternate font
  703. return  unknown
  704.  
  705.  
  706. Function 15h    Return Physical Display Parameters           (Convertible)
  707. entry   AH      15h
  708. return  AX      Alternate display adapter type
  709.         ES:DI   pointer to parameter table:
  710.                 word #  information
  711.                 01h     monitor model number
  712.                 02h     vertical pixels per meter
  713.                 03h     horizontal pixels per meter
  714.                 04h     total number of vertical pixels
  715.                 05h     total number of horizontal pixels
  716.                 06h     horizontal pixel separation in micrometers
  717.                 07h     vertical pixel separation in micrometers
  718.  
  719.  
  720. Function 1Ah    Display Combination Code                     (MCGA, VGA)
  721.                 Using the compatibility BIOS of the PS/2 Models 50, 60, 80 there
  722.                 is a way to determine which video controller and attached
  723.                 display are on the system.  The Display Combination Code (DCC)
  724.                 is a Video BIOS function that provides the capability.
  725. entry   AH      1Ah
  726.         AL      00h     read display combination code
  727.                 01h     write display combination code
  728. return  AL      1Ah     indicates Compatibility BIOS is supported,
  729.                         any other value is invalid
  730.         BH      Display Combination Code (DCC)
  731.                 00h     no display
  732.                 01h     IBM monochrome adapter and display
  733.                 02h     IBM color/graphics monitor adapter w/color display
  734.                 03h     reserved
  735.                 04h     IBM EGA, color display
  736.                 05h     IBM EGA, monochrome display
  737.                 06h     IBM PGA, color display
  738.                 07h     VGA, analog monochrome display
  739.                 08h     VGA, analog color display
  740.                 09h     reserved
  741.                 0Ah     MCGA, digital color display
  742.                 0Bh     MCGA, analog monochrome display
  743.                 0Ch     MCGA, analog color display
  744.                 0FFh    unknown display type
  745.         BL      active display device code
  746. note    This function may be used to test for VGA, since it is not supported in
  747.         earlier adapters. If AL is still 1Ah when the call completes, a VGA
  748.         compatible adapter is present.
  749.  
  750.  
  751. Function 1Bh    Functionality/State Information              (MCGA, VGA)
  752. entry   AH      1Bh
  753.         BX      implementation type
  754.                 0000h return funtionality/state information
  755.         ES:DI   pointer to 64 byte buffer
  756. return  AL      1Bh if function supported
  757.         ES:DI   buffer filled
  758.                 00h     address of functionality table
  759.                 01h     unknown
  760.                 02h     unknown
  761.                 03h     unknown
  762.                 04h     current video mode
  763.                 05h     number of columns
  764.                 06h     unknown
  765.                 07h     length of regen buffer in bytes
  766.                 09h     starting address of regen buffer
  767.                 0Bh     cursor position for page 0
  768.                 0Dh     cursor position for page 1
  769.                 0Fh     cursor position for page 2
  770.                 11h     cursor position for page 3
  771.                 13h     cursor position for page 4
  772.                 15h     cursor position for page 5
  773.                 17h     cursor position for page 6
  774.                 19h     cursor position for page 7
  775.                 1Bh     cursor type
  776.                 1Dh     active display page
  777.                 1Eh     CRTC port address
  778.                 20h     current setting of register (3?8)
  779.                 21h     current setting of register (3?9)
  780.                 22h     number of rows
  781.                 23h     bytes/character
  782.                 25h     DCC of active display
  783.                 26h     DCC of alternate display
  784.                 27h     number of colors supported in current mode
  785.                 29h     number of pages supported in current mode
  786.                 2Ah     number of scan lines active
  787.                         (0,1,2,3) = (200,350,400,480)
  788.                 2Bh     primary character block
  789.                 2Ch     secondary character block
  790.                 2Dh     miscellaneous flags byte
  791.                         bit 0 all modes on all displays on
  792.                             1 gray summing on
  793.                             2 monochrome display attached
  794.                             3 default palette loading disabled
  795.                             4 cursor emulation enabled
  796.                             5 0=intensity; 1=blinking
  797.                             6 reserved
  798.                             7 reserved
  799.                 2Eh to 30h reserved
  800.                 31h     video memory available
  801.                         00h=64K, 01h=128K, 02h=192K, 03h=256K
  802.                 32h     save pointer state flags byte
  803.                         bit 0 512 character set active
  804.                             1 dynamic save area present
  805.                             2 alphanumeric font override active
  806.                             3 graphics font override active
  807.                             4 palette override active
  808.                             5 DCC override active
  809.                             6 reserved
  810.                             7 reserved
  811.                 33h to 3Fh  reserved
  812. note    State Functionality Table format (16 bytes)
  813.         00h     modes supported #1
  814.                 bit 0 to bit 7 = 1 modes 0,1,2,3,4,5,6 supported
  815.         01h     modes supported #2
  816.                 bit 0 to bit 7 = 1 modes 8,9,A,B,C,D,E,F supported
  817.         02h     modes supported #3
  818.                 bit 0 to bit 3 = 1 modes 10,11,12,13 supported
  819.                 bit 4 to bit 7 reserved
  820.         03h to 06h reserved
  821.         07h     scan lines supported
  822.                 bit 0 to bit 2 = 1 if scan lines 200,350,400 supported
  823.         08h     total number of character blocks available in text modes
  824.         09h     maximum number of active character blocks in text modes
  825.         0Ah     miscellaneous function flags #1
  826.                 bit 0 all modes on all displays function supported
  827.                     1 gray summing function supported
  828.                     2 character font loading function supported
  829.                     3 default palette loading enable/disable supported
  830.                     4 cursor emulation function supported
  831.                     5 EGA palette present
  832.                     6 color palette present
  833.                     7 color paging function supported
  834.         0Bh     miscellaneous function flags #2
  835.                 bit 0 light pen supported
  836.                     1 save/restore state function 1Ch supported
  837.                     2 intensity blinking function supported
  838.                     3 Display Combination Code supported
  839.                     4-7 reserved
  840.         0Ch to 0Dh reserved
  841.         0Eh     Save pointer function flags
  842.                 bit 0 512 character set supported
  843.                     1 dynamic save area supported
  844.  
  845.                     2 text font override supported
  846.                     3 graphics font override supported
  847.                     4 palette override supported
  848.                     5 DCC extension supported
  849.                     6 reserved
  850.                     7 reserved
  851.         0Fh     reserved
  852.  
  853.  
  854. Function 1Ch    Save/Restore Video State                     (VGA)
  855. entry   AH      1Ch
  856.         AL      00h     return state buffer size
  857.                 01h     save video state
  858.                         ES:BX   buffer address
  859.                 02h     restore video state
  860.                         ES:BX   buffer address of previously saved state
  861.         CX      requested states
  862.                 bit  0      video hardware
  863.                      1      BIOS data areas
  864.                      2      color registers and DAC state
  865.                      3-15   reserved
  866. return  AL      1Ch if function supported
  867.         BX      number of 64 byte blocks needed (function 00h)
  868. note    VGA only
  869.  
  870.  
  871. Function 40h    Set Graphics Mode (Hercules Graphics Card Plus)
  872. entry   AH      40h
  873. return  unknown
  874.  
  875.  
  876. Function  41h   Set Text Mode (Hercules Graphics Card Plus)
  877. entry   AH      41h
  878. return  unknown
  879.  
  880.  
  881. Function 42h    Clear Current Page (Hercules Graphics Card Plus)
  882. entry   AH      42h
  883. return  unknown
  884.  
  885.  
  886. Function 43h    Select Drawing Page (Hercules Graphics Card Plus)
  887. entry   AH      43h
  888.         AL      page number (0,1)
  889. return  unknown
  890.  
  891.  
  892. Function 44h    Select Drawing Function (Hercules Graphics Card Plus)
  893. entry   AH      44h
  894.         AL      0       clear pixels
  895.                 1       set pixels
  896.                 2       invert pixels
  897. return  unknown
  898.  
  899.  
  900. Function 45h    Select Page to Display (Hercules Graphics Card Plus)
  901. entry   AH      45h
  902.         AL      page number (0,1)
  903. return  unknown
  904.  
  905.  
  906. Function 46h    Draw One Pixel (Hercules Graphics Card Plus)
  907. entry   AH      46h
  908.         DI      x       (0-720)
  909.         BP      y       (0-347)
  910. return  unknown
  911. note    Function 44h determines operation and function 43h which page to use.
  912.  
  913.  
  914. Function 47h    Find Pixel Value (Hercules Graphics Card Plus)
  915. entry   AH      47h
  916.         DI      x       (0-720)
  917.         BP      y       (0-347)
  918. return  AL      0       pixel clear
  919.                 1       pixel set
  920. note    Function 43h specifies page that is used.
  921.  
  922.  
  923. Function 48h    Move to Point (Hercules Graphics Card Plus)
  924. entry   AH      48h
  925.         DI      x       (0-720)
  926.         BP      y       (0-347)
  927. return  unknown
  928.  
  929.  
  930. Function 49h    Draw to Point (Hercules Graphics Card Plus)
  931. entry   AH      49h
  932.         DI      x       (0-720)
  933.         BP      y       (0-347)
  934. return  unknown
  935. note    Function 48h or 49h specify first point, 44h operation and 43h page
  936.         to use.
  937.  
  938.  
  939. Function 4Ah    Block Fill (Hercules Graphics Card Plus)
  940. entry   AH      4Ah
  941. return  unknown
  942.  
  943.  
  944. Function 4Bh    Display Character (Hercules Graphics Card Plus)
  945. entry   AH      4Bh
  946.         AL      ASCII code for character to display
  947.         DI      x       (0-720)
  948.         BP      y       (0-347)
  949. return  unknown
  950. note    Unlike the other BIOS character functions character position is
  951.         specified in pixels rather than rows and columns.
  952.  
  953.  
  954. Function 4Ch    Draw Arc (Hercules Graphics Card Plus)
  955. entry   AH      4Ch
  956. return  unknown
  957.  
  958.  
  959. Function 4Dh    Draw Circle (Hercules Graphics Card Plus)
  960. entry   AH      4Dh
  961. return  unknown
  962.  
  963.  
  964. Function 4Eh    Fill Area (Hercules Graphics Card Plus)
  965. entry   AH      4Eh
  966. return  unknown
  967.  
  968.  
  969. Function 6Ah    Direct Graphics Interface Standard (DGIS)
  970. entry   AH      6Ah
  971.         AL      00h     Inquire Available Devices
  972.                         BX      0
  973.                         CX      0
  974.                         DX      buffer length (may be 0)
  975.                         ES:DI   address of buffer
  976.                 return  BX      number of bytes stored in buffer
  977.                         CX      bytes req'd for all descriptions (0 if no DGIS)
  978.                 note    Buffer contains descriptions and addresses of DGIS-
  979.                         compatible display(s) and printer(s)
  980.                 01h     Redirect Character Output
  981.                         CX      0
  982.                         ES:DI   address of device to send INT 10 output to
  983.                 return  CX      0    output could not be redirected
  984.                             else INT 10h output now routed to requested display
  985.                 02h     Inquire int 10 Output Device
  986.                         ES:DI   0:0
  987.                 return  ES:DI   0:0  if current display is non-DGIS
  988.                                 else address of the current DGIS INT 10 display
  989.  
  990.  
  991. Function 6Fh    Set Video Mode (VEGA Extended EGA/VGA)
  992. entry   AH      6F
  993.         AL      05h
  994.         BL      mode|     (graphics mode if graphics resolution listed)
  995.                     | text |pixel| graphic|color|disp|scrn| system
  996.                     | resol|box  |resoltn |     |page|addr|
  997.                 62h               800x600   16              VEGA Extended EGA
  998.                 65h              1024x768   16              VEGA Extended EGA
  999.                 66h               640x400  256              VEGA Extended VGA
  1000.                 67h               640x480  256              VEGA Extended VGA
  1001.                 68h               720x540  256              VEGA Extended VGA
  1002.                 69h               800x600  256              VEGA Extended VGA
  1003.  
  1004.  
  1005. Function 70h    Get Video RAM Address                        (Tandy 1000)
  1006. entry   AH      70h
  1007. return  AX      segment addresses of the following
  1008.                 BX      offset address of green plane
  1009.                 CX      segment address of green plane
  1010.                 DX      segment address of red/blue plane
  1011. note    (red offset = 0, blue offset = 4000)
  1012.  
  1013.  
  1014. Function 71h    Get INCRAM Addresses                         (Tandy 1000)
  1015. entry   AH      71h
  1016. return  AX      segment address of the following
  1017.                 BX      segment address of INCRAM
  1018.                 CX      offset address of INCRAM
  1019.  
  1020.  
  1021. Function 72h    Scroll Screen Right                          (Tandy 1000)
  1022. entry   AH      72h
  1023.         AL      number of columns blanked at left of page
  1024.                 00h     blank window
  1025.         BH      attributes to be used on blank columns
  1026.         CH,CL   row, column address of upper left corner
  1027.         DH,DL   row, column address of lower right corner
  1028.  
  1029.  
  1030. Function 73h    Scroll Screen Left                           (Tandy 1000)
  1031. entry   AH      73h
  1032.         AL      number of columns blanked at right of page
  1033.                 00h     blank window
  1034.         BH      attributes to be used on blank columns
  1035.         CH,CL   row, column address of upper left corner
  1036.         DH,DL   row, column address of lower right corner
  1037.  
  1038.  
  1039. Function 80h    DESQview - Set (something)
  1040. entry   AH      80h 
  1041.         DX      4456h ('DV')
  1042.         ES:DI   pointer to FAR subroutine to be called on?
  1043. return  DS      segment of DESQview data structure for video buffer
  1044. note 1) This function is probably meant for internal use only, due to the magic
  1045.         value required in DX
  1046.      2) The subroutine seems to be called when the DESQview menu is accessed
  1047.         on entry, AL = 03h or 04h
  1048.  
  1049.  
  1050. Function 81h    DESQview video - Get something?
  1051. entry   AH      81h
  1052.         DX      4456h ('DV')
  1053. return  ES    segment of DESQview data structure for video buffer
  1054.         byte ES:[0] = current window number
  1055. note    This function is probably meant for internal use only, due to the
  1056.         magic value required in DX
  1057.  
  1058.  
  1059. Function 82h    DESQview - Get Current Window Info
  1060. entry   AH      82h
  1061.         DX      4456h ('DV')
  1062. return  AH      unknown
  1063.         AL      current window number
  1064.         BH      unknown
  1065.         BL      direct screen writes
  1066.                 0       program does not do direct writes
  1067.                 1       program does direct writes, so shadow buffer not usable
  1068.         CH      unknown
  1069.         CL      current video mode
  1070.         DS      segment in DESQview for data structure
  1071.                 in DV 2.00,
  1072.                   byte DS:[0] = window number
  1073.                   word DS:[1] = segment of other data structure
  1074.                   word DS:[3] = segment of window's object handle
  1075.         ES      segment of DESQview data structure for video buffer
  1076. note    This function is probably meant for internal use only, due to the magic
  1077.         value required in DX
  1078.  
  1079.  
  1080. Function 0F0h   Microsoft Mouse driver EGA support - Read One Register
  1081. entry   AH      0F0h
  1082.         BL      register number
  1083.         DX      group index
  1084.                 (pointer/data chips)
  1085.                 00h     CRT Controller (25 reg) 3B4h mono, 3D4h color
  1086.                 08h     sequencer (5 registers) 3C4h
  1087.                 10h     graphics controller (9 registers) 3CEh
  1088.                 18h     attribute controller (20 registers) 3C0h
  1089.                 (single registers)
  1090.                 20h     miscellaneous output register 3C2h
  1091.                 28h     feature control register (3BAh mono, 3DAh color
  1092.                 30h     graphics 1 position register 3CCh
  1093.                 38h     graphics 2 position register 3CAh
  1094. return  BL      data
  1095.  
  1096.  
  1097. Function 0F1h   Microsoft Mouse driver EGA support - Write One Register
  1098. entry   AH      0F1h
  1099.         DX      group index (see function F0h)
  1100.         BL      register number
  1101.         BH      value to write
  1102. return  BL      data
  1103.  
  1104.  
  1105. Function 0F2h   Microsoft Mouse driver EGA support - Read Register Range
  1106. entry   AH      0F2h
  1107.         CH      starting register number
  1108.         CL      number of registers (>1)
  1109.         DX      group index
  1110.                 00h     CRTC (3B4h mono modes, 3D4h color modes)
  1111.                 08h     sequencer 3C4h
  1112.                 10h     graphics controller 3CEh
  1113.                 18h     attribute controller 3C0h
  1114.         ES:BX   pointer to buffer, CL bytes
  1115.  
  1116.  
  1117. Function 0F3h   Microsoft Mouse driver EGA support - Write Register Range
  1118. entry   AH      0F3h
  1119.         CH      starting register
  1120.         CL      number of registers (>1)
  1121.         DX      group index
  1122.                 00h     CRTC (3B4h mono modes, 3D4h color modes)
  1123.                 08h     sequencer 3C4h
  1124.                 10h     graphics controller 3CEh
  1125.                 18h     attribute controller 3C0h
  1126.         ES:BX   pointer to buffer, CL bytes
  1127.  
  1128.  
  1129. Function 0F4h   Microsoft Mouse driver EGA support - Read Register Set
  1130. entry   AH      0F4h
  1131.         CX      number of registers (>1)
  1132.         ES:BX   pointer to table of records in this format:
  1133.           bytes 1-2 group index
  1134.                 (pointer/data chips)
  1135.                 00h     CRTC (3B4h mono modes, 3D4h color modes)
  1136.                 08h     sequencer 3C4h
  1137.                 10h     graphics controller 3CEh
  1138.                 18h     attribute controller 3C0h
  1139.                 (single registers)
  1140.                 20h     miscellaneous output register 3C2h
  1141.                 28h     feature control register (3BAh mono modes, 3DAh color)
  1142.                 30h     graphics 1 position register 3CCh
  1143.                 38h     graphics 2 position register 3CAh
  1144.          byte 3 register number (0 for single registers)
  1145.          byte 4 register value
  1146.  
  1147.  
  1148. Function 0F5h   Microsoft Mouse driver EGA support - Read Register Set
  1149. entry   AH      0F5h
  1150.         CX      number of registers (>1)
  1151.         ES:BX   pointer to table of records in this format:
  1152.           bytes 1-2 group index
  1153.                 (pointer/data chips)
  1154.                 00h     CRTC (3B4h mono modes, 3D4h color modes)
  1155.                 08h     sequencer 3C4h
  1156.                 10h     graphics controller 3CEh
  1157.                 18h     attribute controller 3C0h
  1158.                 (single registers)
  1159.                 20h     miscellaneous output register 3C2h
  1160.                 28h     feature control register (3BAh mono modes, 3DAh color)
  1161.                 30h     graphics 1 position register 3CCh
  1162.                 38h     graphics 2 position register 3CAh
  1163.          byte 3 register number (0 for single registers)
  1164.          byte 4 register value
  1165.  
  1166.  
  1167. Function 0F6h   Microsoft Mouse driver EGA support
  1168.                 Revert to Default Registers
  1169. entry   AH      0F6h
  1170. return  unknown
  1171.  
  1172.  
  1173. Function 0F7h   Microsoft Mouse driver EGA support
  1174.                 Define Default Register Table
  1175. entry   AH      0F7h
  1176.         DX      port number
  1177.         ES:BX   address of table of one byte entries, one byte to be written to
  1178.                 each register
  1179.                 (pointer/data chips)
  1180.                 00h     CRTC (3B4h mono modes, 3D4h color modes)
  1181.                 08h     sequencer 3C4h
  1182.                 10h     graphics controller 3CEh
  1183.                 18h     attribute controller 3C0h
  1184.                 (single registers)
  1185.                 20h     miscellaneous output register 3C2h
  1186.                 28h     feature control register (3BAh mono, 3DAh color)
  1187.                 30h     graphics 1 position register 3CCh
  1188.                 38h     graphics 2 position register 3CAh
  1189.  
  1190.  
  1191. Function 0FAh   Microsoft Mouse driver EGA support - Interrogate Driver
  1192. entry   AH      0FAh
  1193.         BX      00h
  1194. return  BX      00h     if mouse driver not present
  1195.         ES:BX   pointer to EGA Register Interface version number, if present:
  1196.                 byte 1  major release number
  1197.                 byte 2  minor release number
  1198.  
  1199.  
  1200. Function 0FEh   Get Alternate Screen Buffer Address (text mode only)
  1201.                                                     (Topview/DesQview/Taskview)
  1202. entry   AH     0FEh
  1203.         ES:DI  segment:offset of assumed video buffer
  1204. return: ES:DI  segment:offset of actual video buffer
  1205. note 1) This alternate video buffer can be written to directly, in the same
  1206.         manner as writing to B:000 or B:800. The MT program will manage the
  1207.         actual display.
  1208.      2) There is no need to synchronize vertical retrace when writing to the
  1209.         alternate buffer; this is managed by the MT program
  1210.      3) If TopView or DESQview is not running, ES:DI is returned unchanged.
  1211.      4) TopView requires that function 0FFh be called every time you write into
  1212.         the buffer to tell TopView that something changed
  1213.  
  1214.  
  1215. Function 0FFh   Update Real Display (text mode only)                  (TopView)
  1216.                 Update Video Buffer                 (Topview/DesQview/Taskview)
  1217. entry   AH      0FFh
  1218.         CX      number of sequential characters that have been modified
  1219.         DI      offset of first character that has been modified
  1220.         ES      segment of video buffer
  1221. return  unknown
  1222. note 1) DesQview supports this call, but does not require it
  1223.      2) Avoid CX=0
  1224.  
  1225.  
  1226. ┌─────────────────────────────────────────────────────────────────────────────┐
  1227. │Interrupt 11h  Equipment Check                                               │
  1228. └─────────────────────────────────────────────────────────────────────────────┘
  1229. (0:0044h)       fetch a code describing active peripherals.
  1230. entry   AH      11h
  1231. return  AX      Equipment listing word          Bits are:
  1232.                 0       number of floppy drives
  1233.                         0       no drives
  1234.                         1       bootable (IPL) diskette drive installed
  1235.                 1       math chip
  1236.                         0       no math coprocessor (80x87) present
  1237.                         1       math coprocessor (80x87) present
  1238.          (PS/2) 2       0       mouse not installed
  1239.                         1       mouse installed
  1240.           (PC)  2,3     system board RAM
  1241.                         0,0     16k    (PC-0, PC-1)
  1242.                         1,1     64k    (PC-2, XT)
  1243.                         note 1) not commonly used. Set both bits to 1
  1244.                              2) both bits always 1 in AT
  1245.                 4,5     initial video mode
  1246.                         0,0     no video installed (use with dumb terminal)
  1247.                         0,1     40x25 color      (CGA)
  1248.                         1,0     80x25 color      (CGA, EGA, PGA, MCGA, VGA)
  1249.                         1,1     80x25 monochrome (MDA or Hercules, most super-
  1250.                                                   hires mono systems)
  1251.                 6,7     number of diskette drives (only if bit 0  1)
  1252.                         0,0     1 drives
  1253.                         0,1     2 drives
  1254.                         1,0     3 drives
  1255.                         1,1     4 drives
  1256.                 8       0       DMA present 
  1257.                         1       no DMA (PCjr, some Tandy 1000s, 1400LT)
  1258.                 9,A,B   number of RS232 serial ports (0-3)
  1259.                         0,0,0   none
  1260.                         0,0,1   1
  1261.                         0,1,0   2
  1262.                         0,1,1   3
  1263.                         1,0,0   4
  1264.                 C       0       no game I/O attached
  1265.                         1       game I/O attached (default for PCjr)
  1266.                 D       serial accessory installation
  1267.                         0       no serial accessories installed
  1268.                         1       Convertible - internal modem installed
  1269.                         1       PCjr - serial printer attached
  1270.                 E,F     number of parallel printers
  1271.                         0,0     none
  1272.                         0,1     one   (LPT1, PRN)
  1273.                         1,0     two   (LPT2)
  1274.                         1,1     three (LPT3)
  1275.                         note    Models before PS/2 would allow a fourth
  1276.                                 parallel printer. Remapping of the BIOS in the
  1277.                                 PS/2s does not allow the use of LPT4.
  1278.  
  1279.  
  1280.  
  1281.  
  1282. ┌─────────────────────────────────────────────────────────────────────────────┐
  1283. │Interrupt 12h  Memory Size                                                   │
  1284. └─────────────────────────────────────────────────────────────────────────────┘
  1285. (0:0048h)       get system memory
  1286. return  AX      number of contiguous 1K RAM blocks
  1287. note 1) This service does not depend on the setting of the motherboard switches
  1288.      2) This is the same value stored in absolute address 04:13h
  1289.  
  1290.  
  1291.  
  1292.  
  1293. ┌─────────────────────────────────────────────────────────────────────────────┐
  1294. │Interrupt 13h  Disk I/O - access the disk drives (floppy and hard disk)      │
  1295. └─────────────────────────────────────────────────────────────────────────────┘
  1296. (0:004Ch)      does not try rereading disk if an error is returned
  1297.  
  1298.                                         
  1299. Function 00h    Reset - reset the disk controller chip
  1300. entry   AH      00h
  1301.         DL      drive (if bit 7 is set both hard disks and floppy disks reset)
  1302. return  AH      status
  1303. note 1) Forces controller chip to recalibrate read/write heads
  1304.      2) Some systems (Sanyo 55x) this resets all drives
  1305.  
  1306.  
  1307. Function 01h    Get Status of disk system
  1308. entry   AH      01h
  1309.         DL      drive (hard disk if bit 7 set)
  1310. return  AL      status of most recent operation
  1311.                 00h     successful completion
  1312.                 01h     bad command
  1313.                 02h     address mark not found
  1314.                 03h     tried to write on write-protected disk
  1315.                 04h     sector not found
  1316.                 05h     reset failed (hard disk)
  1317.                 06h     diskette removed or changed
  1318.                 07h     bad parameter table (hard disk)
  1319.                 08h     DMA overrun
  1320.                 09h     attempt to DMA across 64K boundary
  1321.                 0Ah     bad sector detected (hard disk)
  1322.                 0Bh     bad track detected (hard disk)
  1323.                 0Ch     unsupported track
  1324.                 0Dh     invalid number of sectors on format (hard disk)
  1325.                 0Eh     control data address mark detected (hard disk)
  1326.                 0Fh     DMA arbitration error (hard disk)
  1327.                 10h     bad CRC/EEC on read
  1328.                 11h     data ECC corrected
  1329.                 20h     controller failure
  1330.                 40h     seek failed
  1331.                 80h     timeout
  1332.                 0AAh    drive not ready (hard disk)
  1333.                 0BBh    undefined error (hard disk)
  1334.                 0CCh    write fault     (hard disk)
  1335.                 0E0h    status error    (hard disk)
  1336.                 0FFh    sense operation failed (hard disk)
  1337.  
  1338.  
  1339. Function 02h    Read Sectors - read one or more sectors from diskette
  1340. entry   AH      02h
  1341.         AL      number of sectors to read 
  1342.         BX      address of buffer (ES=segment)
  1343.         CH      track number (0-39 or 0-79 for floppies)
  1344.                 (for hard disk, bits 8,9 in high bits of CL)
  1345.         CL      sector number (1 to 18, not value checked)
  1346.         DH      head number (0 or 1)
  1347.         DL      drive (0=A, 1=B, etc.) (bit 7=0)  (drive 0-7)
  1348.         ES:BX   address to store/fetch data  (buffer to fill)
  1349.        [0000:0078]  dword pointer to diskette parms
  1350. return  CF      clear (0) for successful
  1351.                 set (1) failure
  1352.                 AH      status (00h, 02h, 03h, 04h, 08h, 09h, 10h, 0Ah, 20h,
  1353.                         40h, 80h)
  1354.         AL      number of sectors transferred
  1355. note 1) Number of sectors begins with 1, not 0
  1356.      2) Trying to read zero sectors is considered a programming error; results
  1357.         are not defined
  1358.                                                                         
  1359.  
  1360. Function 03h    Write Sectors - write from memory to disk
  1361. entry   AH      03h
  1362.         AL      number of sectors to write (1-8)
  1363.         CH      track number (for hard disk, bits 8,9 in high bits of CL)
  1364.         CL      beginning sector number
  1365.                 (if hard disk, high two bits are high bits of track #)
  1366.         DH      head number
  1367.         DL      drive number (0-7)
  1368.         ES:BX   address of buffer for data
  1369. return  CF      set if error
  1370.                 AH      status (see above)
  1371.         AL      number of sectors written
  1372. note 1) Number of sectors begins with 1, not 0
  1373.      2) Trying to write zero sectors is considered a programming error; results
  1374.         are not defined
  1375.  
  1376.  
  1377. Function 04h    Verify - verify that a write operation was successful
  1378. entry   AH      04h
  1379.         AL      number of sectors to verify (1-8)
  1380.         CH      track number  (for hard disk, bits 8,9 in high bits of CL)
  1381.         CL      beginning sector number
  1382.         DH      head number
  1383.         DL      drive number (0-7)
  1384. return  CF      set on error
  1385.                 AH      status (see above) 
  1386.         AL      number of sectors verified
  1387.        
  1388.  
  1389. Function 05h    Format Track - write sector ID bytes for 1 track
  1390. entry   AH      05h
  1391.         AL      number of sectors to create on this track
  1392.         CH      track (or cylinder) number
  1393.         CL      sector number
  1394.         DH      head number (0, 1)
  1395.         DL      drive number (0-3)
  1396.         ES:BX   pointer to 4-byte address field (C-H-R-N)
  1397.                 byte 1 = (C) cylinder or track
  1398.                 byte 2 = (H) head
  1399.                 byte 3 = (R) sector
  1400.                 byte 4 = (N) bytes/sector (0 = 128, 1 = 256, 2 = 512, 3 = 1024)
  1401. return  CF      set if error occurred
  1402.                 AH      status code (see above)
  1403. note    Not valid for ESDI hard disks on PS/2
  1404.                  
  1405.  
  1406. Function 06h    Hard Disk - format track and set bad sector flags 
  1407.                                                      (PC2, PC-XT, and Portable)
  1408. entry   AH      06h
  1409.         AL      interleave value (XT only)
  1410.         CH      cylinder number (bits 8,9 in high bits of CL)
  1411.         CL      sector number
  1412.         DH      head
  1413.         DL      drive
  1414.         ES:BX   512 byte format buffer
  1415.                 the first 2*(sectors/track) bytes contain f,n for each sector
  1416.                    f  00Fh for good sector 
  1417.                       80h for bad sector
  1418.                    n  sector number
  1419. return  AH      status code 
  1420.  
  1421.                                      
  1422. Function 07h    Hard Disk - format the drive starting at the desired track
  1423.                                                       (PC2, PC-XT and Portable)
  1424. entry   AH      07h
  1425.         AL      interleave value (XT only) (01h-10h) 
  1426.         CH      cylinder number (bits 8,9 in high bits of CL) (00h-03FFh)
  1427.         CL      sector number
  1428.         DH      head number (0-7)
  1429.         DL      drive number (80h-87h, 80h=C, 81h=D,...)
  1430.         ES:BX   format buffer, size = 512 bytes
  1431.                 the first 2*(sectors/track) bytes contain f,n for each sector
  1432.                 f=00h for good sector 
  1433.                   80h for bad sector
  1434.                 n=sector number
  1435. return  AH      status code (see above)
  1436. note    Award AT BIOS routines are extended to handle more than 1024 cylinders.
  1437.         AL      number of sectors
  1438.         CH      cylinder numberm low 8 bits
  1439.         CL      sector number bits 0-5, bits 6-7 are high 2 cylinder bits
  1440.         DH      head number (bits 0-5) bits 6-7 are extended high cyls (>1024)
  1441.         DL      drive number (0-1 for diskette, 80h-81h for hard disk)
  1442.         ES:BX   transfer address
  1443.  
  1444.  
  1445. Function 08h    Read Drive Parameters             (XT, CONV, AT, XT/286, PS/2)
  1446. entry   AH      08h 
  1447.         DL      drive number (0-2)
  1448. return  CF      set on error
  1449.                 AH      status code (see above)
  1450.         BL      drive type (see AH=17h below) (AT/PS2 floppies only)
  1451.         CH      maximum useable value for cylinder number
  1452.         CL      maximum useable value for sector number or cylinder number 
  1453.         DH      maximum usable value for head number
  1454.         DL      number of consecutive acknowledging drives (0-2)
  1455.         ES:DI   drive parameter table
  1456.  
  1457.  
  1458. Function 09h    Initialize Two Fixed Disk Base Tables    (XT, AT, XT/286, PS/2)
  1459.                 (install nonstandard drive)
  1460. entry   AH      09h
  1461. return  CF      set on error
  1462.                 AH      status code (see above)
  1463.                 data block definitions:
  1464.                 +0   maximum number of cylinders (dw)
  1465.                 +2   maximum number of heads (db)
  1466.                 +3   starting reduced write current cylinder  (dw - XT only)
  1467.                 +5   starting write precomp cylinder (dw)
  1468.                 +7   maximum ECC data burst length (db - XT only)
  1469.                 +8   control byte: Bits  
  1470.                      0,1,2 ─ drive option
  1471.                      3,4,5 - always zero
  1472.                          6 - disable ECC retries
  1473.                          7 - disable access retries
  1474. note 1) Int 41h points to table for drive 0
  1475.      2) Int 46h points to table for drive 1
  1476.      3) 41h used by XT, 41h and 46h used by AT
  1477.  
  1478.  
  1479. Function 0Ah    Read Long   (Hard disk)                 (XT, AT, XT/286, PS/2)
  1480. entry   AH      0Ah
  1481.         CH      cylinder number (bits 8,9 in high bits of CL)
  1482.         CL      sector number
  1483.         DL      drive ID
  1484.         DH      head number
  1485.         ES:BX   pointer to buffer to fill
  1486. return  CF      set on error
  1487.                 AH      status code (see above)
  1488.         AL      number of sectors actually transferred
  1489. note 1) A "long" sector includes a 4 byte EEC (Extended Error Correction) code
  1490.      2) Used for diagnostics only on PS/2 systems
  1491.  
  1492.  
  1493. Function 0Bh    Write Long                              (XT, AT, XT/286, PS/2)
  1494. entry   AH      0Bh
  1495.         CH      cylinder (bits 8,9 in high bits of CL)
  1496.         CL      sector number
  1497.         DH      head number
  1498.         DL      drive ID
  1499.         ES:BX   pointer to buffer containing data
  1500. return  CF      set on error
  1501.                 AH      status code (see above)   
  1502.         AL      number of sectors actually transferred
  1503. note 1) A "long" sector includes a 4 byte EEC (Extended Error Correction) code
  1504.      2) Used for diagnostics only on PS/2 systems
  1505.  
  1506.  
  1507. Function 0Ch    Seek To Cylinder                (except PC, PCjr)
  1508. entry   AH      0Ch
  1509.         CH      cylinder number (bits 8,9 in high bits of CL)
  1510.         DH      head number
  1511.         DL      drive ID
  1512. return  CF      set on error
  1513.                 AH      status code (see above)
  1514. note 1) Positions heads over a particular cylinder
  1515.  
  1516.  
  1517. Function 0Dh    Alternate Disk Reset                    (except PC, PCjr)
  1518. entry   AH      0Dh
  1519.         DL      drive ID
  1520. return  CF      set on error
  1521.         AH      status code (see above)
  1522. note    Not for PS/2 ESDI hard disks
  1523.  
  1524.  
  1525. Function 0Eh    Read Sector Buffer                         (XT, Portable PS/2)
  1526. entry   AH      0Eh 
  1527.         AL      number of sectors
  1528.         CH      cylinder (bits 8,9 in top two bits of CL)
  1529.         CL      sector number
  1530.         DH      head number
  1531.         DL      drive number
  1532.         ES:BX   pointer to buffer
  1533. return  CF      set on error
  1534.                 AH      status code (see above)
  1535.         AL      number of sectors actually transferred    
  1536. note 1) Transfers controller's sector buffer.  No data is read from the drive
  1537.      2) Used for diagnostics only on PS/2 systems
  1538.       
  1539.  
  1540. Function 0Fh    Write sector buffer                          (XT, Portable)
  1541. entry   AH      0Fh 
  1542.         AL      number of sectors
  1543.         CH      cylinder (bits 8,9 in top two bits of CL)
  1544.         CL      sector number
  1545.         DH      head number
  1546.         DL      drive number
  1547.         ES:BX   pointer to buffer
  1548. return  CF      set if error
  1549.                 AH      status code
  1550.         AL      number of sectors actually transferred
  1551. note 1) Should be called before formatting to initialize the controller's
  1552.         sector buffer.
  1553.      2) Used for diagnostics only on PS/2 systems
  1554.       
  1555.  
  1556. Function 10h    Test For Drive Ready
  1557. entry   AH      10h
  1558.         DL      drive ID
  1559. return  CF      set on error
  1560.                 AH      status code (see above)
  1561.                                     
  1562.  
  1563. Function 11h    Recalibrate Drive
  1564. entry   AH      11h
  1565.         DL      drive ID
  1566. return  CF      set on error
  1567.                 AH      status code (see above)
  1568.               
  1569.  
  1570. Function 12h    Controller RAM Diagnostic                (XT, Portable, PS/2)
  1571. entry   AH      12h
  1572. return  CF      set on error
  1573.                 AH      status code (see AH=1 above)
  1574. note    Used for diagnostics only on PS/2 systems
  1575.  
  1576.  
  1577. Function 13h    Drive Diagnostic                             (XT, Portable)
  1578. entry   AH      13h
  1579. return  CF      set on error
  1580.                 AH      status code (see above)
  1581. note    Used for diagnostics only on PS/2 systems
  1582.  
  1583.  
  1584. Function 14h    Controller Internal Diagnostic               (AT, XT/286)
  1585. entry   AH      14h
  1586. return  CF      set on error
  1587.         AH      status code (see above)
  1588. note 1) OEM is Western Digital 1003-WA2 hard/floppy combination controller
  1589.         in AT and XT/286.
  1590.      2) Used for diagnostics only in PS/2 systems
  1591.  
  1592.  
  1593. Function 15h    Get Disk Type                                (except PC and XT)
  1594. entry   AH      15h
  1595.         DL      drive ID
  1596. return  AH      disk type
  1597.                 00h     no drive is present
  1598.                 01h     diskette, no change detection present
  1599.                 02h     diskette, change detection present
  1600.                 03h     fixed disk
  1601.         CX:DX   number of 512-byte sectors when AH = 03h
  1602.  
  1603.  
  1604. Function 16h    Change of Disk Status (diskette)             (except PC and XT)
  1605. entry   AH      16h
  1606. return  AH      disk change status
  1607.                 00h     no disk change
  1608.                 01h     disk changed
  1609.         DL      drive that had disk change
  1610.       
  1611.  
  1612. Function 17h    Set Disk Type for Format (diskette)          (except PC and XT)
  1613. entry   AH      17h
  1614.         AL      00h     no disk
  1615.                 01h     360kb diskette in 360Kb drive
  1616.                 02h     360kb diskette in 1.2M drive
  1617.                 03h     1.2M diskette in 1.2M drive
  1618.                 04h     720kb diskette in 720Kb drive
  1619.         DL      drive number
  1620. return  AH      status of operation
  1621. note    This function is probably enhanced for the PS/2 series to detect
  1622.         1.44 in 1.44 and 720k in 1.44.
  1623.  
  1624.  
  1625. Function 18h    Set Media Type For Format  (diskette)        (AT, XT/286, PS/2)
  1626. entry   AH      18h
  1627.         CH      lower 8 bits of number of tracks
  1628.         CL      high 2 bits of number of tracks (6,7) sectors per track 
  1629.                 (bits 0-5)
  1630.         DL      drive number
  1631. return  AH      00h      if requested combination supported
  1632.                 01h      if function not available
  1633.                 0Ch      if not suppported or drive type unknown
  1634.                 80h      if there is no media in the drive
  1635.         ES:DI   pointer to 11-byte parameter table
  1636.  
  1637.  
  1638. Function 19h    Park Hard Disk Heads                         (XT/286, PS/2)
  1639. entry   AH      19h 
  1640.         DL      drive
  1641. return  CF      set on error
  1642.                 AH      error code
  1643.  
  1644.  
  1645. Function 1Ah    ESDI Hard Disk - Format                         (PS/2)
  1646. entry   AH      1Ah
  1647.         AL      defect table count
  1648.         CL      format modifiers
  1649.                 bits    0 ignore primary defect map
  1650.                         1 ignore secondary defect map
  1651.                         2 update secondary defect map
  1652.                         3 perform surface analysis
  1653.                         4 generate periodic interrupt
  1654.         DL      drive
  1655.         ES:BX   pointer to defect table
  1656. return  CF      set on error
  1657.                 AH      status (see AH=1 above)
  1658. note    If periodic interrupt selected, int 15h/AH=0Fh is called after each
  1659.         cylinder is formatted
  1660.  
  1661.  
  1662.  
  1663.  
  1664.  
  1665. ┌─────────────────────────────────────────────────────────────────────────────┐
  1666. │Interrupt 14h  Initialize and Access Serial Port For Int 14                  │
  1667. └─────────────────────────────────────────────────────────────────────────────┘
  1668. (0:0050h)       the following status is defined:
  1669.  
  1670.         serial status byte:
  1671.         bits    0 delta clear to send
  1672.                 1 delta data set ready
  1673.                 2 trailing edge ring detector
  1674.                 3 delta receive line signal detect
  1675.                 4 clear to send
  1676.                 5 data set ready
  1677.                 6 ring indicator
  1678.                 7 receive line signal detect
  1679.  
  1680.         line status byte:
  1681.         bits    0 data ready
  1682.                 1 overrun error
  1683.                 2 parity error
  1684.                 3 framing error
  1685.                 4 break detect
  1686.                 5 transmit holding register empty
  1687.                 6 transmit shift register empty
  1688.                 7 time out  note: if bit 7 set then other bits are invalid
  1689.  
  1690.  All routines have AH=function number and DX=RS232 card number (0 based).
  1691. AL=character to send or received character on exit, unless otherwise noted.
  1692.  
  1693. entry   AH      00h     Initialize And Access Serial Communications Port
  1694.                         bit pattern: BBBPPSLL
  1695.                         BBB = baud rate:   110,150,300,600,1200,2400,4800,9600 
  1696.                         PP  = parity:      01 = odd, 11 = even 
  1697.                         S   = stop bits:   0 = 1, 1 = 2
  1698.                         LL  = word length: 10 = 7-bits, 11 = 8-bits 
  1699.         AL      parms for initialization:
  1700.                 bit pattern:
  1701.                 0       word length
  1702.                 1       word length
  1703.                 2       stop bits 
  1704.                 3       parity
  1705.                 4       parity
  1706.                 5       baud rate 
  1707.                 6       baud rate 
  1708.                 7       baud rate 
  1709.                 word length     10      7 bits
  1710.                                 11      8 bits
  1711.                 stop bits       0       1 stop bit
  1712.                                 1       2 stop bits
  1713.                 parity          00      none
  1714.                                 01      odd
  1715.                                 11      even
  1716.                 baud rate       000     110 baud
  1717.                                 001     150 baud
  1718.                                 010     300 baud
  1719.                                 011     600 baud
  1720.                                 100     1200 baud
  1721.                                 101     2400 baud
  1722.                                 110     4800 baud
  1723.                                 111     9600 baud  (4800 on PCjr)
  1724.         DX      port number
  1725. return  AH      line status
  1726.         AL      modem status
  1727.  
  1728.  
  1729. Function 01h    Send Character in AL to Comm Port DX (0 or 1)
  1730. entry   AH      01h
  1731.         AL      character
  1732.         DX      port number (0 or 1)
  1733. return  AH      RS232 status code
  1734.                 bit     0       data ready
  1735.                         1       overrun error
  1736.                         2       parity error
  1737.                         3       framing error
  1738.                         4       break detected
  1739.                         5       transmission buffer register empty
  1740.                         6       transmission shift register empty
  1741.                         7       timeout
  1742.         AL      modem status
  1743.                 bit
  1744.                         0       delta clear-to-send
  1745.                         1       delta data-set-ready
  1746.                         2       trailing edge ring detected
  1747.                         3       change, receive line signal detected
  1748.                         4       clear-to-send
  1749.                         5       data-set-ready
  1750.                         6       ring received
  1751.                         7       receive line signal detected
  1752.  
  1753.  
  1754. Function 02h    Wait For A Character From Comm Port DX
  1755. entry   AH      02h
  1756. return  AL      character received
  1757.         AH      error code (see above)(00h for no error)
  1758.  
  1759.  
  1760. Function 03h    Fetch the Status of Comm Port DX (0 or 1) 
  1761. entry   AH      03h
  1762. return  AH      set bits (01h) indicate comm-line status 
  1763.                 bit     7       timeout
  1764.                 bit     6       empty transmit shift register
  1765.                 bit     5       empty transmit holding register
  1766.                 bit     4       break detected ("long-space")
  1767.                 bit     3       framing error
  1768.                 bit     2       parity error
  1769.                 bit     1       overrun error
  1770.                 bit     0       data ready
  1771.         AL      set bits indicate modem status
  1772.                 bit     7       received line signal detect
  1773.                 bit     6       ring indicator
  1774.                 bit     5       data set ready
  1775.                 bit     4       clear to send 
  1776.                 bit     3       delta receive line signal detect
  1777.                 bit     2       trailing edge ring detector 
  1778.                 bit     1       delta data set ready
  1779.                 bit     0       delta clear to send
  1780.  
  1781.  
  1782. Function 04h    Extended Initialize                             (PC Convertible)
  1783. entry   AH      04h
  1784.         AL      break status
  1785.                 01h     if break
  1786.                 00h     if no break
  1787.         BH      parity
  1788.                 00h     no parity
  1789.                 01h     odd parity
  1790.                 02h     even parity
  1791.                 03h     stick parity odd
  1792.                 04h     stick parity even
  1793.         BL      number of stop bits
  1794.                 00h     one stop bit
  1795.                 01h     2 stop bits (1½ if 5 bit word length)
  1796.         CH      word length
  1797.                 00h     5 bits
  1798.                 01h     6 bits
  1799.                 02h     7 bits
  1800.                 03h     8 bits
  1801.         CL      baud rate
  1802.                 00h     110
  1803.                 01h     150
  1804.                 02h     300
  1805.                 03h     600
  1806.                 04h     1200
  1807.                 05h     2400
  1808.                 06h     4800
  1809.                 07h     9600
  1810.                 08h     19200
  1811. return  AL      modem status
  1812.         AH      line control status
  1813.  
  1814.  
  1815. Function 05h    Extended Communication Port Control             (PS/2)
  1816. entry   AH      05h
  1817.         AL      00h     read modem control register
  1818.                 return  BL      modem control reg (see AL=1)
  1819.         AL      01h     write modem control register
  1820.         BL      modem control register: (for AL=00 and AL=01)  bits
  1821.                 0       data terminal ready
  1822.                 1       request to send
  1823.                 2       out1
  1824.                 3       out2
  1825.                 4       loop
  1826.                 5,6,7   reserved
  1827. return  AH      status
  1828.  
  1829. ┌─────────────────────────────────────────────────────────────────────────────┐
  1830. │Interrupt 15h  Cassette I/O                                                  │
  1831. └─────────────────────────────────────────────────────────────────────────────┘
  1832. (0:0054h)       Renamed "System Services" on PS/2 line
  1833.  
  1834. Function 00h    Turn Cassette Motor On                          (PC, PCjr only)
  1835. entry   AH      00h
  1836. return  AH      86h     no cassette present
  1837.         CF      set on error
  1838.                 AH      error code
  1839.                         00h     no errors
  1840.                         01h     CRC error
  1841.                         02h     bad tape signals
  1842.                                 no data transitions (PCjr)
  1843.                         03h     no data found on tape
  1844.                                 not used (PCjr)
  1845.                         04h     no data
  1846.                                 no leader (PCjr)
  1847.                         80h     invalid command
  1848.                         86h     no cassette present
  1849.                                 not valid in PCjr
  1850. note    NOP for systems where cassette not supported
  1851.  
  1852.  
  1853. Function 01h    Turn Cassette Motor Off                         (PC, PCjr only)
  1854. entry   AH      01h
  1855. return  AH      86h     no cassette present
  1856.         CF      set on error
  1857.                 AH      error code
  1858. note    NOP for systems where cassette not supported
  1859.  
  1860.  
  1861. Function 02h    Read Blocks From Cassette                       (PC, PCjr only)
  1862. entry   AH      02h
  1863.         CX      count of bytes to read
  1864.         ES:BX   pointer to data buffer
  1865. return  CF      set on error
  1866.                 AH      error code
  1867.         DX      count of bytes actually read
  1868.         ES:BX   pointer past last byte written
  1869. note 1) NOP for systems where cassette not supported
  1870.      2) Cassette operations normally read 256 byte blocks
  1871.  
  1872.  
  1873. Function 03h    Write Data Blocks to Cassette                   (PC, PCjr only)
  1874. entry   AH      03h
  1875.         CX      count of bytes to write
  1876.         ES:BX   pointer to data buffer
  1877. return  CF      set on error
  1878.                 AH      error code (see 02h)
  1879.         CX      0
  1880.         ES:BX   pointer to last byte written+1
  1881. note 1) NOP for systems where cassette not supported
  1882.      2) The last block is padded to 256 bytes with zeroes if needed
  1883.      3) No errors are returned by this service
  1884.  
  1885.  
  1886. Function 0Fh    ESDI Format Unit Periodic Interrupt          (PS/2 50, 60, 80)
  1887. entry   AH      0Fh
  1888.         AL      phase code
  1889.                 00h     reserved
  1890.                 01h     surface analysis
  1891.                 02h     formatting
  1892. return  CF      clear   if formatting should continue
  1893.                 set     if it should terminate
  1894. note    Called during ESDI drive formatting after each cylinder is completed
  1895.  
  1896.  
  1897. Function 10h    TopView API Function Calls                      (TopView)
  1898. entry   AH      00h     PAUSE   Give Up CPU Time
  1899.                         return  00h     after other processes run
  1900.                 01h     GETMEM  allocate "system" memory
  1901.                         BX      number of bytes to allocate
  1902.                         return  ES:DI pointer to block of memory
  1903.                 02h     PUTMEM  deallocate "system" memory
  1904.                         ES:DI   pointer to previously allocated block
  1905.                         return  block freed
  1906.                 03h     PRINTC  display character/attribute on screen
  1907.                         BH      attribute
  1908.                         BL      character
  1909.                         DX      segment of object handle for window
  1910.                         note    BX=0 does not display anything, it only
  1911.                                 positions the hardware cursor
  1912.                 10h     unknown
  1913.                         AL      04h thru 12h
  1914.                         return  TopView - unimplemented in DV 2.0x
  1915.                                 pops up "Programming error" window in DV 2.0x
  1916.                 11h     unknown
  1917.                 12h     unknown
  1918.                 13h     GETBIT  define a 2nd-level interrupt handler
  1919.                         ES:DI   pointer to FAR service routine
  1920.                         return  BX      bit mask indicating which bit was
  1921.                                         allocated
  1922.                                         0 if no more bits available
  1923.                 14h     FREEBIT undefine a 2nd-level interrupt handler
  1924.                         BX      bit mask from int 15/AH 13h
  1925.                 15h     SETBIT  schedule one or more 2nd-level interrupts
  1926.                         BX      bit mask for interrupts to post
  1927.                         return  indicated routines will be called at next ???
  1928.                 16h     ISOBJ   verify object handle
  1929.                         ES:DI   possible object handle
  1930.                         return   BX     -1 if ES:DI is a valid object handle
  1931.                                          0 if ES:DI is not
  1932.                 17h     TopView - unimplemented in DV 2.00
  1933.                         return  pops up "Programming Error" window in DV 2.00
  1934.                 18h     LOCATE  Find Window at a Given Screen Location
  1935.                         BH      column
  1936.                         BL      row
  1937.                         ES      segment of object handle for ?
  1938.                                 (0 = use default)
  1939.                         return  ES      segment of object handle for window
  1940.                                         which is visible at the indicated
  1941.                                         position
  1942.                 19h     SOUND   Make Tone
  1943.                         BX      frequency in Hertz
  1944.                         CX      duration in clock ticks (18.2 ticks/sec)
  1945.                         return  immediately, tone continues to completion
  1946.                         note    If another tone is already playing, the new tone
  1947.                                 does not start until completion of the previous
  1948.                                 one. In DV 2.00, it is possible to enqueue
  1949.                                 about 32 tones before the process is blocked
  1950.                                 until a note completes.
  1951.                                 In DV 2.00, the lowest tone allowed is 20 Hz
  1952.                 1Ah     OSTACK  Switch to Task's Internal Stack
  1953.                         return  stack switched
  1954.                 1Bh     BEGINC  Begin Critical Region
  1955.                         return  task-switching temporarily disabled
  1956.  
  1957.                         note    Will not task-switch until END CRITICAL REGION
  1958.                                 (AH=1Ch) is called
  1959.                 1Ch     ENDC    End Critical Region
  1960.                         return  task-switching enabled
  1961.                 1Dh     STOP    STOP TASK
  1962.                         ES      segment of object handle for task to be stopped
  1963.                                 (= handle of main window for that task)
  1964.                         return  indicated task will no longer get CPU time
  1965.                         note    At least in DV 2.00, this function is ignored
  1966.                                 unless the indicated task is the current task.
  1967.                 1Eh     START   Start Task
  1968.                         ES      segment of object handle for task to be started
  1969.                                 (== handle of main window for that task)
  1970.                         return  Indicated task is started up again
  1971.                 1Fh     DISPEROR Pop-Up Error Window
  1972.                         BX      bit fields:
  1973.                                 0-12    number of characters to display
  1974.                                 13,14   which mouse button may be pressed to
  1975.                                         remove window
  1976.                                         00      either
  1977.                                         01      left
  1978.                                         10      right
  1979.                                         11      either
  1980.                                 15      beep if 1
  1981.                         DS:DI   pointer to text of message
  1982.                         CH      width of error window (0 = default)
  1983.                         CL      height of error window (0 = default)
  1984.                         DX      segment of object handle
  1985.                         return  BX      status:
  1986.                                         1       left button pressed
  1987.                                         2       right button pressed
  1988.                                         27      ESC key pressed
  1989.                         note    Window remains on-screen until ESC or indicated
  1990.                                 mouse button is pressed
  1991.                 20h     TopView - unimplemented in DV 2.0x
  1992.                         return  pops up "Programming Error" window in DV 2.0x
  1993.                 21h     PGMINT  Interrupt Another Task
  1994.                         BX      segment of object handle for task to interrupt
  1995.                         DX:CX   address of FAR routine to jump to next time
  1996.                                 task is run
  1997.                         return  nothing?
  1998.                         note    The current ES, DS, SI, DI, and BP are passed
  1999.                                 to the FAR routine
  2000.                 22h     GETVER  Get Version
  2001.                         BX      00h
  2002.                         return  BX      nonzero, TopView or compatible loaded
  2003.                                 BH      minor version
  2004.                                 BL      major version
  2005.                         notes   TaskView returns BX = 0001h
  2006.                                 DESQview 2.0 returns BX = 0A01h
  2007.                 23h     POSWIN  Position Window
  2008.                         BX      segment of object handle for parent window
  2009.                                 within which to position the window (0 = full
  2010.                                 screen)
  2011.                         CH      # columns to offset from position in DL
  2012.                         CL      # rows to offset from position in DL
  2013.                         DL      bit flags
  2014.                                 0,1     horizontal position
  2015.                                         00      current
  2016.                                         01      center
  2017.                                         10      left
  2018.                                         11      right
  2019.                                 2,3     vertical position
  2020.                                         00      current
  2021.                                         01      center
  2022.                                         10      top
  2023.                                         11      bottom
  2024.                                 4       don't redraw screen if set
  2025.                                 5-7     not used
  2026.                         ES      segment of object handle for window to be
  2027.                                 positioned
  2028.                         return  nothing
  2029.                 24h     GETBUF  Get Virtual Screen Information
  2030.                         BX      segment of object handle for window (0=default)
  2031.                         return  CX      size of virtual screen in bytes
  2032.                                 DL      0 or 1, unknown
  2033.                                 ES:DI   address of virtual screen
  2034.                 25h     USTACK  Switch Back to User's Stack
  2035.                         return  stack switched back
  2036.                         note    Call only after int 15h,fn1Ah
  2037.                 26h-2Ah DesQview (TopView?) - unimplemented in DV 2.0x
  2038.                         return  pops up "Programming Error" window in DV 2.0x 
  2039.                 2Bh     POSTTASK  Awaken Task       DesQview 2.0 (TopView?)
  2040.                         BX      segment of object handle for task
  2041.                         return  nothing
  2042.                 2Ch     Start New Application in New Process
  2043.                         DesQview 2.0 (TopView?)
  2044.                         ES:DI   pointer to contents of .PIF/.DVP file
  2045.                         BX      size of .PIF/.DVP info
  2046.                         return  BX      segment of object handle for new task
  2047.                 2Dh     Keyboard Mouse Control       DesQview 2.0 
  2048.                         BL      subfunction
  2049.                                 00h     determine whether using keyboard mouse
  2050.                                 01h     turn keyboard mouse on
  2051.                                 02h     turn keyboard mouse off
  2052.                         return  (calling BL was 00h)
  2053.                                 BL      0       using real mouse
  2054.                                         1       using keyboard mouse
  2055.  
  2056.  
  2057. Function 11h    Topview commands
  2058. entry   AH      11h
  2059.         AL      various
  2060. note    In DesQview 2.0x, these function calls are identical to AH=0DEh, so
  2061.         see those below
  2062.  
  2063.  
  2064. Function 20h    PRINT.COM  (DOS internal)        (AT, XT-286, PS/2 50+)
  2065. entry   AH      20h
  2066.         AL      subfunction
  2067.                 00h     unknown (PRINT)
  2068.                 01h     unknown (PRINT)
  2069.                 10h     sets up SysReq routine on AT, XT/286, PS/2
  2070.                 11h     completion of SysReq routine (software only)
  2071. note 1) AL=0 or 1 sets or resets some flags which affect what PRINT does when
  2072.         it tries to access the disk
  2073.  
  2074.  
  2075. Function 21h    Power-On Self Test (POST) Error Log             (PS/2 50+)
  2076. entry   AH      21h
  2077.         AL       00h    read POST log
  2078.                  01h    write POST log
  2079.                         BH      device ID
  2080.                         BL      error code
  2081. return  CF      set on error
  2082.         AH      status
  2083.                 00h    OK
  2084.                        BX      number of error codes stored
  2085.                        ES:DI   pointer to error log
  2086.                 01h    list full
  2087.                 80h    invalid command
  2088.                 86h    unsupported
  2089. note    The log is a series of words, the first byte of which identifies the
  2090.         error code and the second the device.
  2091.  
  2092.  
  2093. Function 40h    Read/Modify Profiles                            (Convertible)
  2094. entry   AH      40h
  2095.         AL      00h     read system profile in CX,BX
  2096.                 01h     write system profile from CX, BX
  2097.                 02h     read internal modem profile in BX
  2098.                 03h     write internal modem profile from BX
  2099.         BX      profile info
  2100. return  BX      internal modem profile (from 02h)
  2101.         CX,BX   system profile (from 00h)
  2102.  
  2103.  
  2104. Function 41h    Wait On External Event                          (Convertible)
  2105. entry   AH      41h
  2106.         AL      condition type
  2107.                 bits 0-2: condition to wait for
  2108.                           0 any external event
  2109.                           1 compare and return if equal
  2110.                           2 compare and return if not equal
  2111.                           3 test and return if not zero
  2112.                           4 test and return if zero
  2113.                 bit 3:    reserved
  2114.                 bit 4:    1=port address, 0=user byte
  2115.                 bits 5-7: reserved
  2116.         BH      condition compare or mask value
  2117.                 condition codes:
  2118.                 0       any external event
  2119.                 1       compare and return if equal
  2120.                 2       compare and return if not equal
  2121.                 3       test and return if not zero
  2122.                 4       test and return if zero
  2123.         BL      timeout value times 55 milliseconds
  2124.                 0 if no time limit
  2125.         DX      I/O port address (if AL bit 4 = 1)
  2126.         ES:DI   pointer to user byte (if AL bit 4 = 0)
  2127.  
  2128.  
  2129. Function 42h    Request System Power Off                        (Convertible)
  2130. entry   AH      42h
  2131.         AL      00h     to use system profile
  2132.                 01h     to force suspend regardless of profile
  2133.  
  2134.  
  2135. Function 43h    Read System Status                              (Convertible)
  2136. entry   AH      43h
  2137. return  AL      status bits:
  2138.                 0       LCD detached
  2139.                 1       reserved
  2140.                 2       RS232/parallel powered on
  2141.                 3       internal modem powered on
  2142.                 4       power activated by alarm
  2143.                 5       standby power lost
  2144.                 6       external power in use
  2145.                 7       battery low
  2146.  
  2147.  
  2148. Function 44h    (De)activate Internal Modem Power               (Convertible)
  2149. entry   AH      44h
  2150.         AL      00h      to power off
  2151.                 01h      to power on
  2152.  
  2153.  
  2154. Function 4Fh    Keyboard Intercept                    (except PC, PCjr, and XT)
  2155. entry   AH      4Fh
  2156.         AL      scan code, CF set
  2157. return  AL      scan code, CF set if processing desired
  2158. note    Called by int 9 handler to translate scan codes
  2159.  
  2160.  
  2161. Function 80h    Device Open                                  (AT, XT/286, PS/2)
  2162. entry   AH      80h
  2163.         BX      device ID
  2164.         CX      process ID
  2165. return  CF      set on error
  2166.         AH      status
  2167.  
  2168.  
  2169. Function 81h    Device Close                                 (AT, XT/286, PS/2)
  2170. entry   AH      81h
  2171.         BX      device ID
  2172.         CX      process ID
  2173. return  CF      set on error
  2174.         AH      status
  2175.  
  2176.  
  2177. Function 82h    Program Termination                          (AT, XT/286, PS/2)
  2178.         AH      82h
  2179.         BX      device ID
  2180. return: CF      set on error
  2181.         AH      status
  2182. note    Closes all devices opened with function 80h
  2183.  
  2184.  
  2185. Function 83h    Event Wait                       (AT, XT/286, Convertible, PS/2)
  2186. entry   AH      83h
  2187.         AL      00h     to set interval
  2188.                 10h     to cancel
  2189.         CX,DX   number of microseconds to wait (granularity is 976 microseconds)
  2190.         ES:BX   pointer to memory flag (bit 7 is set when interval expires)
  2191.                 (pointer is to caller's memory)
  2192. return  CF      set (1) if function already busy
  2193.  
  2194.  
  2195. Function 84h    Read Joystick Input Settings                 (AT, XT/286, PS/2)
  2196. entry   AH      84h
  2197.         DX      00h     to read the current switch settings  (return in AL)
  2198.                 01h     to read the resistive inputs
  2199. return  AX      A(X) value
  2200.         BX      A(Y) value
  2201.         CX      B(X) value
  2202.         DX      B(Y) value
  2203.         AL      switch settings (bits 7-4)
  2204.  
  2205.  
  2206. Function 85h    System Request (SysReq) Key Pressed        (except PC, PCjr, XT)
  2207. entry   AH      85h
  2208. return  AL      00h      key pressed
  2209.                 01h      key released
  2210. note    Called by keyboard decode routine
  2211.  
  2212.  
  2213. Function 86h    Elapsed Time Wait                          (except PC, PCjr, XT)
  2214.         AH      86h
  2215.         CX,DX   number of microseconds to wait
  2216. return  CF      clear   after wait elapses
  2217.         CF      set     immediately due to error
  2218. note    Only accurate to 977 microseconds
  2219.  
  2220.  
  2221. Function 87h    Extended Memory Block Move              (286/386 machines only)
  2222.         AH      87h
  2223.         CX      number of words to move
  2224.         ES:SI   pointer to Global Descriptor Table (GDT)
  2225.                 offset 00h      null descriptor
  2226.                        08h      uninitialized, will be made into GDT descriptor
  2227.                        10h      descriptor for source of move
  2228.                        18h      descriptor for destination of move
  2229.                        20h      uninitialized, used by BIOS
  2230.                        28h      uninitialized, will be made into SS descriptor
  2231. return  CF      set on error
  2232.         AH      status
  2233.                 00h     source copied into destination
  2234.                 01h     parity error
  2235.                 02h     interrupt error
  2236.                 03h     address line 20 gating failed
  2237.  
  2238.  
  2239. Function 88h    Extended Memory Size Determine                (AT, XT/286, PS/2)
  2240. entry   AH      88h
  2241. return  AX      # of contiguous 1K blocks of memory starting at address 1024k
  2242.  
  2243.  
  2244. Function 89h    Switch Processor to Protected Mode            (AT, XT/286, PS/2)
  2245. entry   AH      89h
  2246.         BH      interrupt number of IRQ 8 (IRQ 9Fh use next 7 interrupts)
  2247.         BL      interrupt number of IRQ 0 (IRQ 17h use next 7 interrupts)
  2248.         CX      offset into protected mode CS to jump to
  2249.         DS:SI   pointer to Global Descriptor Table for protected mode
  2250.                 offset  00h     null descriptor
  2251.                         08h     GDT descriptor
  2252.                         10h     IDT descriptor
  2253.                         18h     DS
  2254.                         20h     ES
  2255.                         28h     SS
  2256.                         30h     CS
  2257.                         38h     uninitialized, used to build descriptor for
  2258.                                 BIOS CS
  2259. return  AH      0FFh  error enabling address line 20
  2260.         CF      set on error
  2261.       
  2262.  
  2263. Function 90h    Device Busy Loop                         (except PC, PCjr, XT)
  2264. entry   AH      90h
  2265.         AL      type code:
  2266.                 00h     disk
  2267.                 01h     diskette
  2268.                 02h     keyboard
  2269.                 03h     PS/2 pointing device
  2270.                 80h     network (ES:BX = pointer to network control block)
  2271.                 0FCh    hard disk reset (PS/2)
  2272.                 0FDh    diskette motor start
  2273.                 0FEh    printer
  2274.         ES:BX   pointer to request block for type codes 80h through 0BFh
  2275. return  CF      1 (set) if wait time satisfied
  2276.                 0 (clear) if driver must perform wait
  2277. note    Used by NETBIOS
  2278.         Type codes are allocated as follows:
  2279.         00h-7Fh non-reentrant devices; OS must arbitrate access
  2280.         80h-BFh reentrant devices; ES:BX points to a unique control block
  2281.         C0h-FFh wait-only calls, no complementary int 15, fn91h call
  2282.  
  2283.  
  2284. Function 91h    Set Flag and Complete Interrupt          (except PC, PCjr, XT)
  2285. entry   AH      91h
  2286.         AL      type code (see AH=90h above)
  2287.         ES:BX    pointer to request block for type codes 80h through 0BFh
  2288. return  AH       0
  2289. note    Used by NETBIOS
  2290.                                                                 
  2291.  
  2292. Function 0C0h   Get System Configuration      (XT after 1/10/86, PC Convertible,
  2293.                                                XT/286, AT, PS/2)
  2294. entry   AH      0C0h
  2295. return  CF      1 if BIOS doesn't support call
  2296.         ES:BX   pointer to ROM system descriptor table
  2297.                 dword   number of bytes in the following table (norm. 16 bytes)
  2298.                 byte    system ID byte; see Chapter 2 for interpretation
  2299.                 byte    secondary ID distingushes between AT and XT/286, etc.
  2300.                 byte    BIOS revision level, 0 for 1st release, 1 for 2nd, etc.
  2301.                 byte    feature information
  2302.                         80h     DMA channel 3 used by hard disk BIOS
  2303.                         40h     2nd 8259 installed
  2304.                         20h     realtime clock installed
  2305.                         10h     int 15h, fn 04h called upon int 09h
  2306.                         08h     wait for external event supported (int 15fn41)
  2307.                                 used on Convertible; reserved on PS/2 systems
  2308.                         04h     extended BIOS area allocated at 640k
  2309.                         03h     reserved
  2310.                         02h     bus is Micro Channel instead of PC
  2311.                         01h     reserved
  2312.                         00h     reserved
  2313.                 byte    unknown (set to 0) (reserved by IBM)
  2314.                 byte    unknown (set to 0) (reserved by IBM)
  2315.                 byte    unknown (set to 0)
  2316.                 byte    unknown (set to 0) (Award copyright here)
  2317. note 1) Int 15h is also used for the Multitask Hook on PS/2 machines. No 
  2318.         register settings availible yet.
  2319.      2) The 1/10/86 XT BIOS returns an incorrect value for the feature byte.
  2320.  
  2321.  
  2322. Function 0C1h   System - Return Extended-BIOS Data-Area Segment Address (PS/2)
  2323. entry   AH      0C1h
  2324. return  CF      set on error
  2325.         ES      segment of data area
  2326.  
  2327.  
  2328. Function 0C2h   Pointing Device BIOS Interface      (DesQview 2.x)    (PS/2)
  2329. entry   AH      0C2h
  2330.         AL      00h     enable/disable
  2331.                         BH      00h    disable
  2332.                 01h     reset
  2333.                         return  BH     device ID
  2334.                 02h     set sampling rate
  2335.                         BH      00h    10/second
  2336.                                 01h    20/second
  2337.                                 02h    40/second
  2338.                                 03h    60/second
  2339.                                 04h    80/second
  2340.                                 05h    100/second
  2341.                                 06h    200/second
  2342.                 03h set resolution
  2343.                         BH     00h     one count per mm
  2344.                                01h     two counts per mm
  2345.                                02h     four counts per mm
  2346.                                03h     eight counts per mm
  2347.                 04h     get type
  2348.                         return  BH      device ID
  2349.                 05h     initialize
  2350.                         BH      data package size (1 - 8 bytes)
  2351.                 06h     get/set scaling factor
  2352.                         BH      00h return device status
  2353.                                 return  BL      status byte
  2354.                                         bit 0: right button pressed
  2355.                                         bit 1: reserved
  2356.                                         bit 2: left button pressed
  2357.                                         bit 3: reserved
  2358.                                         bit 4: 0=1:1 scaling, 1=2:1 scaling
  2359.                                         bit 5: device enabled
  2360.                                         bit 6: 0=stream mode, 1=remote mode
  2361.                                         bit 7: reserved
  2362.                                         CL      resolution (see function 03h)
  2363.                                         DL      sample rate, reports per second
  2364.                                 01h     set scaling at 1:1
  2365.                                 02h     set scaling at 2:1
  2366.                 07h     set device handler address
  2367.                         ES:BX   user device handler
  2368.                         return  AL      00h
  2369. return  CF      set on error
  2370.         AH      status
  2371.                 00h     successful
  2372.                 01h     invalid function
  2373.                 02h     invalid input
  2374.                 03h     interface error
  2375.                 04h     need to resend
  2376.                 05h     no device handler installed
  2377. note    The values in BH for those functions that take it as input are stored
  2378.         in different locations for each subfunction
  2379.  
  2380.  
  2381. Function 0C3h   Enable/Disable Watchdog Timeout                 (PS/2 50+)
  2382. entry   AH      0C3h
  2383.         AL      00h     disable
  2384.                 01h     enable
  2385.                         BX      timer counter
  2386. return  CF      set on error
  2387. note    The watchdog timer generates an NMI
  2388.  
  2389.  
  2390. Function 0C4h   Programmable Option Select                      (PS/2 50+)
  2391. entry   AH      04Ch
  2392.         AL      00h     return base POS register address
  2393.                 01h     enable slot
  2394.                         BL      slot number
  2395.                 02h     enable adapter
  2396. return  CF      set on error
  2397.         DX      base POS register address (if function 00h)
  2398.  
  2399.                                                 
  2400. Function 0DEh   DesQview Services                             (DesQview)
  2401. entry   AH      0DEh
  2402.         AL      00h     Get Program Name
  2403.                         return  AX      offset into DESQVIEW.DVO of current
  2404.                                         program's record:
  2405.                                         byte    length of name
  2406.                                         n bytes name
  2407.                                         2 bytes keys to invoke program (second
  2408.                                                 = 00h if only one key used)
  2409.                                         word    ? (I see 0 always)
  2410.                                         byte    end flag: 00h for all but last
  2411.                                                 entry, which is 0FFh
  2412.                 01h     Update "Open Window" Menu
  2413.                         return  none
  2414.                         note    Reads DESQVIEW.DVO, disables Open menu if file
  2415.                                 not in current directory
  2416.                 02h     unimplemented in DV 2.0x
  2417.                         return  nothing (NOP in DV 2.0x)
  2418.                 03h     unimplemented in DV 2.0x
  2419.                         return  nothing (NOP in DV 2.0x)
  2420.                 04h     Get Available Common Memory
  2421.                         return  BX      bytes of common memory available
  2422.                                 CX      largest block available
  2423.                                 DX      total common memory in bytes
  2424.                 05h     Get Available Conventional Memory
  2425.                         return  BX      K of memory available
  2426.                                 CX      largest block available
  2427.                                 DX      total conventional memory in K
  2428.                 06h     Get Available Expanded Memory
  2429.                         return  BX      K of expanded memory available
  2430.                                 CX      largest block available
  2431.                                 DX      total expanded memory in K
  2432.                 07h     APPNUM  Get Current Program's Number
  2433.                         return  AX      number of program as it appears on the
  2434.                                         "Switch Windows" menu
  2435.                 08h     GET (unknown)
  2436.                         return  AX      0       unknown
  2437.                                         1       unknown
  2438.                 09h     unimplemented in DV 2.00
  2439.                         return  nothing (NOP in DV 2.00)
  2440.                 0Ah     DBGPOKE Display Character on Status Line
  2441.                         BL      character
  2442.                         return  character displayed, next call will display in
  2443.                                 next position (which wraps back to the start of
  2444.                                 the line if off the right edge of screen)
  2445.                         note 1) Displays character on bottom line of *physical*
  2446.                                 screen, regardless of current size of window
  2447.                                 (even entirely hidden)
  2448.                              2) Does not know about graphics display modes,
  2449.                                 just pokes the characters into display memory
  2450.                 0Bh     APILEVEL Define Minimum API Level Required
  2451.                         BL      API level
  2452.                                 >2 pops up "You need a newer version" error
  2453.                                 window in DV 2.00
  2454.                         BH      unknown
  2455.                         return  AX      maximum API level?
  2456.                 0Ch     GETMEM  Allocate "System" Memory
  2457.                         BX      number of bytes
  2458.                         return  ES:DI   pointer to allocated block
  2459.                 0Dh     PUTMEM  Deallocate "System" Memory
  2460.                         ES:DI   pointer to previously allocated block
  2461.                         return  nothing
  2462.                 0Eh     Find Mailbox by Name    (DV 2.0+)
  2463.                         ES:DI   pointer to name to find
  2464.                         CX      length of name
  2465.                         return  BX      0       not found
  2466.                                         1       found
  2467.                                 DS:SI   object handle
  2468.                 0Fh     Enable DesQview Extensions      (DV 2.0+)
  2469.                         return  AX and BX destroyed (seems to be bug, weren't
  2470.                                 saved & restored)
  2471.                         note 1) Sends a manager stream with opcodes AEh, BDh,
  2472.                                 and BFh to task's window
  2473.                              2) Enables an additional mouse mode
  2474.                 10h     PUSHKEY  PUT KEY INTO KEYBOARD INPUT STREAM  (DV 2.0+)
  2475.                         BH      scan code
  2476.                         BL      character
  2477.                         return  BX      unknown (sometimes, but not always,
  2478.                                         same as BX passed in)
  2479.                         note    A later read will get the keystroke as if it
  2480.                                 had been typed by the user
  2481.                 11h     ENABLE/DISABLE AUTO JUSTIFICATION OF WINDOW (DV 2.0+)
  2482.                         BL      0       viewport will not move automatically
  2483.                                 nonzero viewport will move to keep cursor
  2484.                                         visible
  2485.                         return  none
  2486.                 12h     unknown (DV 2.0+)
  2487.                         BX      0       clear something?
  2488.                                 nonzero set something?
  2489.                         return  none
  2490.  
  2491.  
  2492.  
  2493.  
  2494.  
  2495. ┌─────────────────────────────────────────────────────────────────────────────┐
  2496. │Interrupt 16h  Keyboard I/O                                                  │
  2497. └─────────────────────────────────────────────────────────────────────────────┘
  2498. (0:0058h)       access the keyboard 
  2499.  
  2500.  
  2501. Function  00h   Get Keyboard Input - read the next character in keyboard buffer,
  2502.                 if no key ready, wait for one.
  2503. entry   AH      00h     
  2504. return  AH      scan code 
  2505.         AL      ASCII character 
  2506.        
  2507.  
  2508. Function  01h   Check Keystroke Buffer - Do Not Clear
  2509. entry   AH      01h    
  2510. return  ZF      0 (clear) if character in buffer
  2511.                 1 (set)   if no character in buffer
  2512.         AH      scan code of character (if ZF=0)
  2513.         AL      ASCII character if applicable
  2514. note    Keystroke is not removed from buffer
  2515.  
  2516.  
  2517. Function  02h   Shift Status - fetch bit flags indicating shift status 
  2518. entry   AH      02h
  2519. return  AL      bit codes (same as [0040:0017])
  2520.                 bit 7   Insert state
  2521.                 bit 6   CapsLock state
  2522.                 bit 5   NumLock state
  2523.                 bit 4   ScrollLock state
  2524.                 bit 3   Alt key
  2525.                 bit 2   Control key
  2526.                 bit 1   Left shift (left caps-shift key)
  2527.                 bit 0   Right shift (right caps-shift key)
  2528. note    other codes found at [0040:0018]
  2529.                 bit 7   Insert shift (Ins key)
  2530.                 bit 6   Caps shift (CapsLock key)
  2531.                 bit 5   Num shift (NumLock key) 
  2532.                 bit 4   Scroll shift (ScrollLock key)
  2533.                 bit 3   Hold state (Ctrl-NumLock is in effect)
  2534.  
  2535.  
  2536. Function 03h    Keyboard - Set Repeat Rate            (PCjr, AT, XT/286, PS/2)
  2537. entry   AH      03h 
  2538.         AL      00h     reset typematic             (PCjr)
  2539.                 01h     increase initial delay      (PCjr)
  2540.                 02h     increase continuing delay   (PCjr)
  2541.                 03h     increase both delays        (PCjr)
  2542.                 04h     turn off typematic          (PCjr)
  2543.                 05h     set typematic rate          (AT, PS/2)
  2544.         BH      00h-03h for delays of 250ms, 500ms, 750ms, or 1second
  2545.                         0,0     250ms
  2546.                         0,1     500ms
  2547.                         1,0     750ms
  2548.                         1,1     1 second
  2549.         BL      00h-1Fh for typematic rates of 30cps down to 2cps
  2550.                         00000 30     01011 10.9   10101 4.5
  2551.                         00001 26.7   01100 10     10110 4.3
  2552.                         00010 24     01101 9.2    10111 4
  2553.                         00011 21.8   01110 8.6    11000 3.7
  2554.                         00100 20     01111 8      11001 3.3
  2555.                         00101 18.5   10000 7.5    11010 3
  2556.                         00110 17.1   10001 6.7    11011 2.7
  2557.                         00111 16     10010 6      11100 2.5
  2558.                         01000 15     10011 5.5    11101 2.3
  2559.                         01001 13.3   10011 5.5    11110 2.1
  2560.                         01010 12     10100 5      11111 2
  2561.  
  2562.  
  2563. Function 04h    Keyboard Click Toggle                 (PCjr and Convertible)
  2564. entry   AH      04h
  2565.         AL      00h     for click off
  2566.                 01h     for click on 
  2567.           
  2568.  
  2569. Function 05h    Keyboard Buffer Write            (AT or PS/2 with enhanced kbd)
  2570.                 (XT/286, PS/2, AT with "Enhanced" keyboard)
  2571. entry   AH      05h
  2572.         CH      scan code
  2573.         CL      ASCII character
  2574. return  AL      01h if buffer full
  2575.  
  2576.  
  2577. Function 10h    Get Enhanced Keystroke And Read      (F11, F12 Enhanced Keyb'd)
  2578.                 (XT/286, PS/2, AT with "Enhanced" keyboard)
  2579. entry   AH      10h
  2580. return  AH      scan code
  2581.         AL      ASCII character if applicable
  2582.  
  2583.  
  2584. Function 11h    Check Enhanced Keystroke         (F11-F12 on enhanced keyboard)
  2585.                 (XT/286, PS/2, AT with "Enhanced" keyboard)
  2586. entry   AH      11h
  2587. return  ZF      0       (clear) if key pressed
  2588.                 1       if buffer empty
  2589.         AH      scan code (when ZF=0)
  2590.         AL      ASCII character if applicable (when ZF=0)
  2591. note    Keystroke is not removed from buffer
  2592.  
  2593.  
  2594. Function 12h    Extended Get Shift Status         (F11, F12 Enhanced keyboard)
  2595. entry    AH     12h
  2596. return   AL     bit
  2597.                 0       right Shift key depressed
  2598.                 1       left Shift key depressed
  2599.                 2       Control key depressed
  2600.                 3       Alt key depressed
  2601.                 4       ScrollLock state active
  2602.                 5       NumLock state active
  2603.                 6       CapsLock state active
  2604.                 7       insert state is active
  2605.         AH      0       left Control key pressed
  2606.                 1       left Alt key depressed
  2607.                 2       right Control key pressed
  2608.                 3       right Alt key depressed
  2609.                 4       Scroll Lock key depressed
  2610.                 5       NumLock key depressed
  2611.                 6       CapsLock key depressed
  2612.                 7       SysReq key depressed
  2613.  
  2614.  
  2615. Function F0h    Set CPU speed (Compaq 386)
  2616. entry   AH      F0h     set speed
  2617. return  unknown
  2618. note    used by Compaq DOS MODE command.
  2619.         parameters not availible
  2620.  
  2621.                                       
  2622.  
  2623.  
  2624.  
  2625. ┌─────────────────────────────────────────────────────────────────────────────┐
  2626. │Interrupt 17h  Printer                                                       │
  2627. └─────────────────────────────────────────────────────────────────────────────┘
  2628. (0:005Ch)       access the parallel printer(s)
  2629.                 AH is changed. All other registers left alone.
  2630.  
  2631. Function  00h   Print Character/send AL to printer DX (0, 1, or 2) 
  2632. entry   AH      00h
  2633.         AL      character
  2634.         DX      printer to be used (0,1,2)
  2635. return  AH      status byte
  2636.                 bit
  2637.                 0       time out
  2638.                 1       unused
  2639.                 2       unused
  2640.                 3       I/O error
  2641.                 4       selected
  2642.                 5       out of paper
  2643.                 6       acknowledge
  2644.                 7       not busy
  2645.  
  2646.  
  2647. Function 01h    Initialize Printer - set init line low, send 0Ch to printer DX 
  2648. entry   AH      01h
  2649.         DX      printer port to be initialized (0,1,2)
  2650. return  status as below
  2651.  
  2652.  
  2653. Function  02h   Printer Status - read status of printer DX into AH 
  2654. entry   AH      02h
  2655.         DX      printer port to be used (0,1,2)
  2656. return  AH      bit flags       bit 7   0 = printer is busy
  2657.                                 bit 6   ACKnowledge line state
  2658.                                 bit 5   out-of-paper line state
  2659.                                 bit 4   printer selected line state 
  2660.                                 bit 3   I/O error
  2661.                                 bit 2   unused 
  2662.                                 bit 1   unused 
  2663.                                 bit 0   time-out error 
  2664.  
  2665.  
  2666.                                       
  2667.  
  2668.  
  2669. ┌─────────────────────────────────────────────────────────────────────────────┐
  2670. │Interrupt 18h  ROM BASIC                                                     │
  2671. └─────────────────────────────────────────────────────────────────────────────┘
  2672. (0:0060h)       Execute ROM BASIC at address 0F600h:0000h
  2673. note 1) Often reboots a compatible
  2674.      
  2675.  
  2676.  
  2677.  
  2678.  
  2679. ┌─────────────────────────────────────────────────────────────────────────────┐
  2680. │Interrupt 19h  Bootstrap Loader                                              │
  2681. └─────────────────────────────────────────────────────────────────────────────┘
  2682. (0:0064h)       Reads track 0, sector 1 into address 0000h:7C00h, then transfers
  2683.                 control to that address. If no diskette drive available, 
  2684.                 transfers to ROM-BASIC or displays loader error message.
  2685.                 Causes reboot of disk system if invoked while running.
  2686.                 (no memory test performed).
  2687.                           
  2688.  
  2689.  
  2690.  
  2691.  
  2692. ┌─────────────────────────────────────────────────────────────────────────────┐
  2693. │Interrupt 1Ah  Time of Day                                                   │
  2694. └─────────────────────────────────────────────────────────────────────────────┘
  2695. (0:0068h)       access the PC internal clock
  2696.  
  2697. Function 00h    Read System Time Counter
  2698. entry   AH      00h
  2699. return  CX      high word of clock count
  2700.         DX      low word of clock count 
  2701.         AL      00h if clock was read or written (via AH=0,1) within the current
  2702.                 24-hour period. Otherwise, AL > 0
  2703.  
  2704.  
  2705. Function 01h    Set Clock - set # of 55ms clock ticks in system time counter
  2706. entry   AH      01h
  2707.         CX:DX   high word/low word count of timer ticks 
  2708. return  none
  2709. note 1) The clock ticks are incremented by timer interrupt at 18.2065 times 
  2710.         per second or 54.9254milliseconds/count. Therefore: 
  2711.                 counts per second = 18      (12h)
  2712.                 counts per minute = 1092    (444h)
  2713.                 counts per hour   = 65543   (10011h)
  2714.                 counts per day    = 1573040 (1800B0h)
  2715.      2) counter is zeroed when system is rebooted
  2716.  
  2717.  
  2718. Function 02h    Read Real Time Clock Time                       (AT and after)
  2719. entry   AH      02h
  2720. return  CH      hours in BCD
  2721.         CL      minutes in BCD
  2722.         DH      seconds in BCD
  2723.         DL      1 (set) if daylight savings time option
  2724.         CF      1 (set) if clock not operating
  2725.  
  2726.  
  2727. Function 03h    Set Real Time Clock Time                        (AT and after)
  2728. entry   AH      03h
  2729.         CH      hours in BCD
  2730.         CL      minutes in BCD
  2731.         DH      seconds in BCD
  2732.         DL      0 (clear) if standard time
  2733.                 1 (set) if daylight savings time option
  2734. return  none
  2735.  
  2736.  
  2737. Function 04h    Read Real Time Clock Date                       (AT and after)
  2738. entry   AH      04h
  2739. return  CH      century in BCD (19 or 20)
  2740.         CL      year in BCD
  2741.         DH      month in BCD
  2742.         DL      day in BCD
  2743.         CF      1 (set) if clock not operating
  2744.  
  2745.  
  2746. Function 05h    Set Real Time Clock Date                        (AT and after)
  2747. entry   AH      05h
  2748.         CH      century in BCD (19 or 20)
  2749.         CL      year in BCD
  2750.         DH      month in BCD
  2751.         DL      day in BCD
  2752. return  none
  2753.  
  2754.                            
  2755. Function 06h    Set Real Time Clock Alarm                       (AT and after)
  2756. entry   AH      06h
  2757.         CH      hours in BCD
  2758.         CL      minutes in BCD
  2759.         DH      seconds in BCD
  2760. return  CF      set if alarm already set or clock inoperable
  2761. note    Int 4Ah occurs at specified alarm time every 24hrs until reset
  2762.  
  2763.  
  2764. Function 07h    Reset Real Time Clock Alarm                     (AT and after)
  2765. entry   AH      07h
  2766. return  none
  2767.  
  2768.  
  2769. Function 08h    Set Real Time Clock Activated Power On Mode     (Convertible)
  2770. entry   AH      08h
  2771.         CH      hours in BCD
  2772.         CL      minutes in BCD
  2773.         DH      seconds in BCD
  2774.  
  2775.  
  2776. Function 09h    Read Real Time Clock Alarm Time and Status
  2777.                                                 (Convertible and PS/2 Model 30)
  2778. entry   AH      09h
  2779. return  CH      hours in BCD
  2780.         CL      minutes in BCD
  2781.         DH      seconds in BCD
  2782.         DL      alarm status:
  2783.                 00h     if alarm not enabled
  2784.                 01h     if alarm enabled but will not power up system
  2785.                 02h     if alarm will power up system
  2786.  
  2787.  
  2788. Function 0Ah    Read System-Timer Day Counter   (XT-2 [640k motherboard], PS/2)
  2789. entry   AH      0Ah
  2790. return  CF      set on error
  2791.         CX      count of days since Jan 1,1980
  2792.  
  2793.  
  2794. Function 0Bh    Set System-Timer Day Counter    (XT-2 [640k motherboard], PS/2)
  2795. entry   AH      0Bh
  2796.         CX      count of days since Jan 1,1980
  2797. return  CF      set on error
  2798.  
  2799.  
  2800. Function 80h    Set Up Sound Multiplexor                (PCjr) (Tandy 1000?)
  2801. entry   AH      80h
  2802.         AL      00h     source is 8253 channel 2
  2803.                 01h     source is cassette input
  2804.                 02h     source is I/O channel "audio in"
  2805.                 03h     source is TI sound generator chip
  2806.                           
  2807.  
  2808.  
  2809.  
  2810.         
  2811. ┌─────────────────────────────────────────────────────────────────────────────┐
  2812. │Interrupt 1Bh  Control-Break                                                 │
  2813. └─────────────────────────────────────────────────────────────────────────────┘
  2814. (0:006Ch)       This interrupt is called when the keyboard scanner of the IBM 
  2815.                 machines detects Ctrl and Break pressed at the same time.
  2816.  
  2817. note 1) If the break occurred while processing an interrupt, one or more
  2818.         end of interrupt commands must be send to the 8259 Programmable
  2819.         Interrupt Controller.
  2820.      2) All I/O devices should be reset in case an operation was underway at
  2821.         the time.
  2822.      3) It is normally pointed to an IRET during system initialization so that
  2823.         it does nothing, but some programs change it to return a ctrl-C scan 
  2824.         code and thus invoke int 23h.
  2825.  
  2826.  
  2827.  
  2828.  
  2829.  
  2830. ┌─────────────────────────────────────────────────────────────────────────────┐
  2831. │Interrupt 1Ch  Timer Tick                                                    │
  2832. └─────────────────────────────────────────────────────────────────────────────┘
  2833. (0:0070h)
  2834. note 1) Taken 18.2065 times per second 
  2835.      2) Normally vectors to dummy IRET unless PRINT.COM has been installed.
  2836.      3) If an application moves the interrupt pointer, it is the responsibility
  2837.         of that application to save and restore all registers that may be
  2838.         modified.
  2839.  
  2840.  
  2841.  
  2842.  
  2843.  
  2844. ┌─────────────────────────────────────────────────────────────────────────────┐
  2845. │Interrupt 1Dh  Vector of Video Initialization Parameters                     │
  2846. └─────────────────────────────────────────────────────────────────────────────┘
  2847. (0:0074h)       This doubleword address points to 3 sets of 16-bytes containing
  2848.                 data to initialize for video modes for video modes 0 & 1 (40 
  2849.                 column), 2 & 3 (80 column), and 4, 5 & 6 (graphics) on the 
  2850.                 Motorola 6845 CRT controller chip.
  2851.  6845 registers:
  2852.         R0      horizontal total (horizontal sync in characters)
  2853.         R1      horizontal displayed (characters per line)
  2854.         R2      horizontal sync position (move display left or right)
  2855.         R3      sync width (vertical and horizontal pulse: 4-bits each)
  2856.         R4      vertical total (total character lines)
  2857.         R5      vertical adjust (adjust for 50 or 60 Hz refresh)
  2858.         R6      vertical displayed (lines of chars displayed)
  2859.         R7      vertical sync position (lines shifted up or down)
  2860.         R8      interlace (bits 4 and 5) and skew (bits 6 and 7)
  2861.         R9      max scan line addr (scan lines per character row)
  2862.         R10     cursor start (starting scan line of cursor)
  2863.         R11     cursor stop (ending scan line of cursor)
  2864.         R12     video memory start address high byte (6-bits)
  2865.         R13     video memory start address low byte (8-bits)
  2866.         R14     cursor address high byte (6-bits)
  2867.         R15     cursor address low byte (8-bits)
  2868.  
  2869.  6845 Video Init Tables:
  2870.         table for modes 0 and 1   \
  2871.         table for modes 2 and 3    \ each table is 16 bytes long and
  2872.         table for modes 4,5, and 6 / contains values for 6845 registers
  2873.         table for mode 7          /
  2874.         4 words:   size of video RAM for modes 0/1, 2/3, 4/5, and 6/7
  2875.         8 bytes:   number of columns in each mode
  2876.         8 bytes:   video controller mode byte for each mode
  2877. note 1) There are 4 separate tables, and all 4 must be initialized if all
  2878.         video modes will be used.
  2879.      2) The power-on initialization code of the computer points this vector
  2880.         to the ROM BIOS video routines.
  2881.      3) IBM recommends that if this table needs to be modified, it should be
  2882.         copied into RAM and only the nescessary changes made.
  2883.  
  2884.  
  2885.  
  2886.  
  2887.  
  2888. ┌─────────────────────────────────────────────────────────────────────────────┐
  2889. │Interrupt 1Eh  Vector of Diskette Controller Parameters                      │
  2890. └─────────────────────────────────────────────────────────────────────────────┘
  2891. (0:0078h)       Dword address points to data base table that is used by BIOS.
  2892.                 Default location is at 0F000:0EFC7h. 11-byte table format:
  2893.                 bytes:
  2894.                 00h     4-bit step rate, 4-bit head unload time 
  2895.                 01h     7-bit head load time, 1-bit DMA flag
  2896.                 02h     54.9254 ms counts - delay till motor off (37-38 typ)
  2897.                 03h     sector size: 
  2898.                         00h     128 bytes
  2899.                         01h     256 bytes
  2900.                         02h     512 bytes
  2901.                         03h     1024 bytes
  2902.                 04h     last sector on track (8 or 9 typical)
  2903.                 05h     gap between sectors on read/write (42 typical)
  2904.                 06h     data length for DMA transfers (0FFh typical)
  2905.                 07h     gap length between sectors for format (80 typical)
  2906.                 08h     sector fill byte for format (0F6h typical)
  2907.                 09h     head settle time (in milliseconds) (15 to 25 typical)
  2908.                         DOS 1.0   0
  2909.                         DOS 2.10  15
  2910.                         DOS 3.1   1
  2911.                 10h     motor start time (in 1/8 second intervals) (2 to 4 typ.)
  2912.                         DOS 2.10  2
  2913. note 1) This vector is pointed to the ROM BIOS diskette tables on system 
  2914.         initialization
  2915.      2) IBM recommends that if this table needs to be modified, it should be
  2916.         copied into RAM and only the nescessary changes made.
  2917.  
  2918.  
  2919.  
  2920.  
  2921. ┌─────────────────────────────────────────────────────────────────────────────┐
  2922. │Interrupt 1Fh  Pointer to Graphics Character Extensions (Graphics Set 2)     │
  2923. └─────────────────────────────────────────────────────────────────────────────┘
  2924. (0:007Ch)       This is the pointer to data used by the ROM video routines to
  2925.                 display characters above ASCII 127 while in CGA medium and high
  2926.                 res graphics modes.
  2927.  
  2928. note 1) Doubleword address points to 1K table composed of 28 8-byte character 
  2929.         definition bit-patterns. First byte of each entry is top row, last byte
  2930.         is bottom row.
  2931.      2) The first 128 character patterns are located in system ROM.
  2932.      3) This vector is set to 000:0 at system initialization
  2933.      4) Used by DOS' external GRAFTABL command
  2934.  
  2935.  
  2936.  
  2937.  
  2938.  
  2939. ┌─────────────────────────────────────────────────────────────────────────────┐
  2940. │Interrupt 20h  Terminate Current Program                                     │
  2941. └─────────────────────────────────────────────────────────────────────────────┘
  2942. (0:0080h)
  2943.  Issue int 20h to exit from a program. This vector transfers to the logic in 
  2944. DOS to restore the terminate address, the Ctrl-Break address,and the critical 
  2945. error exit address to the values they had on entry to the program. All the file
  2946. buffers are flushed and all handles are closed. You should close all files 
  2947. changed in length (see function calls 10h and 3Eh) before issuing this 
  2948. interrupt. If the changed file is not closed, its length, time, and date are 
  2949. not recorded correctly in the directory.
  2950.  For a program to pass a completion code or an error code when terminating, it
  2951. must use either function call 4Ch (Terminate a Process) or 31h (Terminate 
  2952. Process and Stay Resident). These two methods are preferred over using 
  2953. int 20h and the codes returned by them can be interrogated in batch processing. 
  2954. Important: Before you issue an interrupt 20h, your program must ensure that 
  2955.            the CS register contains the segment of its program segment prefix.
  2956.  
  2957. Interrupt 20h   DOS - Terminate Program
  2958. entry   no parameters
  2959. return  The following vectors are restored from the Program Segment Prefix:
  2960.         0Ah     Program Terminate
  2961.         0Eh     Control-C
  2962.         12h     Critical Error
  2963. note    IBM and Microsoft recommend using int 21 Fn 4Ch. Using int 20 is
  2964.         officially frowned upon since the introduction of DOS 2.0
  2965.  
  2966.