home *** CD-ROM | disk | FTP | other *** search
/ Frostbyte's 1980s DOS Shareware Collection / floppyshareware.zip / floppyshareware / DOOG / 1216REF.ZIP / CHAPTER.003 < prev    next >
Text File  |  1988-12-16  |  139KB  |  2,964 lines

  1.  
  2.    **  Programmer's  Technical  Reference  for  MSDOS  and  the  IBM  PC **
  3.                         ┌─────────────────────────────┐
  4.                         │ Shareware Version, 12/16/88 │
  5.                         │  Please Register Your Copy  │
  6.                         └─────────────────────────────┘
  7.                        Copyright (c) 1988 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.                     2 text font override supported
  845.                     3 graphics font override supported
  846.                     4 palette override supported
  847.                     5 DCC extension supported
  848.                     6 reserved
  849.                     7 reserved
  850.         0Fh     reserved
  851.  
  852.  
  853. Function 1Ch    Save/Restore Video State                     (VGA)
  854. entry   AH      1Ch
  855.         AL      00h     return state buffer size
  856.                 01h     save video state
  857.                         ES:BX   buffer address
  858.                 02h     restore video state
  859.                         ES:BX   buffer address of previously saved state
  860.         CX      requested states
  861.                 bit  0      video hardware
  862.                      1      BIOS data areas
  863.                      2      color registers and DAC state
  864.                      3-15   reserved
  865. return  AL      1Ch if function supported
  866.         BX      number of 64 byte blocks needed (function 00h)
  867. note    VGA only
  868.  
  869.  
  870. Function 40h    Set Graphics Mode (Hercules Graphics Card Plus)
  871. entry   AH      40h
  872. return  unknown
  873.  
  874.  
  875. Function  41h   Set Text Mode (Hercules Graphics Card Plus)
  876. entry   AH      41h
  877. return  unknown
  878.  
  879.  
  880. Function 42h    Clear Current Page (Hercules Graphics Card Plus)
  881. entry   AH      42h
  882. return  unknown
  883.  
  884.  
  885. Function 43h    Select Drawing Page (Hercules Graphics Card Plus)
  886. entry   AH      43h
  887.         AL      page number (0,1)
  888. return  unknown
  889.  
  890.  
  891. Function 44h    Select Drawing Function (Hercules Graphics Card Plus)
  892. entry   AH      44h
  893.         AL      0       clear pixels
  894.                 1       set pixels
  895.                 2       invert pixels
  896. return  unknown
  897.  
  898.  
  899. Function 45h    Select Page to Display (Hercules Graphics Card Plus)
  900. entry   AH      45h
  901.         AL      page number (0,1)
  902. return  unknown
  903.  
  904.  
  905. Function 46h    Draw One Pixel (Hercules Graphics Card Plus)
  906. entry   AH      46h
  907.         DI      x       (0-720)
  908.         BP      y       (0-347)
  909. return  unknown
  910. note    Function 44h determines operation and function 43h which page to use.
  911.  
  912.  
  913. Function 47h    Find Pixel Value (Hercules Graphics Card Plus)
  914. entry   AH      47h
  915.         DI      x       (0-720)
  916.         BP      y       (0-347)
  917. return  AL      0       pixel clear
  918.                 1       pixel set
  919. note    Function 43h specifies page that is used.
  920.  
  921.  
  922. Function 48h    Move to Point (Hercules Graphics Card Plus)
  923. entry   AH      48h
  924.         DI      x       (0-720)
  925.         BP      y       (0-347)
  926. return  unknown
  927.  
  928.  
  929. Function 49h    Draw to Point (Hercules Graphics Card Plus)
  930. entry   AH      49h
  931.         DI      x       (0-720)
  932.         BP      y       (0-347)
  933. return  unknown
  934. note    Function 48h or 49h specify first point, 44h operation and 43h page
  935.         to use.
  936.  
  937.  
  938. Function 4Ah    Block Fill (Hercules Graphics Card Plus)
  939. entry   AH      4Ah
  940. return  unknown
  941.  
  942.  
  943. Function 4Bh    Display Character (Hercules Graphics Card Plus)
  944. entry   AH      4Bh
  945.         AL      ASCII code for character to display
  946.         DI      x       (0-720)
  947.         BP      y       (0-347)
  948. return  unknown
  949. note    Unlike the other BIOS character functions character position is
  950.         specified in pixels rather than rows and columns.
  951.  
  952.  
  953. Function 4Ch    Draw Arc (Hercules Graphics Card Plus)
  954. entry   AH      4Ch
  955. return  unknown
  956.  
  957.  
  958. Function 4Dh    Draw Circle (Hercules Graphics Card Plus)
  959. entry   AH      4Dh
  960. return  unknown
  961.  
  962.  
  963. Function 4Eh    Fill Area (Hercules Graphics Card Plus)
  964. entry   AH      4Eh
  965. return  unknown
  966.  
  967.  
  968. Function 6Ah    Direct Graphics Interface Standard (DGIS)
  969. entry   AH      6Ah
  970.         AL      00h     Inquire Available Devices
  971.                         BX      0
  972.                         CX      0
  973.                         DX      buffer length (may be 0)
  974.                         ES:DI   address of buffer
  975.                 return  BX      number of bytes stored in buffer
  976.                         CX      bytes req'd for all descriptions (0 if no DGIS)
  977.                 note    Buffer contains descriptions and addresses of DGIS-
  978.                         compatible display(s) and printer(s)
  979.                 01h     Redirect Character Output
  980.                         CX      0
  981.                         ES:DI   address of device to send INT 10 output to
  982.                 return  CX      0    output could not be redirected
  983.                             else INT 10h output now routed to requested display
  984.                 02h     Inquire int 10 Output Device
  985.                         ES:DI   0:0
  986.                 return  ES:DI   0:0  if current display is non-DGIS
  987.                                 else address of the current DGIS INT 10 display
  988.  
  989.  
  990. Function 6Fh    Set Video Mode (VEGA Extended EGA/VGA)
  991. entry   AH      6F
  992.         AL      05h
  993.         BL      mode|     (graphics mode if graphics resolution listed)
  994.                     | text |pixel| graphic|color|disp|scrn| system
  995.                     | resol|box  |resoltn |     |page|addr|
  996.                 62h               800x600   16              VEGA Extended EGA
  997.                 65h              1024x768   16              VEGA Extended EGA
  998.                 66h               640x400  256              VEGA Extended VGA
  999.                 67h               640x480  256              VEGA Extended VGA
  1000.                 68h               720x540  256              VEGA Extended VGA
  1001.                 69h               800x600  256              VEGA Extended VGA
  1002.  
  1003.  
  1004. Function 70h    Get Video RAM Address                        (Tandy 1000)
  1005. entry   AH      70h
  1006. return  AX      segment addresses of the following
  1007.                 BX      offset address of green plane
  1008.                 CX      segment address of green plane
  1009.                 DX      segment address of red/blue plane
  1010. note    (red offset = 0, blue offset = 4000)
  1011.  
  1012.  
  1013. Function 71h    Get INCRAM Addresses                         (Tandy 1000)
  1014. entry   AH      71h
  1015. return  AX      segment address of the following
  1016.                 BX      segment address of INCRAM
  1017.                 CX      offset address of INCRAM
  1018.  
  1019.  
  1020. Function 72h    Scroll Screen Right                          (Tandy 1000)
  1021. entry   AH      72h
  1022.         AL      number of columns blanked at left of page
  1023.                 00h     blank window
  1024.         BH      attributes to be used on blank columns
  1025.         CH,CL   row, column address of upper left corner
  1026.         DH,DL   row, column address of lower right corner
  1027.  
  1028.  
  1029. Function 73h    Scroll Screen Left                           (Tandy 1000)
  1030. entry   AH      73h
  1031.         AL      number of columns blanked at right of page
  1032.                 00h     blank window
  1033.         BH      attributes to be used on blank columns
  1034.         CH,CL   row, column address of upper left corner
  1035.         DH,DL   row, column address of lower right corner
  1036.  
  1037.  
  1038. Function 80h    DESQview - Set (something)
  1039. entry   AH      80h 
  1040.         DX      4456h ('DV')
  1041.         ES:DI   pointer to FAR subroutine to be called on?
  1042. return  DS      segment of DESQview data structure for video buffer
  1043. note 1) This function is probably meant for internal use only, due to the magic
  1044.         value required in DX
  1045.      2) The subroutine seems to be called when the DESQview menu is accessed
  1046.         on entry, AL = 03h or 04h
  1047.  
  1048.  
  1049. Function 81h    DESQview video - Get something?
  1050. entry   AH      81h
  1051.         DX      4456h ('DV')
  1052. return  ES    segment of DESQview data structure for video buffer
  1053.         byte ES:[0] = current window number
  1054. note    This function is probably meant for internal use only, due to the
  1055.         magic value required in DX
  1056.  
  1057.  
  1058. Function 82h    DESQview - Get Current Window Info
  1059. entry   AH      82h
  1060.         DX      4456h ('DV')
  1061. return  AH      unknown
  1062.         AL      current window number
  1063.         BH      unknown
  1064.         BL      direct screen writes
  1065.                 0       program does not do direct writes
  1066.                 1       program does direct writes, so shadow buffer not usable
  1067.         CH      unknown
  1068.         CL      current video mode
  1069.         DS      segment in DESQview for data structure
  1070.                 in DV 2.00,
  1071.                   byte DS:[0] = window number
  1072.                   word DS:[1] = segment of other data structure
  1073.                   word DS:[3] = segment of window's object handle
  1074.         ES      segment of DESQview data structure for video buffer
  1075. note    This function is probably meant for internal use only, due to the magic
  1076.         value required in DX
  1077.  
  1078.  
  1079. Function 0F0h   Microsoft Mouse driver EGA support - Read One Register
  1080. entry   AH      0F0h
  1081.         BL      register number
  1082.         DX      group index
  1083.                 (pointer/data chips)
  1084.                 00h     CRT Controller (25 reg) 3B4h mono, 3D4h color
  1085.                 08h     sequencer (5 registers) 3C4h
  1086.                 10h     graphics controller (9 registers) 3CEh
  1087.                 18h     attribute controller (20 registers) 3C0h
  1088.                 (single registers)
  1089.                 20h     miscellaneous output register 3C2h
  1090.                 28h     feature control register (3BAh mono, 3DAh color
  1091.                 30h     graphics 1 position register 3CCh
  1092.                 38h     graphics 2 position register 3CAh
  1093. return  BL      data
  1094.  
  1095.  
  1096. Function 0F1h   Microsoft Mouse driver EGA support - Write One Register
  1097. entry   AH      0F1h
  1098.         DX      group index (see function F0h)
  1099.         BL      register number
  1100.         BH      value to write
  1101. return  BL      data
  1102.  
  1103.  
  1104. Function 0F2h   Microsoft Mouse driver EGA support - Read Register Range
  1105. entry   AH      0F2h
  1106.         CH      starting register number
  1107.         CL      number of registers (>1)
  1108.         DX      group index
  1109.                 00h     CRTC (3B4h mono modes, 3D4h color modes)
  1110.                 08h     sequencer 3C4h
  1111.                 10h     graphics controller 3CEh
  1112.                 18h     attribute controller 3C0h
  1113.         ES:BX   pointer to buffer, CL bytes
  1114.  
  1115.  
  1116. Function 0F3h   Microsoft Mouse driver EGA support - Write Register Range
  1117. entry   AH      0F3h
  1118.         CH      starting register
  1119.         CL      number of registers (>1)
  1120.         DX      group index
  1121.                 00h     CRTC (3B4h mono modes, 3D4h color modes)
  1122.                 08h     sequencer 3C4h
  1123.                 10h     graphics controller 3CEh
  1124.                 18h     attribute controller 3C0h
  1125.         ES:BX   pointer to buffer, CL bytes
  1126.  
  1127.  
  1128. Function 0F4h   Microsoft Mouse driver EGA support - Read Register Set
  1129. entry   AH      0F4h
  1130.         CX      number of registers (>1)
  1131.         ES:BX   pointer to table of records in this format:
  1132.           bytes 1-2 group index
  1133.                 (pointer/data chips)
  1134.                 00h     CRTC (3B4h mono modes, 3D4h color modes)
  1135.                 08h     sequencer 3C4h
  1136.                 10h     graphics controller 3CEh
  1137.                 18h     attribute controller 3C0h
  1138.                 (single registers)
  1139.                 20h     miscellaneous output register 3C2h
  1140.                 28h     feature control register (3BAh mono modes, 3DAh color)
  1141.                 30h     graphics 1 position register 3CCh
  1142.                 38h     graphics 2 position register 3CAh
  1143.          byte 3 register number (0 for single registers)
  1144.          byte 4 register value
  1145.  
  1146.  
  1147. Function 0F5h   Microsoft Mouse driver EGA support - Read Register Set
  1148. entry   AH      0F5h
  1149.         CX      number of registers (>1)
  1150.         ES:BX   pointer to table of records in this format:
  1151.           bytes 1-2 group index
  1152.                 (pointer/data chips)
  1153.                 00h     CRTC (3B4h mono modes, 3D4h color modes)
  1154.                 08h     sequencer 3C4h
  1155.                 10h     graphics controller 3CEh
  1156.                 18h     attribute controller 3C0h
  1157.                 (single registers)
  1158.                 20h     miscellaneous output register 3C2h
  1159.                 28h     feature control register (3BAh mono modes, 3DAh color)
  1160.                 30h     graphics 1 position register 3CCh
  1161.                 38h     graphics 2 position register 3CAh
  1162.          byte 3 register number (0 for single registers)
  1163.          byte 4 register value
  1164.  
  1165.  
  1166. Function 0F6h   Microsoft Mouse driver EGA support
  1167.                 Revert to Default Registers
  1168. entry   AH      0F6h
  1169. return  unknown
  1170.  
  1171.  
  1172. Function 0F7h   Microsoft Mouse driver EGA support
  1173.                 Define Default Register Table
  1174. entry   AH      0F7h
  1175.         DX      port number
  1176.         ES:BX   address of table of one byte entries, one byte to be written to
  1177.                 each register
  1178.                 (pointer/data chips)
  1179.                 00h     CRTC (3B4h mono modes, 3D4h color modes)
  1180.                 08h     sequencer 3C4h
  1181.                 10h     graphics controller 3CEh
  1182.                 18h     attribute controller 3C0h
  1183.                 (single registers)
  1184.                 20h     miscellaneous output register 3C2h
  1185.                 28h     feature control register (3BAh mono, 3DAh color)
  1186.                 30h     graphics 1 position register 3CCh
  1187.                 38h     graphics 2 position register 3CAh
  1188.  
  1189.  
  1190. Function 0FAh   Microsoft Mouse driver EGA support - Interrogate Driver
  1191. entry   AH      0FAh
  1192.         BX      00h
  1193. return  BX      00h     if mouse driver not present
  1194.         ES:BX   pointer to EGA Register Interface version number, if present:
  1195.                 byte 1  major release number
  1196.                 byte 2  minor release number
  1197.  
  1198.  
  1199. Function 0FEh   Get Alternate Screen Buffer Address (text mode only)
  1200.                                                     (Topview/DesQview/Taskview)
  1201. entry   AH     0FEh
  1202.         ES:DI  segment:offset of assumed video buffer
  1203. return: ES:DI  segment:offset of actual video buffer
  1204. note 1) This alternate video buffer can be written to directly, in the same
  1205.         manner as writing to B:000 or B:800. The MT program will manage the
  1206.         actual display.
  1207.      2) There is no need to synchronize vertical retrace when writing to the
  1208.         alternate buffer; this is managed by the MT program
  1209.      3) If TopView or DESQview is not running, ES:DI is returned unchanged.
  1210.      4) TopView requires that function 0FFh be called every time you write into
  1211.         the buffer to tell TopView that something changed
  1212.  
  1213.  
  1214. Function 0FFh   Update Real Display (text mode only)                  (TopView)
  1215.                 Update Video Buffer                 (Topview/DesQview/Taskview)
  1216. entry   AH      0FFh
  1217.         CX      number of sequential characters that have been modified
  1218.         DI      offset of first character that has been modified
  1219.         ES      segment of video buffer
  1220. return  unknown
  1221. note 1) DesQview supports this call, but does not require it
  1222.      2) Avoid CX=0
  1223.  
  1224.  
  1225. ┌─────────────────────────────────────────────────────────────────────────────┐
  1226. │Interrupt 11h  Equipment Check                                               │
  1227. └─────────────────────────────────────────────────────────────────────────────┘
  1228. (0:0044h)       fetch a code describing active peripherals.
  1229. entry   AH      11h
  1230. return  AX      Equipment listing word          Bits are:
  1231.                 0       number of floppy drives
  1232.                         0       no drives
  1233.                         1       bootable (IPL) diskette drive installed
  1234.                 1       math chip
  1235.                         0       no math coprocessor (80x87) present
  1236.                         1       math coprocessor (80x87) present
  1237.          (PS/2) 2       0       mouse not installed
  1238.                         1       mouse installed
  1239.           (PC)  2,3     system board RAM
  1240.                         0,0     16k    (PC-0, PC-1)
  1241.                         1,1     64k    (PC-2, XT)
  1242.                         note 1) not commonly used. Set both bits to 1
  1243.                              2) both bits always 1 in AT
  1244.                 4,5     initial video mode
  1245.                         0,0     no video installed (use with dumb terminal)
  1246.                         0,1     40x25 color      (CGA)
  1247.                         1,0     80x25 color      (CGA, EGA, PGA, MCGA, VGA)
  1248.                         1,1     80x25 monochrome (MDA or Hercules, most super-
  1249.                                                   hires mono systems)
  1250.                 6,7     number of diskette drives (only if bit 0  1)
  1251.                         0,0     1 drives
  1252.                         0,1     2 drives
  1253.                         1,0     3 drives
  1254.                         1,1     4 drives
  1255.                 8       0       DMA present 
  1256.                         1       no DMA (PCjr, some Tandy 1000s, 1400LT)
  1257.                 9,A,B   number of RS232 serial ports (0-3)
  1258.                         0,0,0   none
  1259.                         0,0,1   1
  1260.                         0,1,0   2
  1261.                         0,1,1   3
  1262.                         1,0,0   4
  1263.                 C       0       no game I/O attached
  1264.                         1       game I/O attached (default for PCjr)
  1265.                 D       serial accessory installation
  1266.                         0       no serial accessories installed
  1267.                         1       Convertible - internal modem installed
  1268.                         1       PCjr - serial printer attached
  1269.                 E,F     number of parallel printers
  1270.                         0,0     none
  1271.                         0,1     one   (LPT1, PRN)
  1272.                         1,0     two   (LPT2)
  1273.                         1,1     three (LPT3)
  1274.                         note    Models before PS/2 would allow a fourth
  1275.                                 parallel printer. Remapping of the BIOS in the
  1276.                                 PS/2s does not allow the use of LPT4.
  1277.  
  1278.  
  1279.  
  1280.  
  1281. ┌─────────────────────────────────────────────────────────────────────────────┐
  1282. │Interrupt 12h  Memory Size                                                   │
  1283. └─────────────────────────────────────────────────────────────────────────────┘
  1284. (0:0048h)       get system memory
  1285. return  AX      number of contiguous 1K RAM blocks
  1286. note 1) This service does not depend on the setting of the motherboard switches
  1287.      2) This is the same value stored in absolute address 04:13h
  1288.  
  1289.  
  1290.  
  1291.  
  1292. ┌─────────────────────────────────────────────────────────────────────────────┐
  1293. │Interrupt 13h  Disk I/O - access the disk drives (floppy and hard disk)      │
  1294. └─────────────────────────────────────────────────────────────────────────────┘
  1295. (0:004Ch)      does not try rereading disk if an error is returned
  1296.  
  1297.                                         
  1298. Function 00h    Reset - reset the disk controller chip
  1299. entry   AH      00h
  1300.         DL      drive (if bit 7 is set both hard disks and floppy disks reset)
  1301. return  AH      status
  1302. note 1) Forces controller chip to recalibrate read/write heads
  1303.      2) Some systems (Sanyo 55x) this resets all drives
  1304.  
  1305.  
  1306. Function 01h    Get Status of disk system
  1307. entry   AH      01h
  1308.         DL      drive (hard disk if bit 7 set)
  1309. return  AL      status of most recent operation
  1310.                 00h     successful completion
  1311.                 01h     bad command
  1312.                 02h     address mark not found
  1313.                 03h     tried to write on write-protected disk
  1314.                 04h     sector not found
  1315.                 05h     reset failed (hard disk)
  1316.                 06h     diskette removed or changed
  1317.                 07h     bad parameter table (hard disk)
  1318.                 08h     DMA overrun
  1319.                 09h     attempt to DMA across 64K boundary
  1320.                 0Ah     bad sector detected (hard disk)
  1321.                 0Bh     bad track detected (hard disk)
  1322.                 0Ch     unsupported track
  1323.                 0Dh     invalid number of sectors on format (hard disk)
  1324.                 0Eh     control data address mark detected (hard disk)
  1325.                 0Fh     DMA arbitration error (hard disk)
  1326.                 10h     bad CRC/EEC on read
  1327.                 11h     data ECC corrected
  1328.                 20h     controller failure
  1329.                 40h     seek failed
  1330.                 80h     timeout
  1331.                 0AAh    drive not ready (hard disk)
  1332.                 0BBh    undefined error (hard disk)
  1333.                 0CCh    write fault     (hard disk)
  1334.                 0E0h    status error    (hard disk)
  1335.                 0FFh    sense operation failed (hard disk)
  1336.  
  1337.  
  1338. Function 02h    Read Sectors - read one or more sectors from diskette
  1339. entry   AH      02h
  1340.         AL      number of sectors to read 
  1341.         BX      address of buffer (ES=segment)
  1342.         CH      track number (0-39 or 0-79 for floppies)
  1343.                 (for hard disk, bits 8,9 in high bits of CL)
  1344.         CL      sector number (1 to 18, not value checked)
  1345.         DH      head number (0 or 1)
  1346.         DL      drive (0=A, 1=B, etc.) (bit 7=0)  (drive 0-7)
  1347.         ES:BX   address to store/fetch data  (buffer to fill)
  1348.        [0000:0078]  dword pointer to diskette parms
  1349. return  CF      clear (0) for successful
  1350.                 set (1) failure
  1351.                 AH      status (00h, 02h, 03h, 04h, 08h, 09h, 10h, 0Ah, 20h,
  1352.                         40h, 80h)
  1353.         AL      number of sectors transferred
  1354. note 1) Number of sectors begins with 1, not 0
  1355.      2) Trying to read zero sectors is considered a programming error; results
  1356.         are not defined
  1357.                                                                         
  1358.  
  1359. Function 03h    Write Sectors - write from memory to disk
  1360. entry   AH      03h
  1361.         AL      number of sectors to write (1-8)
  1362.         CH      track number (for hard disk, bits 8,9 in high bits of CL)
  1363.         CL      beginning sector number
  1364.                 (if hard disk, high two bits are high bits of track #)
  1365.         DH      head number
  1366.         DL      drive number (0-7)
  1367.         ES:BX   address of buffer for data
  1368. return  CF      set if error
  1369.                 AH      status (see above)
  1370.         AL      number of sectors written
  1371. note 1) Number of sectors begins with 1, not 0
  1372.      2) Trying to write zero sectors is considered a programming error; results
  1373.         are not defined
  1374.  
  1375.  
  1376. Function 04h    Verify - verify that a write operation was successful
  1377. entry   AH      04h
  1378.         AL      number of sectors to verify (1-8)
  1379.         CH      track number  (for hard disk, bits 8,9 in high bits of CL)
  1380.         CL      beginning sector number
  1381.         DH      head number
  1382.         DL      drive number (0-7)
  1383. return  CF      set on error
  1384.                 AH      status (see above) 
  1385.         AL      number of sectors verified
  1386.        
  1387.  
  1388. Function 05h    Format Track - write sector ID bytes for 1 track
  1389. entry   AH      05h
  1390.         AL      number of sectors to create on this track
  1391.         CH      track (or cylinder) number
  1392.         CL      sector number
  1393.         DH      head number (0, 1)
  1394.         DL      drive number (0-3)
  1395.         ES:BX   pointer to 4-byte address field (C-H-R-N)
  1396.                 byte 1 = (C) cylinder or track
  1397.                 byte 2 = (H) head
  1398.                 byte 3 = (R) sector
  1399.                 byte 4 = (N) bytes/sector (0 = 128, 1 = 256, 2 = 512, 3 = 1024)
  1400. return  CF      set if error occurred
  1401.                 AH      status code (see above)
  1402. note    Not valid for ESDI hard disks on PS/2
  1403.                  
  1404.  
  1405. Function 06h    Hard Disk - format track and set bad sector flags 
  1406.                                                      (PC2, PC-XT, and Portable)
  1407. entry   AH      06h
  1408.         AL      interleave value (XT only)
  1409.         CH      cylinder number (bits 8,9 in high bits of CL)
  1410.         CL      sector number
  1411.         DH      head
  1412.         DL      drive
  1413.         ES:BX   512 byte format buffer
  1414.                 the first 2*(sectors/track) bytes contain f,n for each sector
  1415.                    f  00Fh for good sector 
  1416.                       80h for bad sector
  1417.                    n  sector number
  1418. return  AH      status code 
  1419.  
  1420.                                      
  1421. Function 07h    Hard Disk - format the drive starting at the desired track
  1422.                                                       (PC2, PC-XT and Portable)
  1423. entry   AH      07h
  1424.         AL      interleave value (XT only) (01h-10h) 
  1425.         CH      cylinder number (bits 8,9 in high bits of CL) (00h-03FFh)
  1426.         CL      sector number
  1427.         DH      head number (0-7)
  1428.         DL      drive number (80h-87h, 80h=C, 81h=D,...)
  1429.         ES:BX   format buffer, size = 512 bytes
  1430.                 the first 2*(sectors/track) bytes contain f,n for each sector
  1431.                 f=00h for good sector 
  1432.                   80h for bad sector
  1433.                 n=sector number
  1434. return  AH      status code (see above)
  1435. note    Award AT BIOS routines are extended to handle more than 1024 cylinders.
  1436.         AL      number of sectors
  1437.         CH      cylinder numberm low 8 bits
  1438.         CL      sector number bits 0-5, bits 6-7 are high 2 cylinder bits
  1439.         DH      head number (bits 0-5) bits 6-7 are extended high cyls (>1024)
  1440.         DL      drive number (0-1 for diskette, 80h-81h for hard disk)
  1441.         ES:BX   transfer address
  1442.  
  1443.  
  1444. Function 08h    Read Drive Parameters             (XT, CONV, AT, XT/286, PS/2)
  1445. entry   AH      08h 
  1446.         DL      drive number (0-2)
  1447. return  CF      set on error
  1448.                 AH      status code (see above)
  1449.         BL      drive type (see AH=17h below) (AT/PS2 floppies only)
  1450.         CH      maximum useable value for cylinder number
  1451.         CL      maximum useable value for sector number or cylinder number 
  1452.         DH      maximum usable value for head number
  1453.         DL      number of consecutive acknowledging drives (0-2)
  1454.         ES:DI   drive parameter table
  1455.  
  1456.  
  1457. Function 09h    Initialize Two Fixed Disk Base Tables    (XT, AT, XT/286, PS/2)
  1458.                 (install nonstandard drive)
  1459. entry   AH      09h
  1460. return  CF      set on error
  1461.                 AH      status code (see above)
  1462.                 data block definitions:
  1463.                 +0   maximum number of cylinders (dw)
  1464.                 +2   maximum number of heads (db)
  1465.                 +3   starting reduced write current cylinder  (dw - XT only)
  1466.                 +5   starting write precomp cylinder (dw)
  1467.                 +7   maximum ECC data burst length (db - XT only)
  1468.                 +8   control byte: Bits  
  1469.                      0,1,2 ─ drive option
  1470.                      3,4,5 - always zero
  1471.                          6 - disable ECC retries
  1472.                          7 - disable access retries
  1473. note 1) Int 41h points to table for drive 0
  1474.      2) Int 46h points to table for drive 1
  1475.      3) 41h used by XT, 41h and 46h used by AT
  1476.  
  1477.  
  1478. Function 0Ah    Read Long   (Hard disk)                 (XT, AT, XT/286, PS/2)
  1479. entry   AH      0Ah
  1480.         CH      cylinder number (bits 8,9 in high bits of CL)
  1481.         CL      sector number
  1482.         DL      drive ID
  1483.         DH      head number
  1484.         ES:BX   pointer to buffer to fill
  1485. return  CF      set on error
  1486.                 AH      status code (see above)
  1487.         AL      number of sectors actually transferred
  1488. note 1) A "long" sector includes a 4 byte EEC (Extended Error Correction) code
  1489.      2) Used for diagnostics only on PS/2 systems
  1490.  
  1491.  
  1492. Function 0Bh    Write Long                              (XT, AT, XT/286, PS/2)
  1493. entry   AH      0Bh
  1494.         CH      cylinder (bits 8,9 in high bits of CL)
  1495.         CL      sector number
  1496.         DH      head number
  1497.         DL      drive ID
  1498.         ES:BX   pointer to buffer containing data
  1499. return  CF      set on error
  1500.                 AH      status code (see above)   
  1501.         AL      number of sectors actually transferred
  1502. note 1) A "long" sector includes a 4 byte EEC (Extended Error Correction) code
  1503.      2) Used for diagnostics only on PS/2 systems
  1504.  
  1505.  
  1506. Function 0Ch    Seek To Cylinder                (except PC, PCjr)
  1507. entry   AH      0Ch
  1508.         CH      cylinder number (bits 8,9 in high bits of CL)
  1509.         DH      head number
  1510.         DL      drive ID
  1511. return  CF      set on error
  1512.                 AH      status code (see above)
  1513. note 1) Positions heads over a particular cylinder
  1514.  
  1515.  
  1516. Function 0Dh    Alternate Disk Reset                    (except PC, PCjr)
  1517. entry   AH      0Dh
  1518.         DL      drive ID
  1519. return  CF      set on error
  1520.         AH      status code (see above)
  1521. note    Not for PS/2 ESDI hard disks
  1522.  
  1523.  
  1524. Function 0Eh    Read Sector Buffer                         (XT, Portable PS/2)
  1525. entry   AH      0Eh 
  1526.         AL      number of sectors
  1527.         CH      cylinder (bits 8,9 in top two bits of CL)
  1528.         CL      sector number
  1529.         DH      head number
  1530.         DL      drive number
  1531.         ES:BX   pointer to buffer
  1532. return  CF      set on error
  1533.                 AH      status code (see above)
  1534.         AL      number of sectors actually transferred    
  1535. note 1) Transfers controller's sector buffer.  No data is read from the drive
  1536.      2) Used for diagnostics only on PS/2 systems
  1537.       
  1538.  
  1539. Function 0Fh    Write sector buffer                          (XT, Portable)
  1540. entry   AH      0Fh 
  1541.         AL      number of sectors
  1542.         CH      cylinder (bits 8,9 in top two bits of CL)
  1543.         CL      sector number
  1544.         DH      head number
  1545.         DL      drive number
  1546.         ES:BX   pointer to buffer
  1547. return  CF      set if error
  1548.                 AH      status code
  1549.         AL      number of sectors actually transferred
  1550. note 1) Should be called before formatting to initialize the controller's
  1551.         sector buffer.
  1552.      2) Used for diagnostics only on PS/2 systems
  1553.       
  1554.  
  1555. Function 10h    Test For Drive Ready
  1556. entry   AH      10h
  1557.         DL      drive ID
  1558. return  CF      set on error
  1559.                 AH      status code (see above)
  1560.                                     
  1561.  
  1562. Function 11h    Recalibrate Drive
  1563. entry   AH      11h
  1564.         DL      drive ID
  1565. return  CF      set on error
  1566.                 AH      status code (see above)
  1567.               
  1568.  
  1569. Function 12h    Controller RAM Diagnostic                (XT, Portable, PS/2)
  1570. entry   AH      12h
  1571. return  CF      set on error
  1572.                 AH      status code (see AH=1 above)
  1573. note    Used for diagnostics only on PS/2 systems
  1574.  
  1575.  
  1576. Function 13h    Drive Diagnostic                             (XT, Portable)
  1577. entry   AH      13h
  1578. return  CF      set on error
  1579.                 AH      status code (see above)
  1580. note    Used for diagnostics only on PS/2 systems
  1581.  
  1582.  
  1583. Function 14h    Controller Internal Diagnostic               (AT, XT/286)
  1584. entry   AH      14h
  1585. return  CF      set on error
  1586.         AH      status code (see above)
  1587. note 1) OEM is Western Digital 1003-WA2 hard/floppy combination controller
  1588.         in AT and XT/286.
  1589.      2) Used for diagnostics only in PS/2 systems
  1590.  
  1591.  
  1592. Function 15h    Get Disk Type                                (except PC and XT)
  1593. entry   AH      15h
  1594.         DL      drive ID
  1595. return  AH      disk type
  1596.                 00h     no drive is present
  1597.                 01h     diskette, no change detection present
  1598.                 02h     diskette, change detection present
  1599.                 03h     fixed disk
  1600.         CX:DX   number of 512-byte sectors when AH = 03h
  1601.  
  1602.  
  1603. Function 16h    Change of Disk Status (diskette)             (except PC and XT)
  1604. entry   AH      16h
  1605. return  AH      disk change status
  1606.                 00h     no disk change
  1607.                 01h     disk changed
  1608.         DL      drive that had disk change
  1609.       
  1610.  
  1611. Function 17h    Set Disk Type for Format (diskette)          (except PC and XT)
  1612. entry   AH      17h
  1613.         AL      00h     no disk
  1614.                 01h     360kb diskette in 360Kb drive
  1615.                 02h     360kb diskette in 1.2M drive
  1616.                 03h     1.2M diskette in 1.2M drive
  1617.                 04h     720kb diskette in 720Kb drive
  1618.         DL      drive number
  1619. return  AH      status of operation
  1620. note    This function is probably enhanced for the PS/2 series to detect
  1621.         1.44 in 1.44 and 720k in 1.44.
  1622.  
  1623.  
  1624. Function 18h    Set Media Type For Format  (diskette)        (AT, XT/286, PS/2)
  1625. entry   AH      18h
  1626.         CH      lower 8 bits of number of tracks
  1627.         CL      high 2 bits of number of tracks (6,7) sectors per track 
  1628.                 (bits 0-5)
  1629.         DL      drive number
  1630. return  AH      00h      if requested combination supported
  1631.                 01h      if function not available
  1632.                 0Ch      if not suppported or drive type unknown
  1633.                 80h      if there is no media in the drive
  1634.         ES:DI   pointer to 11-byte parameter table
  1635.  
  1636.  
  1637. Function 19h    Park Hard Disk Heads                         (XT/286, PS/2)
  1638. entry   AH      19h 
  1639.         DL      drive
  1640. return  CF      set on error
  1641.                 AH      error code
  1642.  
  1643.  
  1644. Function 1Ah    ESDI Hard Disk - Format                         (PS/2)
  1645. entry   AH      1Ah
  1646.         AL      defect table count
  1647.         CL      format modifiers
  1648.                 bits    0 ignore primary defect map
  1649.                         1 ignore secondary defect map
  1650.                         2 update secondary defect map
  1651.                         3 perform surface analysis
  1652.                         4 generate periodic interrupt
  1653.         DL      drive
  1654.         ES:BX   pointer to defect table
  1655. return  CF      set on error
  1656.                 AH      status (see AH=1 above)
  1657. note    If periodic interrupt selected, int 15h/AH=0Fh is called after each
  1658.         cylinder is formatted
  1659.  
  1660.  
  1661.  
  1662.  
  1663.  
  1664. ┌─────────────────────────────────────────────────────────────────────────────┐
  1665. │Interrupt 14h  Initialize and Access Serial Port For Int 14                  │
  1666. └─────────────────────────────────────────────────────────────────────────────┘
  1667. (0:0050h)       the following status is defined:
  1668.  
  1669.         serial status byte:
  1670.         bits    0 delta clear to send
  1671.                 1 delta data set ready
  1672.                 2 trailing edge ring detector
  1673.                 3 delta receive line signal detect
  1674.                 4 clear to send
  1675.                 5 data set ready
  1676.                 6 ring indicator
  1677.                 7 receive line signal detect
  1678.  
  1679.         line status byte:
  1680.         bits    0 data ready
  1681.                 1 overrun error
  1682.                 2 parity error
  1683.                 3 framing error
  1684.                 4 break detect
  1685.                 5 transmit holding register empty
  1686.                 6 transmit shift register empty
  1687.                 7 time out  note: if bit 7 set then other bits are invalid
  1688.  
  1689.  All routines have AH=function number and DX=RS232 card number (0 based).
  1690. AL=character to send or received character on exit, unless otherwise noted.
  1691.  
  1692. entry   AH      00h     Initialize And Access Serial Communications Port
  1693.                         bit pattern: BBBPPSLL
  1694.                         BBB = baud rate:   110,150,300,600,1200,2400,4800,9600 
  1695.                         PP  = parity:      01 = odd, 11 = even 
  1696.                         S   = stop bits:   0 = 1, 1 = 2
  1697.                         LL  = word length: 10 = 7-bits, 11 = 8-bits 
  1698.         AL      parms for initialization:
  1699.                 bit pattern:
  1700.                 0       word length
  1701.                 1       word length
  1702.                 2       stop bits 
  1703.                 3       parity
  1704.                 4       parity
  1705.                 5       baud rate 
  1706.                 6       baud rate 
  1707.                 7       baud rate 
  1708.                 word length     10      7 bits
  1709.                                 11      8 bits
  1710.                 stop bits       0       1 stop bit
  1711.                                 1       2 stop bits
  1712.                 parity          00      none
  1713.                                 01      odd
  1714.                                 11      even
  1715.                 baud rate       000     110 baud
  1716.                                 001     150 baud
  1717.                                 010     300 baud
  1718.                                 011     600 baud
  1719.                                 100     1200 baud
  1720.                                 101     2400 baud
  1721.                                 110     4800 baud
  1722.                                 111     9600 baud  (4800 on PCjr)
  1723.         DX      port number
  1724. return  AH      line status
  1725.         AL      modem status
  1726.  
  1727.  
  1728. Function 01h    Send Character in AL to Comm Port DX (0 or 1)
  1729. entry   AH      01h
  1730.         AL      character
  1731.         DX      port number (0 or 1)
  1732. return  AH      RS232 status code
  1733.                 bit     0       data ready
  1734.                         1       overrun error
  1735.                         2       parity error
  1736.                         3       framing error
  1737.                         4       break detected
  1738.                         5       transmission buffer register empty
  1739.                         6       transmission shift register empty
  1740.                         7       timeout
  1741.         AL      modem status
  1742.                 bit
  1743.                         0       delta clear-to-send
  1744.                         1       delta data-set-ready
  1745.                         2       trailing edge ring detected
  1746.                         3       change, receive line signal detected
  1747.                         4       clear-to-send
  1748.                         5       data-set-ready
  1749.                         6       ring received
  1750.                         7       receive line signal detected
  1751.  
  1752.  
  1753. Function 02h    Wait For A Character From Comm Port DX
  1754. entry   AH      02h
  1755. return  AL      character received
  1756.         AH      error code (see above)(00h for no error)
  1757.  
  1758.  
  1759. Function 03h    Fetch the Status of Comm Port DX (0 or 1) 
  1760. entry   AH      03h
  1761. return  AH      set bits (01h) indicate comm-line status 
  1762.                 bit     7       timeout
  1763.                 bit     6       empty transmit shift register
  1764.                 bit     5       empty transmit holding register
  1765.                 bit     4       break detected ("long-space")
  1766.                 bit     3       framing error
  1767.                 bit     2       parity error
  1768.                 bit     1       overrun error
  1769.                 bit     0       data ready
  1770.         AL      set bits indicate modem status
  1771.                 bit     7       received line signal detect
  1772.                 bit     6       ring indicator
  1773.                 bit     5       data set ready
  1774.                 bit     4       clear to send 
  1775.                 bit     3       delta receive line signal detect
  1776.                 bit     2       trailing edge ring detector 
  1777.                 bit     1       delta data set ready
  1778.                 bit     0       delta clear to send
  1779.  
  1780.  
  1781. Function 04h    Extended Initialize                             (PC Convertible)
  1782. entry   AH      04h
  1783.         AL      break status
  1784.                 01h     if break
  1785.                 00h     if no break
  1786.         BH      parity
  1787.                 00h     no parity
  1788.                 01h     odd parity
  1789.                 02h     even parity
  1790.                 03h     stick parity odd
  1791.                 04h     stick parity even
  1792.         BL      number of stop bits
  1793.                 00h     one stop bit
  1794.                 01h     2 stop bits (1½ if 5 bit word length)
  1795.         CH      word length
  1796.                 00h     5 bits
  1797.                 01h     6 bits
  1798.                 02h     7 bits
  1799.                 03h     8 bits
  1800.         CL      baud rate
  1801.                 00h     110
  1802.                 01h     150
  1803.                 02h     300
  1804.                 03h     600
  1805.                 04h     1200
  1806.                 05h     2400
  1807.                 06h     4800
  1808.                 07h     9600
  1809.                 08h     19200
  1810. return  AL      modem status
  1811.         AH      line control status
  1812.  
  1813.  
  1814. Function 05h    Extended Communication Port Control             (PS/2)
  1815. entry   AH      05h
  1816.         AL      00h     read modem control register
  1817.                 return  BL      modem control reg (see AL=1)
  1818.         AL      01h     write modem control register
  1819.         BL      modem control register: (for AL=00 and AL=01)  bits
  1820.                 0       data terminal ready
  1821.                 1       request to send
  1822.                 2       out1
  1823.                 3       out2
  1824.                 4       loop
  1825.                 5,6,7   reserved
  1826. return  AH      status
  1827.  
  1828. ┌─────────────────────────────────────────────────────────────────────────────┐
  1829. │Interrupt 15h  Cassette I/O                                                  │
  1830. └─────────────────────────────────────────────────────────────────────────────┘
  1831. (0:0054h)       Renamed "System Services" on PS/2 line
  1832.  
  1833. Function 00h    Turn Cassette Motor On                          (PC, PCjr only)
  1834. entry   AH      00h
  1835. return  AH      86h     no cassette present
  1836.         CF      set on error
  1837.                 AH      error code
  1838.                         00h     no errors
  1839.                         01h     CRC error
  1840.                         02h     bad tape signals
  1841.                                 no data transitions (PCjr)
  1842.                         03h     no data found on tape
  1843.                                 not used (PCjr)
  1844.                         04h     no data
  1845.                                 no leader (PCjr)
  1846.                         80h     invalid command
  1847.                         86h     no cassette present
  1848.                                 not valid in PCjr
  1849. note    NOP for systems where cassette not supported
  1850.  
  1851.  
  1852. Function 01h    Turn Cassette Motor Off                         (PC, PCjr only)
  1853. entry   AH      01h
  1854. return  AH      86h     no cassette present
  1855.         CF      set on error
  1856.                 AH      error code
  1857. note    NOP for systems where cassette not supported
  1858.  
  1859.  
  1860. Function 02h    Read Blocks From Cassette                       (PC, PCjr only)
  1861. entry   AH      02h
  1862.         CX      count of bytes to read
  1863.         ES:BX   pointer to data buffer
  1864. return  CF      set on error
  1865.                 AH      error code
  1866.         DX      count of bytes actually read
  1867.         ES:BX   pointer past last byte written
  1868. note 1) NOP for systems where cassette not supported
  1869.      2) Cassette operations normally read 256 byte blocks
  1870.  
  1871.  
  1872. Function 03h    Write Data Blocks to Cassette                   (PC, PCjr only)
  1873. entry   AH      03h
  1874.         CX      count of bytes to write
  1875.         ES:BX   pointer to data buffer
  1876. return  CF      set on error
  1877.                 AH      error code (see 02h)
  1878.         CX      0
  1879.         ES:BX   pointer to last byte written+1
  1880. note 1) NOP for systems where cassette not supported
  1881.      2) The last block is padded to 256 bytes with zeroes if needed
  1882.      3) No errors are returned by this service
  1883.  
  1884.  
  1885. Function 0Fh    ESDI Format Unit Periodic Interrupt          (PS/2 50, 60, 80)
  1886. entry   AH      0Fh
  1887.         AL      phase code
  1888.                 00h     reserved
  1889.                 01h     surface analysis
  1890.                 02h     formatting
  1891. return  CF      clear   if formatting should continue
  1892.                 set     if it should terminate
  1893. note    Called during ESDI drive formatting after each cylinder is completed
  1894.  
  1895.  
  1896. Function 10h    TopView API Function Calls                      (TopView)
  1897. entry   AH      00h     PAUSE   Give Up CPU Time
  1898.                         return  00h     after other processes run
  1899.                 01h     GETMEM  allocate "system" memory
  1900.                         BX      number of bytes to allocate
  1901.                         return  ES:DI pointer to block of memory
  1902.                 02h     PUTMEM  deallocate "system" memory
  1903.                         ES:DI   pointer to previously allocated block
  1904.                         return  block freed
  1905.                 03h     PRINTC  display character/attribute on screen
  1906.                         BH      attribute
  1907.                         BL      character
  1908.                         DX      segment of object handle for window
  1909.                         note    BX=0 does not display anything, it only
  1910.                                 positions the hardware cursor
  1911.                 10h     unknown
  1912.                         AL      04h thru 12h
  1913.                         return  TopView - unimplemented in DV 2.0x
  1914.                                 pops up "Programming error" window in DV 2.0x
  1915.                 11h     unknown
  1916.                 12h     unknown
  1917.                 13h     GETBIT  define a 2nd-level interrupt handler
  1918.                         ES:DI   pointer to FAR service routine
  1919.                         return  BX      bit mask indicating which bit was
  1920.                                         allocated
  1921.                                         0 if no more bits available
  1922.                 14h     FREEBIT undefine a 2nd-level interrupt handler
  1923.                         BX      bit mask from int 15/AH 13h
  1924.                 15h     SETBIT  schedule one or more 2nd-level interrupts
  1925.                         BX      bit mask for interrupts to post
  1926.                         return  indicated routines will be called at next ???
  1927.                 16h     ISOBJ   verify object handle
  1928.                         ES:DI   possible object handle
  1929.                         return   BX     -1 if ES:DI is a valid object handle
  1930.                                          0 if ES:DI is not
  1931.                 17h     TopView - unimplemented in DV 2.00
  1932.                         return  pops up "Programming Error" window in DV 2.00
  1933.                 18h     LOCATE  Find Window at a Given Screen Location
  1934.                         BH      column
  1935.                         BL      row
  1936.                         ES      segment of object handle for ?
  1937.                                 (0 = use default)
  1938.                         return  ES      segment of object handle for window
  1939.                                         which is visible at the indicated
  1940.                                         position
  1941.                 19h     SOUND   Make Tone
  1942.                         BX      frequency in Hertz
  1943.                         CX      duration in clock ticks (18.2 ticks/sec)
  1944.                         return  immediately, tone continues to completion
  1945.                         note    If another tone is already playing, the new tone
  1946.                                 does not start until completion of the previous
  1947.                                 one. In DV 2.00, it is possible to enqueue
  1948.                                 about 32 tones before the process is blocked
  1949.                                 until a note completes.
  1950.                                 In DV 2.00, the lowest tone allowed is 20 Hz
  1951.                 1Ah     OSTACK  Switch to Task's Internal Stack
  1952.                         return  stack switched
  1953.                 1Bh     BEGINC  Begin Critical Region
  1954.                         return  task-switching temporarily disabled
  1955.                         note    Will not task-switch until END CRITICAL REGION
  1956.                                 (AH=1Ch) is called
  1957.                 1Ch     ENDC    End Critical Region
  1958.                         return  task-switching enabled
  1959.                 1Dh     STOP    STOP TASK
  1960.                         ES      segment of object handle for task to be stopped
  1961.                                 (= handle of main window for that task)
  1962.                         return  indicated task will no longer get CPU time
  1963.                         note    At least in DV 2.00, this function is ignored
  1964.                                 unless the indicated task is the current task.
  1965.                 1Eh     START   Start Task
  1966.                         ES      segment of object handle for task to be started
  1967.                                 (== handle of main window for that task)
  1968.                         return  Indicated task is started up again
  1969.                 1Fh     DISPEROR Pop-Up Error Window
  1970.                         BX      bit fields:
  1971.                                 0-12    number of characters to display
  1972.                                 13,14   which mouse button may be pressed to
  1973.                                         remove window
  1974.                                         00      either
  1975.                                         01      left
  1976.                                         10      right
  1977.                                         11      either
  1978.                                 15      beep if 1
  1979.                         DS:DI   pointer to text of message
  1980.                         CH      width of error window (0 = default)
  1981.                         CL      height of error window (0 = default)
  1982.                         DX      segment of object handle
  1983.                         return  BX      status:
  1984.                                         1       left button pressed
  1985.                                         2       right button pressed
  1986.                                         27      ESC key pressed
  1987.                         note    Window remains on-screen until ESC or indicated
  1988.                                 mouse button is pressed
  1989.                 20h     TopView - unimplemented in DV 2.0x
  1990.                         return  pops up "Programming Error" window in DV 2.0x
  1991.                 21h     PGMINT  Interrupt Another Task
  1992.                         BX      segment of object handle for task to interrupt
  1993.                         DX:CX   address of FAR routine to jump to next time
  1994.                                 task is run
  1995.                         return  nothing?
  1996.                         note    The current ES, DS, SI, DI, and BP are passed
  1997.                                 to the FAR routine
  1998.                 22h     GETVER  Get Version
  1999.                         BX      00h
  2000.                         return  BX      nonzero, TopView or compatible loaded
  2001.                                 BH      minor version
  2002.                                 BL      major version
  2003.                         notes   TaskView returns BX = 0001h
  2004.                                 DESQview 2.0 returns BX = 0A01h
  2005.                 23h     POSWIN  Position Window
  2006.                         BX      segment of object handle for parent window
  2007.                                 within which to position the window (0 = full
  2008.                                 screen)
  2009.                         CH      # columns to offset from position in DL
  2010.                         CL      # rows to offset from position in DL
  2011.                         DL      bit flags
  2012.                                 0,1     horizontal position
  2013.                                         00      current
  2014.                                         01      center
  2015.                                         10      left
  2016.                                         11      right
  2017.                                 2,3     vertical position
  2018.                                         00      current
  2019.                                         01      center
  2020.                                         10      top
  2021.                                         11      bottom
  2022.                                 4       don't redraw screen if set
  2023.                                 5-7     not used
  2024.                         ES      segment of object handle for window to be
  2025.                                 positioned
  2026.                         return  nothing
  2027.                 24h     GETBUF  Get Virtual Screen Information
  2028.                         BX      segment of object handle for window (0=default)
  2029.                         return  CX      size of virtual screen in bytes
  2030.                                 DL      0 or 1, unknown
  2031.                                 ES:DI   address of virtual screen
  2032.                 25h     USTACK  Switch Back to User's Stack
  2033.                         return  stack switched back
  2034.                         note    Call only after int 15h,fn1Ah
  2035.                 26h-2Ah DesQview (TopView?) - unimplemented in DV 2.0x
  2036.                         return  pops up "Programming Error" window in DV 2.0x 
  2037.                 2Bh     POSTTASK  Awaken Task       DesQview 2.0 (TopView?)
  2038.                         BX      segment of object handle for task
  2039.                         return  nothing
  2040.                 2Ch     Start New Application in New Process
  2041.                         DesQview 2.0 (TopView?)
  2042.                         ES:DI   pointer to contents of .PIF/.DVP file
  2043.                         BX      size of .PIF/.DVP info
  2044.                         return  BX      segment of object handle for new task
  2045.                 2Dh     Keyboard Mouse Control       DesQview 2.0 
  2046.                         BL      subfunction
  2047.                                 00h     determine whether using keyboard mouse
  2048.                                 01h     turn keyboard mouse on
  2049.                                 02h     turn keyboard mouse off
  2050.                         return  (calling BL was 00h)
  2051.                                 BL      0       using real mouse
  2052.                                         1       using keyboard mouse
  2053.  
  2054.  
  2055. Function 11h    Topview commands
  2056. entry   AH      11h
  2057.         AL      various
  2058. note    In DesQview 2.0x, these function calls are identical to AH=0DEh, so
  2059.         see those below
  2060.  
  2061.  
  2062. Function 20h    PRINT.COM  (DOS internal)        (AT, XT-286, PS/2 50+)
  2063. entry   AH      20h
  2064.         AL      subfunction
  2065.                 00h     unknown (PRINT)
  2066.                 01h     unknown (PRINT)
  2067.                 10h     sets up SysReq routine on AT, XT/286, PS/2
  2068.                 11h     completion of SysReq routine (software only)
  2069. note 1) AL=0 or 1 sets or resets some flags which affect what PRINT does when
  2070.         it tries to access the disk
  2071.  
  2072.  
  2073. Function 21h    Power-On Self Test (POST) Error Log             (PS/2 50+)
  2074. entry   AH      21h
  2075.         AL       00h    read POST log
  2076.                  01h    write POST log
  2077.                         BH      device ID
  2078.                         BL      error code
  2079. return  CF      set on error
  2080.         AH      status
  2081.                 00h    OK
  2082.                        BX      number of error codes stored
  2083.                        ES:DI   pointer to error log
  2084.                 01h    list full
  2085.                 80h    invalid command
  2086.                 86h    unsupported
  2087. note    The log is a series of words, the first byte of which identifies the
  2088.         error code and the second the device.
  2089.  
  2090.  
  2091. Function 40h    Read/Modify Profiles                            (Convertible)
  2092. entry   AH      40h
  2093.         AL      00h     read system profile in CX,BX
  2094.                 01h     write system profile from CX, BX
  2095.                 02h     read internal modem profile in BX
  2096.                 03h     write internal modem profile from BX
  2097.         BX      profile info
  2098. return  BX      internal modem profile (from 02h)
  2099.         CX,BX   system profile (from 00h)
  2100.  
  2101.  
  2102. Function 41h    Wait On External Event                          (Convertible)
  2103. entry   AH      41h
  2104.         AL      condition type
  2105.                 bits 0-2: condition to wait for
  2106.                           0 any external event
  2107.                           1 compare and return if equal
  2108.                           2 compare and return if not equal
  2109.                           3 test and return if not zero
  2110.                           4 test and return if zero
  2111.                 bit 3:    reserved
  2112.                 bit 4:    1=port address, 0=user byte
  2113.                 bits 5-7: reserved
  2114.         BH      condition compare or mask value
  2115.                 condition codes:
  2116.                 0       any external event
  2117.                 1       compare and return if equal
  2118.                 2       compare and return if not equal
  2119.                 3       test and return if not zero
  2120.                 4       test and return if zero
  2121.         BL      timeout value times 55 milliseconds
  2122.                 0 if no time limit
  2123.         DX      I/O port address (if AL bit 4 = 1)
  2124.         ES:DI   pointer to user byte (if AL bit 4 = 0)
  2125.  
  2126.  
  2127. Function 42h    Request System Power Off                        (Convertible)
  2128. entry   AH      42h
  2129.         AL      00h     to use system profile
  2130.                 01h     to force suspend regardless of profile
  2131.  
  2132.  
  2133. Function 43h    Read System Status                              (Convertible)
  2134. entry   AH      43h
  2135. return  AL      status bits:
  2136.                 0       LCD detached
  2137.                 1       reserved
  2138.                 2       RS232/parallel powered on
  2139.                 3       internal modem powered on
  2140.                 4       power activated by alarm
  2141.                 5       standby power lost
  2142.                 6       external power in use
  2143.                 7       battery low
  2144.  
  2145.  
  2146. Function 44h    (De)activate Internal Modem Power               (Convertible)
  2147. entry   AH      44h
  2148.         AL      00h      to power off
  2149.                 01h      to power on
  2150.  
  2151.  
  2152. Function 4Fh    Keyboard Intercept                    (except PC, PCjr, and XT)
  2153. entry   AH      4Fh
  2154.         AL      scan code, CF set
  2155. return  AL      scan code, CF set if processing desired
  2156. note    Called by int 9 handler to translate scan codes
  2157.  
  2158.  
  2159. Function 80h    Device Open                                  (AT, XT/286, PS/2)
  2160. entry   AH      80h
  2161.         BX      device ID
  2162.         CX      process ID
  2163. return  CF      set on error
  2164.         AH      status
  2165.  
  2166.  
  2167. Function 81h    Device Close                                 (AT, XT/286, PS/2)
  2168. entry   AH      81h
  2169.         BX      device ID
  2170.         CX      process ID
  2171. return  CF      set on error
  2172.         AH      status
  2173.  
  2174.  
  2175. Function 82h    Program Termination                          (AT, XT/286, PS/2)
  2176.         AH      82h
  2177.         BX      device ID
  2178. return: CF      set on error
  2179.         AH      status
  2180. note    Closes all devices opened with function 80h
  2181.  
  2182.  
  2183. Function 83h    Event Wait                       (AT, XT/286, Convertible, PS/2)
  2184. entry   AH      83h
  2185.         AL      00h     to set interval
  2186.                 10h     to cancel
  2187.         CX,DX   number of microseconds to wait (granularity is 976 microseconds)
  2188.         ES:BX   pointer to memory flag (bit 7 is set when interval expires)
  2189.                 (pointer is to caller's memory)
  2190. return  CF      set (1) if function already busy
  2191.  
  2192.  
  2193. Function 84h    Read Joystick Input Settings                 (AT, XT/286, PS/2)
  2194. entry   AH      84h
  2195.         DX      00h     to read the current switch settings  (return in AL)
  2196.                 01h     to read the resistive inputs
  2197. return  AX      A(X) value
  2198.         BX      A(Y) value
  2199.         CX      B(X) value
  2200.         DX      B(Y) value
  2201.         AL      switch settings (bits 7-4)
  2202.  
  2203.  
  2204. Function 85h    System Request (SysReq) Key Pressed        (except PC, PCjr, XT)
  2205. entry   AH      85h
  2206. return  AL      00h      key pressed
  2207.                 01h      key released
  2208. note    Called by keyboard decode routine
  2209.  
  2210.  
  2211. Function 86h    Elapsed Time Wait                          (except PC, PCjr, XT)
  2212.         AH      86h
  2213.         CX,DX   number of microseconds to wait
  2214. return  CF      clear   after wait elapses
  2215.         CF      set     immediately due to error
  2216. note    Only accurate to 977 microseconds
  2217.  
  2218.  
  2219. Function 87h    Extended Memory Block Move              (286/386 machines only)
  2220.         AH      87h
  2221.         CX      number of words to move
  2222.         ES:SI   pointer to Global Descriptor Table (GDT)
  2223.                 offset 00h      null descriptor
  2224.                        08h      uninitialized, will be made into GDT descriptor
  2225.                        10h      descriptor for source of move
  2226.                        18h      descriptor for destination of move
  2227.                        20h      uninitialized, used by BIOS
  2228.                        28h      uninitialized, will be made into SS descriptor
  2229. return  CF      set on error
  2230.         AH      status
  2231.                 00h     source copied into destination
  2232.                 01h     parity error
  2233.                 02h     interrupt error
  2234.                 03h     address line 20 gating failed
  2235.  
  2236.  
  2237. Function 88h    Extended Memory Size Determine                (AT, XT/286, PS/2)
  2238. entry   AH      88h
  2239. return  AX      # of contiguous 1K blocks of memory starting at address 1024k
  2240.  
  2241.  
  2242. Function 89h    Switch Processor to Protected Mode            (AT, XT/286, PS/2)
  2243. entry   AH      89h
  2244.         BH      interrupt number of IRQ 8 (IRQ 9Fh use next 7 interrupts)
  2245.         BL      interrupt number of IRQ 0 (IRQ 17h use next 7 interrupts)
  2246.         CX      offset into protected mode CS to jump to
  2247.         DS:SI   pointer to Global Descriptor Table for protected mode
  2248.                 offset  00h     null descriptor
  2249.                         08h     GDT descriptor
  2250.                         10h     IDT descriptor
  2251.                         18h     DS
  2252.                         20h     ES
  2253.                         28h     SS
  2254.                         30h     CS
  2255.                         38h     uninitialized, used to build descriptor for
  2256.                                 BIOS CS
  2257. return  AH      0FFh  error enabling address line 20
  2258.         CF      set on error
  2259.       
  2260.  
  2261. Function 90h    Device Busy Loop                         (except PC, PCjr, XT)
  2262. entry   AH      90h
  2263.         AL      type code:
  2264.                 00h     disk
  2265.                 01h     diskette
  2266.                 02h     keyboard
  2267.                 03h     PS/2 pointing device
  2268.                 80h     network (ES:BX = pointer to network control block)
  2269.                 0FCh    hard disk reset (PS/2)
  2270.                 0FDh    diskette motor start
  2271.                 0FEh    printer
  2272.         ES:BX   pointer to request block for type codes 80h through 0BFh
  2273. return  CF      1 (set) if wait time satisfied
  2274.                 0 (clear) if driver must perform wait
  2275. note    Used by NETBIOS
  2276.         Type codes are allocated as follows:
  2277.         00h-7Fh non-reentrant devices; OS must arbitrate access
  2278.         80h-BFh reentrant devices; ES:BX points to a unique control block
  2279.         C0h-FFh wait-only calls, no complementary int 15, fn91h call
  2280.  
  2281.  
  2282. Function 91h    Set Flag and Complete Interrupt          (except PC, PCjr, XT)
  2283. entry   AH      91h
  2284.         AL      type code (see AH=90h above)
  2285.         ES:BX    pointer to request block for type codes 80h through 0BFh
  2286. return  AH       0
  2287. note    Used by NETBIOS
  2288.                                                                 
  2289.  
  2290. Function 0C0h   Get System Configuration      (XT after 1/10/86, PC Convertible,
  2291.                                                XT/286, AT, PS/2)
  2292. entry   AH      0C0h
  2293. return  CF      1 if BIOS doesn't support call
  2294.         ES:BX   pointer to ROM system descriptor table
  2295.                 dword   number of bytes in the following table (norm. 16 bytes)
  2296.                 byte    system ID byte; see Chapter 2 for interpretation
  2297.                 byte    secondary ID distingushes between AT and XT/286, etc.
  2298.                 byte    BIOS revision level, 0 for 1st release, 1 for 2nd, etc.
  2299.                 byte    feature information
  2300.                         80h     DMA channel 3 used by hard disk BIOS
  2301.                         40h     2nd 8259 installed
  2302.                         20h     realtime clock installed
  2303.                         10h     int 15h, fn 04h called upon int 09h
  2304.                         08h     wait for external event supported (int 15fn41)
  2305.                                 used on Convertible; reserved on PS/2 systems
  2306.                         04h     extended BIOS area allocated at 640k
  2307.                         03h     reserved
  2308.                         02h     bus is Micro Channel instead of PC
  2309.                         01h     reserved
  2310.                         00h     reserved
  2311.                 byte    unknown (set to 0) (reserved by IBM)
  2312.                 byte    unknown (set to 0) (reserved by IBM)
  2313.                 byte    unknown (set to 0)
  2314.                 byte    unknown (set to 0) (Award copyright here)
  2315. note 1) Int 15h is also used for the Multitask Hook on PS/2 machines. No 
  2316.         register settings availible yet.
  2317.      2) The 1/10/86 XT BIOS returns an incorrect value for the feature byte.
  2318.  
  2319.  
  2320. Function 0C1h   System - Return Extended-BIOS Data-Area Segment Address (PS/2)
  2321. entry   AH      0C1h
  2322. return  CF      set on error
  2323.         ES      segment of data area
  2324.  
  2325.  
  2326. Function 0C2h   Pointing Device BIOS Interface      (DesQview 2.x)    (PS/2)
  2327. entry   AH      0C2h
  2328.         AL      00h     enable/disable
  2329.                         BH      00h    disable
  2330.                 01h     reset
  2331.                         return  BH     device ID
  2332.                 02h     set sampling rate
  2333.                         BH      00h    10/second
  2334.                                 01h    20/second
  2335.                                 02h    40/second
  2336.                                 03h    60/second
  2337.                                 04h    80/second
  2338.                                 05h    100/second
  2339.                                 06h    200/second
  2340.                 03h set resolution
  2341.                         BH     00h     one count per mm
  2342.                                01h     two counts per mm
  2343.                                02h     four counts per mm
  2344.                                03h     eight counts per mm
  2345.                 04h     get type
  2346.                         return  BH      device ID
  2347.                 05h     initialize
  2348.                         BH      data package size (1 - 8 bytes)
  2349.                 06h     get/set scaling factor
  2350.                         BH      00h return device status
  2351.                                 return  BL      status byte
  2352.                                         bit 0: right button pressed
  2353.                                         bit 1: reserved
  2354.                                         bit 2: left button pressed
  2355.                                         bit 3: reserved
  2356.                                         bit 4: 0=1:1 scaling, 1=2:1 scaling
  2357.                                         bit 5: device enabled
  2358.                                         bit 6: 0=stream mode, 1=remote mode
  2359.                                         bit 7: reserved
  2360.                                         CL      resolution (see function 03h)
  2361.                                         DL      sample rate, reports per second
  2362.                                 01h     set scaling at 1:1
  2363.                                 02h     set scaling at 2:1
  2364.                 07h     set device handler address
  2365.                         ES:BX   user device handler
  2366.                         return  AL      00h
  2367. return  CF      set on error
  2368.         AH      status
  2369.                 00h     successful
  2370.                 01h     invalid function
  2371.                 02h     invalid input
  2372.                 03h     interface error
  2373.                 04h     need to resend
  2374.                 05h     no device handler installed
  2375. note    The values in BH for those functions that take it as input are stored
  2376.         in different locations for each subfunction
  2377.  
  2378.  
  2379. Function 0C3h   Enable/Disable Watchdog Timeout                 (PS/2 50+)
  2380. entry   AH      0C3h
  2381.         AL      00h     disable
  2382.                 01h     enable
  2383.                         BX      timer counter
  2384. return  CF      set on error
  2385. note    The watchdog timer generates an NMI
  2386.  
  2387.  
  2388. Function 0C4h   Programmable Option Select                      (PS/2 50+)
  2389. entry   AH      04Ch
  2390.         AL      00h     return base POS register address
  2391.                 01h     enable slot
  2392.                         BL      slot number
  2393.                 02h     enable adapter
  2394. return  CF      set on error
  2395.         DX      base POS register address (if function 00h)
  2396.  
  2397.                                                 
  2398. Function 0DEh   DesQview Services                             (DesQview)
  2399. entry   AH      0DEh
  2400.         AL      00h     Get Program Name
  2401.                         return  AX      offset into DESQVIEW.DVO of current
  2402.                                         program's record:
  2403.                                         byte    length of name
  2404.                                         n bytes name
  2405.                                         2 bytes keys to invoke program (second
  2406.                                                 = 00h if only one key used)
  2407.                                         word    ? (I see 0 always)
  2408.                                         byte    end flag: 00h for all but last
  2409.                                                 entry, which is 0FFh
  2410.                 01h     Update "Open Window" Menu
  2411.                         return  none
  2412.                         note    Reads DESQVIEW.DVO, disables Open menu if file
  2413.                                 not in current directory
  2414.                 02h     unimplemented in DV 2.0x
  2415.                         return  nothing (NOP in DV 2.0x)
  2416.                 03h     unimplemented in DV 2.0x
  2417.                         return  nothing (NOP in DV 2.0x)
  2418.                 04h     Get Available Common Memory
  2419.                         return  BX      bytes of common memory available
  2420.                                 CX      largest block available
  2421.                                 DX      total common memory in bytes
  2422.                 05h     Get Available Conventional Memory
  2423.                         return  BX      K of memory available
  2424.                                 CX      largest block available
  2425.                                 DX      total conventional memory in K
  2426.                 06h     Get Available Expanded Memory
  2427.                         return  BX      K of expanded memory available
  2428.                                 CX      largest block available
  2429.                                 DX      total expanded memory in K
  2430.                 07h     APPNUM  Get Current Program's Number
  2431.                         return  AX      number of program as it appears on the
  2432.                                         "Switch Windows" menu
  2433.                 08h     GET (unknown)
  2434.                         return  AX      0       unknown
  2435.                                         1       unknown
  2436.                 09h     unimplemented in DV 2.00
  2437.                         return  nothing (NOP in DV 2.00)
  2438.                 0Ah     DBGPOKE Display Character on Status Line
  2439.                         BL      character
  2440.                         return  character displayed, next call will display in
  2441.                                 next position (which wraps back to the start of
  2442.                                 the line if off the right edge of screen)
  2443.                         note 1) Displays character on bottom line of *physical*
  2444.                                 screen, regardless of current size of window
  2445.                                 (even entirely hidden)
  2446.                              2) Does not know about graphics display modes,
  2447.                                 just pokes the characters into display memory
  2448.                 0Bh     APILEVEL Define Minimum API Level Required
  2449.                         BL      API level
  2450.                                 >2 pops up "You need a newer version" error
  2451.                                 window in DV 2.00
  2452.                         BH      unknown
  2453.                         return  AX      maximum API level?
  2454.                 0Ch     GETMEM  Allocate "System" Memory
  2455.                         BX      number of bytes
  2456.                         return  ES:DI   pointer to allocated block
  2457.                 0Dh     PUTMEM  Deallocate "System" Memory
  2458.                         ES:DI   pointer to previously allocated block
  2459.                         return  nothing
  2460.                 0Eh     Find Mailbox by Name    (DV 2.0+)
  2461.                         ES:DI   pointer to name to find
  2462.                         CX      length of name
  2463.                         return  BX      0       not found
  2464.                                         1       found
  2465.                                 DS:SI   object handle
  2466.                 0Fh     Enable DesQview Extensions      (DV 2.0+)
  2467.                         return  AX and BX destroyed (seems to be bug, weren't
  2468.                                 saved & restored)
  2469.                         note 1) Sends a manager stream with opcodes AEh, BDh,
  2470.                                 and BFh to task's window
  2471.                              2) Enables an additional mouse mode
  2472.                 10h     PUSHKEY  PUT KEY INTO KEYBOARD INPUT STREAM  (DV 2.0+)
  2473.                         BH      scan code
  2474.                         BL      character
  2475.                         return  BX      unknown (sometimes, but not always,
  2476.                                         same as BX passed in)
  2477.                         note    A later read will get the keystroke as if it
  2478.                                 had been typed by the user
  2479.                 11h     ENABLE/DISABLE AUTO JUSTIFICATION OF WINDOW (DV 2.0+)
  2480.                         BL      0       viewport will not move automatically
  2481.                                 nonzero viewport will move to keep cursor
  2482.                                         visible
  2483.                         return  none
  2484.                 12h     unknown (DV 2.0+)
  2485.                         BX      0       clear something?
  2486.                                 nonzero set something?
  2487.                         return  none
  2488.  
  2489.  
  2490.  
  2491.  
  2492.  
  2493. ┌─────────────────────────────────────────────────────────────────────────────┐
  2494. │Interrupt 16h  Keyboard I/O                                                  │
  2495. └─────────────────────────────────────────────────────────────────────────────┘
  2496. (0:0058h)       access the keyboard 
  2497.  
  2498.  
  2499. Function  00h   Get Keyboard Input - read the next character in keyboard buffer,
  2500.                 if no key ready, wait for one.
  2501. entry   AH      00h     
  2502. return  AH      scan code 
  2503.         AL      ASCII character 
  2504.        
  2505.  
  2506. Function  01h   Check Keystroke Buffer - Do Not Clear
  2507. entry   AH      01h    
  2508. return  ZF      0 (clear) if character in buffer
  2509.                 1 (set)   if no character in buffer
  2510.         AH      scan code of character (if ZF=0)
  2511.         AL      ASCII character if applicable
  2512. note    Keystroke is not removed from buffer
  2513.  
  2514.  
  2515. Function  02h   Shift Status - fetch bit flags indicating shift status 
  2516. entry   AH      02h
  2517. return  AL      bit codes (same as [0040:0017])
  2518.                 bit 7   Insert state
  2519.                 bit 6   CapsLock state
  2520.                 bit 5   NumLock state
  2521.                 bit 4   ScrollLock state
  2522.                 bit 3   Alt key
  2523.                 bit 2   Control key
  2524.                 bit 1   Left shift (left caps-shift key)
  2525.                 bit 0   Right shift (right caps-shift key)
  2526. note    other codes found at [0040:0018]
  2527.                 bit 7   Insert shift (Ins key)
  2528.                 bit 6   Caps shift (CapsLock key)
  2529.                 bit 5   Num shift (NumLock key) 
  2530.                 bit 4   Scroll shift (ScrollLock key)
  2531.                 bit 3   Hold state (Ctrl-NumLock is in effect)
  2532.  
  2533.  
  2534. Function 03h    Keyboard - Set Repeat Rate            (PCjr, AT, XT/286, PS/2)
  2535. entry   AH      03h 
  2536.         AL      00h     reset typematic             (PCjr)
  2537.                 01h     increase initial delay      (PCjr)
  2538.                 02h     increase continuing delay   (PCjr)
  2539.                 03h     increase both delays        (PCjr)
  2540.                 04h     turn off typematic          (PCjr)
  2541.                 05h     set typematic rate          (AT, PS/2)
  2542.         BH      00h-03h for delays of 250ms, 500ms, 750ms, or 1second
  2543.                         0,0     250ms
  2544.                         0,1     500ms
  2545.                         1,0     750ms
  2546.                         1,1     1 second
  2547.         BL      00h-1Fh for typematic rates of 30cps down to 2cps
  2548.                         00000 30     01011 10.9   10101 4.5
  2549.                         00001 26.7   01100 10     10110 4.3
  2550.                         00010 24     01101 9.2    10111 4
  2551.                         00011 21.8   01110 8.6    11000 3.7
  2552.                         00100 20     01111 8      11001 3.3
  2553.                         00101 18.5   10000 7.5    11010 3
  2554.                         00110 17.1   10001 6.7    11011 2.7
  2555.                         00111 16     10010 6      11100 2.5
  2556.                         01000 15     10011 5.5    11101 2.3
  2557.                         01001 13.3   10011 5.5    11110 2.1
  2558.                         01010 12     10100 5      11111 2
  2559.  
  2560.  
  2561. Function 04h    Keyboard Click Toggle                 (PCjr and Convertible)
  2562. entry   AH      04h
  2563.         AL      00h     for click off
  2564.                 01h     for click on 
  2565.           
  2566.  
  2567. Function 05h    Keyboard Buffer Write            (AT or PS/2 with enhanced kbd)
  2568.                 (XT/286, PS/2, AT with "Enhanced" keyboard)
  2569. entry   AH      05h
  2570.         CH      scan code
  2571.         CL      ASCII character
  2572. return  AL      01h if buffer full
  2573.  
  2574.  
  2575. Function 10h    Get Enhanced Keystroke And Read      (F11, F12 Enhanced Keyb'd)
  2576.                 (XT/286, PS/2, AT with "Enhanced" keyboard)
  2577. entry   AH      10h
  2578. return  AH      scan code
  2579.         AL      ASCII character if applicable
  2580.  
  2581.  
  2582. Function 11h    Check Enhanced Keystroke         (F11-F12 on enhanced keyboard)
  2583.                 (XT/286, PS/2, AT with "Enhanced" keyboard)
  2584. entry   AH      11h
  2585. return  ZF      0       (clear) if key pressed
  2586.                 1       if buffer empty
  2587.         AH      scan code (when ZF=0)
  2588.         AL      ASCII character if applicable (when ZF=0)
  2589. note    Keystroke is not removed from buffer
  2590.  
  2591.  
  2592. Function 12h    Extended Get Shift Status         (F11, F12 Enhanced keyboard)
  2593. entry    AH     12h
  2594. return   AL     bit
  2595.                 0       right Shift key depressed
  2596.                 1       left Shift key depressed
  2597.                 2       Control key depressed
  2598.                 3       Alt key depressed
  2599.                 4       ScrollLock state active
  2600.                 5       NumLock state active
  2601.                 6       CapsLock state active
  2602.                 7       insert state is active
  2603.         AH      0       left Control key pressed
  2604.                 1       left Alt key depressed
  2605.                 2       right Control key pressed
  2606.                 3       right Alt key depressed
  2607.                 4       Scroll Lock key depressed
  2608.                 5       NumLock key depressed
  2609.                 6       CapsLock key depressed
  2610.                 7       SysReq key depressed
  2611.  
  2612.  
  2613. Function F0h    Set CPU speed (Compaq 386)
  2614. entry   AH      F0h     set speed
  2615. return  unknown
  2616. note    used by Compaq DOS MODE command.
  2617.         parameters not availible
  2618.  
  2619.                                       
  2620.  
  2621.  
  2622.  
  2623. ┌─────────────────────────────────────────────────────────────────────────────┐
  2624. │Interrupt 17h  Printer                                                       │
  2625. └─────────────────────────────────────────────────────────────────────────────┘
  2626. (0:005Ch)       access the parallel printer(s)
  2627.                 AH is changed. All other registers left alone.
  2628.  
  2629. Function  00h   Print Character/send AL to printer DX (0, 1, or 2) 
  2630. entry   AH      00h
  2631.         AL      character
  2632.         DX      printer to be used (0,1,2)
  2633. return  AH      status byte
  2634.                 bit
  2635.                 0       time out
  2636.                 1       unused
  2637.                 2       unused
  2638.                 3       I/O error
  2639.                 4       selected
  2640.                 5       out of paper
  2641.                 6       acknowledge
  2642.                 7       not busy
  2643.  
  2644.  
  2645. Function 01h    Initialize Printer - set init line low, send 0Ch to printer DX 
  2646. entry   AH      01h
  2647.         DX      printer port to be initialized (0,1,2)
  2648. return  status as below
  2649.  
  2650.  
  2651. Function  02h   Printer Status - read status of printer DX into AH 
  2652. entry   AH      02h
  2653.         DX      printer port to be used (0,1,2)
  2654. return  AH      bit flags       bit 7   0 = printer is busy
  2655.                                 bit 6   ACKnowledge line state
  2656.                                 bit 5   out-of-paper line state
  2657.                                 bit 4   printer selected line state 
  2658.                                 bit 3   I/O error
  2659.                                 bit 2   unused 
  2660.                                 bit 1   unused 
  2661.                                 bit 0   time-out error 
  2662.  
  2663.  
  2664.                                       
  2665.  
  2666.  
  2667. ┌─────────────────────────────────────────────────────────────────────────────┐
  2668. │Interrupt 18h  ROM BASIC                                                     │
  2669. └─────────────────────────────────────────────────────────────────────────────┘
  2670. (0:0060h)       Execute ROM BASIC at address 0F600h:0000h
  2671. note 1) Often reboots a compatible
  2672.      
  2673.  
  2674.  
  2675.  
  2676.  
  2677. ┌─────────────────────────────────────────────────────────────────────────────┐
  2678. │Interrupt 19h  Bootstrap Loader                                              │
  2679. └─────────────────────────────────────────────────────────────────────────────┘
  2680. (0:0064h)       Reads track 0, sector 1 into address 0000h:7C00h, then transfers
  2681.                 control to that address. If no diskette drive available, 
  2682.                 transfers to ROM-BASIC or displays loader error message.
  2683.                 Causes reboot of disk system if invoked while running.
  2684.                 (no memory test performed).
  2685.                           
  2686.  
  2687.  
  2688.  
  2689.  
  2690. ┌─────────────────────────────────────────────────────────────────────────────┐
  2691. │Interrupt 1Ah  Time of Day                                                   │
  2692. └─────────────────────────────────────────────────────────────────────────────┘
  2693. (0:0068h)       access the PC internal clock
  2694.  
  2695. Function 00h    Read System Time Counter
  2696. entry   AH      00h
  2697. return  CX      high word of clock count
  2698.         DX      low word of clock count 
  2699.         AL      00h if clock was read or written (via AH=0,1) within the current
  2700.                 24-hour period. Otherwise, AL > 0
  2701.  
  2702.  
  2703. Function 01h    Set Clock - set # of 55ms clock ticks in system time counter
  2704. entry   AH      01h
  2705.         CX:DX   high word/low word count of timer ticks 
  2706. return  none
  2707. note 1) The clock ticks are incremented by timer interrupt at 18.2065 times 
  2708.         per second or 54.9254milliseconds/count. Therefore: 
  2709.                 counts per second = 18      (12h)
  2710.                 counts per minute = 1092    (444h)
  2711.                 counts per hour   = 65543   (10011h)
  2712.                 counts per day    = 1573040 (1800B0h)
  2713.      2) counter is zeroed when system is rebooted
  2714.  
  2715.  
  2716. Function 02h    Read Real Time Clock Time                       (AT and after)
  2717. entry   AH      02h
  2718. return  CH      hours in BCD
  2719.         CL      minutes in BCD
  2720.         DH      seconds in BCD
  2721.         DL      1 (set) if daylight savings time option
  2722.         CF      1 (set) if clock not operating
  2723.  
  2724.  
  2725. Function 03h    Set Real Time Clock Time                        (AT and after)
  2726. entry   AH      03h
  2727.         CH      hours in BCD
  2728.         CL      minutes in BCD
  2729.         DH      seconds in BCD
  2730.         DL      0 (clear) if standard time
  2731.                 1 (set) if daylight savings time option
  2732. return  none
  2733.  
  2734.  
  2735. Function 04h    Read Real Time Clock Date                       (AT and after)
  2736. entry   AH      04h
  2737. return  CH      century in BCD (19 or 20)
  2738.         CL      year in BCD
  2739.         DH      month in BCD
  2740.         DL      day in BCD
  2741.         CF      1 (set) if clock not operating
  2742.  
  2743.  
  2744. Function 05h    Set Real Time Clock Date                        (AT and after)
  2745. entry   AH      05h
  2746.         CH      century in BCD (19 or 20)
  2747.         CL      year in BCD
  2748.         DH      month in BCD
  2749.         DL      day in BCD
  2750. return  none
  2751.  
  2752.                            
  2753. Function 06h    Set Real Time Clock Alarm                       (AT and after)
  2754. entry   AH      06h
  2755.         CH      hours in BCD
  2756.         CL      minutes in BCD
  2757.         DH      seconds in BCD
  2758. return  CF      set if alarm already set or clock inoperable
  2759. note    Int 4Ah occurs at specified alarm time every 24hrs until reset
  2760.  
  2761.  
  2762. Function 07h    Reset Real Time Clock Alarm                     (AT and after)
  2763. entry   AH      07h
  2764. return  none
  2765.  
  2766.  
  2767. Function 08h    Set Real Time Clock Activated Power On Mode     (Convertible)
  2768. entry   AH      08h
  2769.         CH      hours in BCD
  2770.         CL      minutes in BCD
  2771.         DH      seconds in BCD
  2772.  
  2773.  
  2774. Function 09h    Read Real Time Clock Alarm Time and Status
  2775.                                                 (Convertible and PS/2 Model 30)
  2776. entry   AH      09h
  2777. return  CH      hours in BCD
  2778.         CL      minutes in BCD
  2779.         DH      seconds in BCD
  2780.         DL      alarm status:
  2781.                 00h     if alarm not enabled
  2782.                 01h     if alarm enabled but will not power up system
  2783.                 02h     if alarm will power up system
  2784.  
  2785.  
  2786. Function 0Ah    Read System-Timer Day Counter   (XT-2 [640k motherboard], PS/2)
  2787. entry   AH      0Ah
  2788. return  CF      set on error
  2789.         CX      count of days since Jan 1,1980
  2790.  
  2791.  
  2792. Function 0Bh    Set System-Timer Day Counter    (XT-2 [640k motherboard], PS/2)
  2793. entry   AH      0Bh
  2794.         CX      count of days since Jan 1,1980
  2795. return  CF      set on error
  2796.  
  2797.  
  2798. Function 80h    Set Up Sound Multiplexor                (PCjr) (Tandy 1000?)
  2799. entry   AH      80h
  2800.         AL      00h     source is 8253 channel 2
  2801.                 01h     source is cassette input
  2802.                 02h     source is I/O channel "audio in"
  2803.                 03h     source is TI sound generator chip
  2804.                           
  2805.  
  2806.  
  2807.  
  2808.         
  2809. ┌─────────────────────────────────────────────────────────────────────────────┐
  2810. │Interrupt 1Bh  Control-Break                                                 │
  2811. └─────────────────────────────────────────────────────────────────────────────┘
  2812. (0:006Ch)       This interrupt is called when the keyboard scanner of the IBM 
  2813.                 machines detects Ctrl and Break pressed at the same time.
  2814.  
  2815. note 1) If the break occurred while processing an interrupt, one or more
  2816.         end of interrupt commands must be send to the 8259 Programmable
  2817.         Interrupt Controller.
  2818.      2) All I/O devices should be reset in case an operation was underway at
  2819.         the time.
  2820.      3) It is normally pointed to an IRET during system initialization so that
  2821.         it does nothing, but some programs change it to return a ctrl-C scan 
  2822.         code and thus invoke int 23h.
  2823.  
  2824.  
  2825.  
  2826.  
  2827.  
  2828. ┌─────────────────────────────────────────────────────────────────────────────┐
  2829. │Interrupt 1Ch  Timer Tick                                                    │
  2830. └─────────────────────────────────────────────────────────────────────────────┘
  2831. (0:0070h)
  2832. note 1) Taken 18.2065 times per second 
  2833.      2) Normally vectors to dummy IRET unless PRINT.COM has been installed.
  2834.      3) If an application moves the interrupt pointer, it is the responsibility
  2835.         of that application to save and restore all registers that may be
  2836.         modified.
  2837.  
  2838.  
  2839.  
  2840.  
  2841.  
  2842. ┌─────────────────────────────────────────────────────────────────────────────┐
  2843. │Interrupt 1Dh  Vector of Video Initialization Parameters                     │
  2844. └─────────────────────────────────────────────────────────────────────────────┘
  2845. (0:0074h)       This doubleword address points to 3 sets of 16-bytes containing
  2846.                 data to initialize for video modes for video modes 0 & 1 (40 
  2847.                 column), 2 & 3 (80 column), and 4, 5 & 6 (graphics) on the 
  2848.                 Motorola 6845 CRT controller chip.
  2849.  6845 registers:
  2850.         R0      horizontal total (horizontal sync in characters)
  2851.         R1      horizontal displayed (characters per line)
  2852.         R2      horizontal sync position (move display left or right)
  2853.         R3      sync width (vertical and horizontal pulse: 4-bits each)
  2854.         R4      vertical total (total character lines)
  2855.         R5      vertical adjust (adjust for 50 or 60 Hz refresh)
  2856.         R6      vertical displayed (lines of chars displayed)
  2857.         R7      vertical sync position (lines shifted up or down)
  2858.         R8      interlace (bits 4 and 5) and skew (bits 6 and 7)
  2859.         R9      max scan line addr (scan lines per character row)
  2860.         R10     cursor start (starting scan line of cursor)
  2861.         R11     cursor stop (ending scan line of cursor)
  2862.         R12     video memory start address high byte (6-bits)
  2863.         R13     video memory start address low byte (8-bits)
  2864.         R14     cursor address high byte (6-bits)
  2865.         R15     cursor address low byte (8-bits)
  2866.  
  2867.  6845 Video Init Tables:
  2868.         table for modes 0 and 1   \
  2869.         table for modes 2 and 3    \ each table is 16 bytes long and
  2870.         table for modes 4,5, and 6 / contains values for 6845 registers
  2871.         table for mode 7          /
  2872.         4 words:   size of video RAM for modes 0/1, 2/3, 4/5, and 6/7
  2873.         8 bytes:   number of columns in each mode
  2874.         8 bytes:   video controller mode byte for each mode
  2875. note 1) There are 4 separate tables, and all 4 must be initialized if all
  2876.         video modes will be used.
  2877.      2) The power-on initialization code of the computer points this vector
  2878.         to the ROM BIOS video routines.
  2879.      3) IBM recommends that if this table needs to be modified, it should be
  2880.         copied into RAM and only the nescessary changes made.
  2881.  
  2882.  
  2883.  
  2884.  
  2885.  
  2886. ┌─────────────────────────────────────────────────────────────────────────────┐
  2887. │Interrupt 1Eh  Vector of Diskette Controller Parameters                      │
  2888. └─────────────────────────────────────────────────────────────────────────────┘
  2889. (0:0078h)       Dword address points to data base table that is used by BIOS.
  2890.                 Default location is at 0F000:0EFC7h. 11-byte table format:
  2891.                 bytes:
  2892.                 00h     4-bit step rate, 4-bit head unload time 
  2893.                 01h     7-bit head load time, 1-bit DMA flag
  2894.                 02h     54.9254 ms counts - delay till motor off (37-38 typ)
  2895.                 03h     sector size: 
  2896.                         00h     128 bytes
  2897.                         01h     256 bytes
  2898.                         02h     512 bytes
  2899.                         03h     1024 bytes
  2900.                 04h     last sector on track (8 or 9 typical)
  2901.                 05h     gap between sectors on read/write (42 typical)
  2902.                 06h     data length for DMA transfers (0FFh typical)
  2903.                 07h     gap length between sectors for format (80 typical)
  2904.                 08h     sector fill byte for format (0F6h typical)
  2905.                 09h     head settle time (in milliseconds) (15 to 25 typical)
  2906.                         DOS 1.0   0
  2907.                         DOS 2.10  15
  2908.                         DOS 3.1   1
  2909.                 10h     motor start time (in 1/8 second intervals) (2 to 4 typ.)
  2910.                         DOS 2.10  2
  2911. note 1) This vector is pointed to the ROM BIOS diskette tables on system 
  2912.         initialization
  2913.      2) IBM recommends that if this table needs to be modified, it should be
  2914.         copied into RAM and only the nescessary changes made.
  2915.  
  2916.  
  2917.  
  2918.  
  2919. ┌─────────────────────────────────────────────────────────────────────────────┐
  2920. │Interrupt 1Fh  Pointer to Graphics Character Extensions (Graphics Set 2)     │
  2921. └─────────────────────────────────────────────────────────────────────────────┘
  2922. (0:007Ch)       This is the pointer to data used by the ROM video routines to
  2923.                 display characters above ASCII 127 while in CGA medium and high
  2924.                 res graphics modes.
  2925.  
  2926. note 1) Doubleword address points to 1K table composed of 28 8-byte character 
  2927.         definition bit-patterns. First byte of each entry is top row, last byte
  2928.         is bottom row.
  2929.      2) The first 128 character patterns are located in system ROM.
  2930.      3) This vector is set to 000:0 at system initialization
  2931.      4) Used by DOS' external GRAFTABL command
  2932.  
  2933.  
  2934.  
  2935.  
  2936.  
  2937. ┌─────────────────────────────────────────────────────────────────────────────┐
  2938. │Interrupt 20h  Terminate Current Program                                     │
  2939. └─────────────────────────────────────────────────────────────────────────────┘
  2940. (0:0080h)
  2941.  Issue int 20h to exit from a program. This vector transfers to the logic in 
  2942. DOS to restore the terminate address, the Ctrl-Break address,and the critical 
  2943. error exit address to the values they had on entry to the program. All the file
  2944. buffers are flushed and all handles are closed. You should close all files 
  2945. changed in length (see function calls 10h and 3Eh) before issuing this 
  2946. interrupt. If the changed file is not closed, its length, time, and date are 
  2947. not recorded correctly in the directory.
  2948.  For a program to pass a completion code or an error code when terminating, it
  2949. must use either function call 4Ch (Terminate a Process) or 31h (Terminate 
  2950. Process and Stay Resident). These two methods are preferred over using 
  2951. int 20h and the codes returned by them can be interrogated in batch processing. 
  2952. Important: Before you issue an interrupt 20h, your program must ensure that 
  2953.            the CS register contains the segment of its program segment prefix.
  2954.  
  2955. Interrupt 20h   DOS - Terminate Program
  2956. entry   no parameters
  2957. return  The following vectors are restored from the Program Segment Prefix:
  2958.         0Ah     Program Terminate
  2959.         0Eh     Control-C
  2960.         12h     Critical Error
  2961. note    IBM and Microsoft recommend using int 21 Fn 4Ch. Using int 20 is
  2962.         officially frowned upon since the introduction of DOS 2.0
  2963.  
  2964.