home *** CD-ROM | disk | FTP | other *** search
/ For Beginners & Professional Hackers / cd.iso / docum / hadware.doc / chapter.003 < prev    next >
Encoding:
Text File  |  1992-03-15  |  90.4 KB  |  2,598 lines

  1.                                     -31-
  2.  
  3.    **  Programmer's  Technical    Reference  for    MSDOS  and  the  IBM  PC **
  4. ─────────────────────────┤ Registered User Version ├───────────────────────────
  5.              not for public distribution
  6.          Copyright (c) 1987, 1988, 1989 Dave Williams
  7.  
  8.  
  9.               C H A P T E R    T H R E E
  10.  
  11.  
  12.                 THE PC ROM BIOS
  13.  
  14.  
  15.                 C O N T E N T S
  16.  
  17. Calling the ROM BIOS .................................................. 3**1
  18. Interrupt 10h  Video Services ......................................... 3**2
  19. Interrupt 11h  Equipment Check ........................................ 3**3
  20. Interrupt 12h  Memory Size ............................................ 3**4
  21. Interrupt 13h  Disk Functions ......................................... 3**5
  22. Interrupt 14h  Initialize and Access Serial Port ...................... 3**6
  23.            FOSSIL Drivers ......................................... 3**7
  24. Interrupt 15h  Cassette I/O ........................................... 3**8
  25. Interrupt 16h  Keyboard I/O ........................................... 3**9
  26. Interrupt 17h  Printer ................................................ 3**10
  27. Interrupt 18h  ROM BASIC .............................................. 3**11
  28. Interrupt 19h  Bootstrap Loader ....................................... 3**12
  29. Interrupt 1Ah  Time of Day ............................................ 3**13
  30. Interrupt 1Bh  Control-Break .......................................... 3**14
  31. Interrupt 1Ch  Timer Tick ............................................. 3**15
  32. Interrupt 1Dh  Vector of Video Initialization Parameters .............. 3**16
  33. Interrupt 1Eh  Vector of Diskette Controller Parameters ............... 3**17
  34. Interrupt 1Fh  Ptr to Graphics Character Extensions (Graphics Set 2) .. 3**18
  35. Interrupt 20h  Terminate Current Program .............................. 3**19
  36.  
  37.  
  38.  
  39. Calling the ROM BIOS .................................................. 3**1
  40.  
  41.  The BIOS services are invoked by placing the number of the desired function in
  42. register AH, subfunction in AL, setting the other registers to any specific
  43. requirements of the function, and invoking any of ints 10h through int 20h.
  44.  
  45.  When the interrupt is called, all register and flag values are pushed into the
  46. stack. The interrupt address contains a pointer into an absolute address in the
  47. ROM BIOS chip address space. This location may be further vectored into the
  48. IBMBIO.COM (or equivalent) file or user file.
  49.  
  50.  The address vector points to a particular BIOS command handler. The handler
  51. pops the register values, compares them to its list of functions, and executes
  52. the function if valid. When the function is complete, it may pass values back
  53. to the command handler. The handler will push the values into the stack and
  54. then return control to the calling program.
  55.  
  56.  Most functions will return an error code; some return more information.
  57. Details are contained in the listings for the individual functions.
  58.  
  59.  Register settings listed are the ones used by the BIOS. Some functions will
  60. return with garbage values in unused registers. Do not test for values in
  61. unspecified registers; your program may exhibit odd behavior.
  62.  
  63.  
  64.  Three sets of BIOS routines are available: PC BIOS, AT BIOS (also called
  65. CBIOS or "Old compatibility BIOS", and the PS/2 ABIOS "Advanced BIOS".
  66.  
  67.                                     -32-
  68.  
  69.  
  70.  The Advanced BIOS is contained in PS/2 ROMs. It is primarily intended for OS
  71. use rather than application use. OS/2 can take advantage of ABIOS routines to
  72. reduce RAM use on PS/2 systems. The ABIOS can be replaced by disk and RAM based
  73. ABIOS code if desired. There is a new BIOS Data Area defined in high memory
  74. that occupies one K of RAM.
  75.  
  76.  The ABIOS can run in protected mode, and is fully reentrant. It supports three
  77. types of function requests - single staged, discrete multistaged, or continuous
  78. multistaged. A single-staged request does its job immediately and returns
  79. control to the caller. A discrete multistaged request may happen in two or more
  80. stages with pauses between the stages. The caller may regain control during the
  81. pauses. A continuous multistaged request starts a staged operation that never
  82. ends. (sometimes called a daemon).
  83.  
  84.  Unlike the CBIOS which is called with software interrupts, ABIOS is accessed
  85. with FAR calls. ABIOS calls are completely reentrant in both real and
  86. protected modes. To call an ABIOS function, the calling program must pass
  87. pointers to two data structures - a request block and a common data area. The
  88. request block specifies the desired function number and the common data area is
  89. a table that contains pointers to all the ABIOS' other tables and data areas.
  90. The common data area's internal structure contains the function transfer
  91. tables which have the addresses of the BIOS routines.
  92.  
  93. ABIOS stack frame and calling conventions:
  94.        bytes        stack contents
  95.     2    common data area pointer (segment/selector only) required
  96.     4    request block pointer - required
  97.     4    function transfer table pointer - furnished by ABIOS or caller
  98.     4    device block pointer - furnished by ABIOS or caller
  99.     4    return address
  100.  
  101.  In ABIOS Transfer Convention, only the first two items are required. ABIOS
  102. assigns the second two. In Operating System Transfer Convention, the caller
  103. provides the second two. Since the parameters are not removed from the stack
  104. on return to the caller, the operating system may save the function transfer
  105. table and device addresses after they have been furnished by the ABIOS by a
  106. call.
  107.  
  108.  ABIOS does no interrupt arbitration. It assumes all interrupts are handled by
  109. the caller or the OS and it is called only for service. If more than one
  110. device is sharing a hardware interrupt, the OS must determine which interrupt
  111. is valid for the ABIOS.
  112.  
  113.  
  114. ┌─────────────────────────────────────────────────────────────────────────────┐
  115. │Interrupt 10h    Video Services                        3**2  │
  116. └─────────────────────────────────────────────────────────────────────────────┘
  117. (0:0040h)    The BIOS Video Services may be found in Chapter 16.
  118.  
  119. (internal) Coprocessor Error (80286+)
  120.     Generated by the CPU when the -ERROR pin is asserted by the coprocessor
  121.     (usually 80x87, but may be any multimaster CPU or alternate NDP such
  122.     as Weitek, etc.). ATs and clones usually wire the coprocessor to use
  123.     IRQ13, but not all get it right.
  124.  
  125.                                     -33-
  126.  
  127. ┌─────────────────────────────────────────────────────────────────────────────┐
  128. │Interrupt 11h    Equipment Check                     3**3  │
  129. └─────────────────────────────────────────────────────────────────────────────┘
  130. (0:0044h)    Reads the BIOS Data Area and returns two bytes of setup info.
  131. entry    no parameters are required
  132. return    AX    Equipment listing word. Bits are:
  133.         0    number of floppy drives
  134.             0    no drives
  135.             1    bootable (IPL) diskette drive installed
  136.         1    math chip
  137.             0    no math coprocessor (80x87) present
  138.             1    math coprocessor (80x87) present
  139.      (PS/2) 2    0    mouse not installed
  140.             1    mouse installed
  141.       (PC)    2,3    system board RAM
  142.             0,0    16k    (PC-0, PC-1)
  143.             0,1    32k
  144.             1,0    48k
  145.             1,1    64k    (PC-2, XT)
  146.             note 1) not commonly used. Set both bits to 1
  147.                  2) both bits always 1 in AT
  148.         4,5    initial video mode
  149.             0,0    no video installed (use with dumb terminal)
  150.             0,1    40x25 color     (CGA)
  151.             1,0    80x25 color     (CGA, EGA, PGA, MCGA, VGA)
  152.             1,1    80x25 monochrome (MDA or Hercules, most super-
  153.                           hires mono systems)
  154.         6,7    number of diskette drives (only if bit 0 is 1)
  155.             0,0    1 drives
  156.             0,1    2 drives
  157.             1,0    3 drives
  158.             1,1    4 drives
  159.         8    0    DMA present
  160.             1    no DMA (PCjr, some Tandy 1000s, 1400LT)
  161.         9,A,B    number of RS232 serial ports (0-3)
  162.             0,0,0    none
  163.             0,0,1    1
  164.             0,1,0    2
  165.             0,1,1    3
  166.             1,0,0    4
  167.         C    0    no game I/O attached
  168.             1    game I/O attached (default for PCjr)
  169.         D    serial accessory installation
  170.             0    no serial accessories installed
  171.             1    Convertible - internal modem installed
  172.                 or PCjr - serial printer attached
  173.         E,F    number of parallel printers
  174.             0,0    none
  175.             0,1    one   (LPT1, PRN)
  176.             1,0    two   (LPT2)
  177.             1,1    three (LPT3)
  178.             note    Models before PS/2 would allow a fourth
  179.                 parallel printer. Remapping of the BIOS in the
  180.                 PS/2s does not allow the use of LPT4.
  181.  
  182.                                     -34-
  183.  
  184.  
  185. ┌─────────────────────────────────────────────────────────────────────────────┐
  186. │Interrupt 12h    Memory Size                        3**4  │
  187. └─────────────────────────────────────────────────────────────────────────────┘
  188. (0:0048h)    get system memory
  189. entry    no parameters required
  190. return    AX    number of contiguous 1K RAM blocks availible for DOS
  191. note 1) This is the same value stored in absolute address 04:13h.
  192.      2) For some early PC models, the amount of memory returned by this call is
  193.     determined by the settings of the dip switches on the motherboard and
  194.     may not reflect all the memory that is physically present.
  195.      3) For the PC/AT, the value returned is the amount of functional memory
  196.     found during the power-on self-test, regardless of the memory size
  197.     configuration information stored in CMOS RAM.
  198.      4) The value returned does not reflect any extended memory (above the 1 Mb
  199.     boundary) that may be present on 80286 or 80386 machines.
  200.  
  201.  
  202.  
  203.  
  204. ┌─────────────────────────────────────────────────────────────────────────────┐
  205. │Interrupt 13h    Disk Functions                        3**5  │
  206. └─────────────────────────────────────────────────────────────────────────────┘
  207. (0:0049h)    The service calls for BIOS disk functions are located in
  208.         Chapter 8.
  209.  
  210.  
  211.  
  212.  
  213. ┌─────────────────────────────────────────────────────────────────────────────┐
  214. │Interrupt 14h    Initialize and Access Serial Port For Int 14        3**6  │
  215. └─────────────────────────────────────────────────────────────────────────────┘
  216. (0:0050h)    the following status is defined:
  217.  
  218.     serial status byte:
  219.     bits    0 delta clear to send
  220.         1 delta data set ready
  221.         2 trailing edge ring detector
  222.         3 delta receive line signal detect
  223.         4 clear to send
  224.         5 data set ready
  225.         6 ring indicator
  226.         7 receive line signal detect
  227.  
  228.     line status byte:
  229.     bits    0 data ready
  230.         1 overrun error
  231.         2 parity error
  232.         3 framing error
  233.         4 break detect
  234.         5 transmit holding register empty
  235.         6 transmit shift register empty
  236.         7 time out  note: if bit 7 set then other bits are invalid
  237.  
  238.  All routines have AH=function number and DX=RS232 card number (0 based).
  239. AL=character to send or received character on exit, unless otherwise noted.
  240.  
  241.                                     -35-
  242.  
  243. entry    AH    00h    Initialize And Access Serial Communications Port
  244.             bit pattern: BBBPPSLL
  245.             BBB = baud rate:   110,150,300,600,1200,2400,4800,9600
  246.             PP  = parity:       01 = odd, 11 = even
  247.             S   = stop bits:   0 = 1, 1 = 2
  248.             LL  = word length: 10 = 7-bits, 11 = 8-bits
  249.     AL    parms for initialization:
  250.         bit pattern:
  251.         0    word length
  252.         1    word length
  253.         2    stop bits
  254.         3    parity
  255.         4    parity
  256.         5    baud rate
  257.         6    baud rate
  258.         7    baud rate
  259.         word length    10    7 bits
  260.                 11    8 bits
  261.         stop bits    0    1 stop bit
  262.                 1    2 stop bits
  263.         parity        00    none
  264.                 01    odd
  265.                 11    even
  266.         baud rate    000    110 baud
  267.                 001    150 baud
  268.                 010    300 baud
  269.                 011    600 baud
  270.                 100    1200 baud
  271.                 101    2400 baud
  272.                 110    4800 baud
  273.                 111    9600 baud  (4800 on PCjr)
  274.     DX    port number (0=COM1, 1=COM2, etc.)
  275. return    AH    line status
  276.     AL    modem status
  277. note    To initialize the serial port to > 9600 baud on PS/2 machines, see
  278.     fns 04h and 05h.
  279.  
  280.  
  281. Function 01h    Send Character in AL to Comm Port
  282. entry    AH    01h
  283.     AL    character
  284.     DX    port number (0 - 3)
  285. return    AH    RS232 status code
  286.         bit    0    data ready
  287.             1    overrun error
  288.             2    parity error
  289.             3    framing error
  290.             4    break detected
  291.             5    transmission buffer register empty
  292.             6    transmission shift register empty
  293.             7    timeout
  294.     AL    modem status
  295.         bit
  296.             0    delta clear-to-send
  297.             1    delta data-set-ready
  298.             2    trailing edge ring detected
  299.             3    change, receive line signal detected
  300.             4    clear-to-send
  301.             5    data-set-ready
  302.             6    ring received
  303.             7    receive line signal detected
  304.  
  305.                                     -36-
  306.  
  307. Function 02h    Wait For A Character From Comm Port DX
  308. entry    AH    02h
  309.     DX    port number (0-3)
  310. return    AL    character received
  311.     AH    error code (see above)(00h for no error)
  312.  
  313.  
  314. Function 03h    Fetch the Status of Comm Port DX (0 or 1)
  315. entry    AH    03h
  316.     DX    port (0-3)
  317. return    AH    set bits (01h) indicate comm-line status
  318.         bit    7    timeout
  319.         bit    6    empty transmit shift register
  320.         bit    5    empty transmit holding register
  321.         bit    4    break detected ("long-space")
  322.         bit    3    framing error
  323.         bit    2    parity error
  324.         bit    1    overrun error
  325.         bit    0    data ready
  326.     AL    set bits indicate modem status
  327.         bit    7    received line signal detect
  328.         bit    6    ring indicator
  329.         bit    5    data set ready
  330.         bit    4    clear to send
  331.         bit    3    delta receive line signal detect
  332.         bit    2    trailing edge ring detector
  333.         bit    1    delta data set ready
  334.         bit    0    delta clear to send
  335.  
  336.  
  337. Function 04h    Extended Initialize              (Convertible, PS/2)
  338. entry    AH    04h
  339.     AL    break status
  340.         01h    if break
  341.         00h    if no break
  342.     BH    parity
  343.         00h    no parity
  344.         01h    odd parity
  345.         02h    even parity
  346.         03h    stick parity odd
  347.         04h    stick parity even
  348.     BL    number of stop bits
  349.         00h    one stop bit
  350.         01h    2 stop bits (1½ if 5 bit word length)
  351.     CH    word length
  352.         00h    5 bits
  353.         01h    6 bits
  354.         02h    7 bits
  355.         03h    8 bits
  356.     CL    baud rate
  357.         00h    110
  358.         01h    150
  359.         02h    300
  360.         03h    600
  361.         04h    1200
  362.         05h    2400
  363.         06h    4800
  364.         07h    9600
  365.         08h    19200
  366.     DX    comm port (0-3)
  367. return    AH    line control status
  368.     AL    modem status
  369. note    Provides a superset of fn 00h capabilities for PS/2 machines.
  370.  
  371.                                     -37-
  372.  
  373. Function 05h    Extended Communication Port Control      (Convertible, PS/2)
  374. entry    AH    05h
  375.     AL    00h    read modem control register
  376.         01h    write modem control register
  377.     BL    modem control register
  378.        bits 0    DTR data terminal ready
  379.         1    RTS request to send
  380.         2    out1
  381.         3    out2
  382.         4    loop
  383.         5,6,7    reserved
  384.     DX    port number (0=COM1, 1=COM2, etc.)
  385. return    AH    port status (see 00h above)
  386.     AL    modem status (see 00h above)
  387.     BL    modem control register (see 01h above)
  388.  
  389.  
  390.  
  391. FOSSIL Drivers ........................................................ 3**7
  392.  
  393. Interrupt  14h    FOSSIL (Fido/Opus/Seadog Standard Interface Level) drivers
  394.         A FOSSIL is a device driver for handling the IBM PC serial
  395.         communications ports in a standard fashion from an application
  396.         (communications) program. A FOSSIL chains into the int 14h BIOS
  397.         communications vector and replaces many functions with enhanced
  398.         routines that may be easily accessed by an application.
  399.  
  400.         For all functions, all registers not specifically containing a
  401.         function return value must be preserved across the call.
  402.  
  403.  
  404. entry    AH    00h    Set baud rate and parameters
  405.     AL    byte
  406.         bits 7,6,5 baudrate
  407.         000    19200 baud
  408.         001    38400 baud
  409.         010    300 baud
  410.         011    600 baud
  411.         100    1200 baud
  412.         101    2400 baud
  413.         110    4800 baud
  414.         111    9600 baud
  415.         bits 4,3 parity
  416.         00    none
  417.         01    odd
  418.         10    none
  419.         11    even
  420.         bit 2 stop bits
  421.         0    1 stop bit
  422.         1    2 stop bits
  423.         bit 1 char length
  424.         0    5 bits plus value
  425.         other    optional
  426.     DX    port number (NOP if DX=00FFh)
  427. return    AX    status (see fn 03h)
  428. note    Low-order 5 bits are undefined by FOSSIL 1.0 spec.
  429.  
  430.  
  431. entry    AH    01h    Transmit character with wait
  432.     AL    ASCII value of character to be sent
  433.     DX    port number (NOP if DX=00FFh)
  434. return    AX    status bits (see function 03h)
  435. note 1) Character is queued for transmission. If there is room in the
  436.     transmitter buffer when this call is made, the character will be stored
  437.     and control returned to caller. If the buffer is full, the driver will
  438.     wait for room. Use this function with caution when flow control is
  439.     enabled.
  440.  
  441.                                     -38-
  442.  
  443. entry    AH    02h    FOSSIL: Receive a character with wait
  444.     DX    port number (0-3) (NOP if DX=00FFh)
  445. return    AH    RS-232 status code (see AH=00h above)
  446.     AL    ASCII value of character received from serial port
  447. note    Will timeout if DSR is not asserted, even if function 03h returns
  448.     data ready.
  449.  
  450.  
  451. entry    AH    03h    FOSSIL: Request status
  452.     DX    port number  (NOP if DX=00FFh)
  453. return    AX    status bit mask
  454.         AH    bit 0 set  RDA       input data is available in buffer
  455.                 1 set  OVRN    input buffer overrun
  456.                 2 N/A
  457.                 3 N/A
  458.                 4 N/A
  459.                 5 set  THRE    room is available in output buffer
  460.                 6 set  TSRE    output buffer is empty
  461.                 7 N/A
  462.         AL    bit 0 N/A
  463.                 1 N/A
  464.                 2 N/A
  465.                 3 set       this bit is always set
  466.                 4 N/A
  467.                 5 N/A
  468.                 6 N/A
  469.                 7 set  DCD       carrier detect
  470. note    Bit 3 of AL is always returned set to enable programs to use it as a
  471.     carrier detect bit on hardwired (null modem) links.
  472.  
  473.  
  474. entry    AH    04h    Initialize FOSSIL driver
  475.     BX    4F50h               (optional)
  476.     DX    port number           (DX=00FFh special)
  477.     ES:CX    pointer to ^C flag address (optional)
  478. return    AX    1954h if successful
  479.     BL    maximum function number supported (excluding 7Eh-0BFh)
  480.     BH    revision of FOSSIL supported
  481. note 1) DTR is raised when FOSSIL inits.
  482.      2) Existing baudrate is preserved.
  483.      3) If BX contains 4F50h, the address specified in ES:CX is that of a ^C
  484.     flag byte in the application program, to be incremented when ^C is
  485.     detected in the keyboard service routines. This is an optional service
  486.     and only need be supported on machines where the keyboard service can't
  487.     (or won't) perform an int 1Bh or int 23h when a control-C is entered.
  488.  
  489.  
  490. entry    AH    05h    Deinitialize FOSSIL driver
  491.     DX    port number  (DX=00FFh special)
  492. return    none
  493. note 1) DTR is not affected.
  494.      2) Disengages driver from comm port. Should be done when operations on the
  495.     port are complete.
  496.      3) If DX=00FFh, the initialization that was performed when FOSSIL function
  497.     04h with DX=00FFh should be undone.
  498.  
  499.  
  500. entry    AH    06h    FOSSIL: Raise/lower DTR
  501.     AL    DTR state to be set
  502.         00h    lower DTR
  503.         01h    raise DTR
  504.     DX    comm port (NOP if DX=00FFh)
  505. return    none
  506.  
  507.                                     -39-
  508.  
  509. entry    AH    07h    FOSSIL: Return timer tick parameters
  510. return    AH    ticks per second on interrupt number shown in AL
  511.     AL    timer tick interrupt number (not vector!)
  512.     DX    milliseconds per tick (approximate)
  513.  
  514.  
  515. entry    AH    08h    FOSSIL: Flush output buffer
  516.     DX    port number (NOP if DX=00FFh)
  517. return    none
  518. note    Waits until all output is done.
  519.  
  520.  
  521. entry    AH    09h    FOSSIL: Purge output buffer
  522.     DX    port number (NOP if DX=00FFh)
  523. return    none
  524. note    Returns to caller immediately.
  525.  
  526.  
  527. entry    AH    0Ah    FOSSIL: Purge input buffer
  528.     DX    port number (NOP if DX=00FFh)
  529. return    none
  530. note 1) If any flow control restraint has been employed (dropping RTS or
  531.     transmitting XOFF) the port will be "released" by doing the reverse,
  532.     raising RTS or sending XON.
  533.      2) Returns to caller immediately.
  534.  
  535.  
  536. entry    AH    0Bh    FOSSIL: Transmit no wait
  537.     AL    ASCII character value to be sent
  538.     DX    port number (NOP if DX=00FFh)
  539. return    AX    0000h    character not accepted
  540.         0001h    character accepted
  541. note    This is exactly the same as the "regular" transmit call except that if
  542.     there is no space available in the output buffer a value of zero is
  543.     returned in AX, if room is available a value 1 (one) is returned.
  544.  
  545.  
  546. entry    AH    0Ch    FOSSIL: Nondestructive Read no Wait
  547.     DX    port number (NOP if DX=00FFh)
  548. return    AH    character
  549.         0FFFFh    character not available
  550. note 1) Reads async buffer.
  551.      2) Does not remove keycode from buffer.
  552.  
  553.  
  554. entry    AH    0Dh    FOSSIL: Keyboard read no wait
  555. return    AX    IBM keyboard scan code or
  556.         0FFFFh if no keyboard character available
  557. note 1) Use IBM-style function key mapping in the high order byte.
  558.      2) Scan codes for non function keys are not specifically required but may
  559.     be included.
  560.      3) Does not remove keycode from buffer.
  561.  
  562.  
  563. entry    AH    0Eh    FOSSIL: Keyboard input with wait
  564. return    AX    IBM keyboard scan code
  565. note    Returns the next character from the keyboard or waits if no character
  566.     is available.
  567.  
  568.                                     -40-
  569.  
  570. entry    AH    0Fh    Enable or Disable flow control
  571.     AL    bit mask describing requested flow control
  572.        bits 0    XON/XOFF on transmit (watch for XOFF while sending)
  573.         1    CTS/RTS (CTS on transmit/RTS on receive)
  574.         2    reserved
  575.         3    XON/XOFF on receive (send XOFF when buffer near full)
  576.         4-7    not used, FOSSIL spec calls for setting to 1
  577.     DX    port number (NOP if DX=00FFh)
  578. return    none
  579. note 1) Bit 2 is reserved for DSR/DTR,    but is not currently supported in any
  580.     implementation.
  581.      2) TRANSMIT flow control allows the other end to restrain the transmitter
  582.     when you are overrunning it. RECEIVE flow control tells the FOSSIL to
  583.     attempt to do just that if it is being overwhelmed.
  584.      3) Enabling transmit Xon/Xoff will cause the FOSSIL to stop transmitting
  585.     upon receiving an Xoff. The FOSSIL will resume transmitting when an Xon
  586.     is received.
  587.      4) Enabling CTS/RTS will cause the FOSSIL to cease transmitting when CTS
  588.     is lowered. Transmission will resume when CTS is raised. The FOSSIL
  589.     will drop RTS when the receive buffer reaches a predetermined
  590.     percentage full. The FOSSIL will raise RTS when the receive buffer
  591.     empties below the predetermined percentage full. The point(s) at which
  592.     this occurs is left to the individual FOSSIL implementor.
  593.      5) Enabling receive Xon/Xoff will cause the FOSSIL to send a Xoff when the
  594.     receive buffer reaches a pre-determined percentage full. An Xon will be
  595.     sent when the receive buffer empties below the predetermined percentage
  596.     full. The point(s) at which this occurs is left to the individual
  597.     FOSSIL implementor.
  598.      6) Applications using this function should set all bits ON in the high
  599.     nibble of AL as well. There is a compatible (but not identical) FOSSIL
  600.     driver implementation that uses the high nibble as a control mask. If
  601.     your application sets the high nibble to all ones, it will always work,
  602.     regardless of the method used by any given driver.
  603.  
  604.  
  605. entry    AH    10h    Extended Ctrl-C/Ctrl-K checking and transmit on/off
  606.     AL    flags bit mask byte (bit set if activated)
  607.        bits 0    enable/disable Ctrl-C/Ctrl-K checking
  608.         1    disable/enable the transmitter
  609.         2-7    not used
  610.     DX    port number (NOP if DX=00FFh)
  611. return    AX    status byte
  612.         0000h    control-C/K has not been received
  613.         0001h    control-C/K has been received
  614. note    This is used primarily for programs that can't trust XON/XOFF at FOSSIL
  615.     level (such as BBS software).
  616.  
  617.  
  618. entry    AH    11h    FOSSIL: Set current cursor location.
  619.     DH    row (line) 0-24
  620.     DL    column       0-79
  621. return    none
  622. note 1) This function looks exactly like the int 10h, fn 02h on the IBM PC.
  623.     The cursor location is passed in DX: row in DH and column in DL. This
  624.     function treats the screen as a coordinate system whose origin (0,0) is
  625.     the upper left hand corner of the screen.
  626.      2) Row and column start at 0.
  627.  
  628.  
  629. entry    AH    12h    FOSSIL: Read current cursor location.
  630. return    DH    row (line)
  631.     DL    column
  632. note 1) Looks exactly like int 10h/fn 03h in the IBM PC BIOS. The current
  633.     cursor location (same coordinate system as function 16h) is passed back
  634.     in DX.
  635.      2) Row and column start at 0.
  636.  
  637.                                     -41-
  638.  
  639. entry    AH    13h    FOSSIL: Single character ANSI write to screen.
  640.     AL    value of character to display
  641. return    none
  642. note    This call might not be reentrant since ANSI processing may be through
  643.     DOS.
  644.  
  645.  
  646. entry    AH    14h    FOSSIL: Enable or disable watchdog processing
  647.     AL    00h    to disable watchdog
  648.         01h    to enable watchdog
  649.     DX    port number (NOP if DX=00FFh)
  650. return    none
  651. note 1) This call will cause the FOSSIL to reboot the system if Carrier Detect
  652.     for the specified port drops while watchdog is turned on.
  653.      2) The port need not be active for this function to work.
  654.  
  655.  
  656. entry    AH    15h    Write character to screen using BIOS support routines
  657.     AL    ASCII code of character to display
  658. return    none
  659. note 1) This function is reentrant.
  660.      2) ANSI processing may not be assumed.
  661.  
  662.  
  663. entry    AH    16h    Insert or Delete a function from the timer tick chain
  664.     AL    00h    to delete a function
  665.         01h    to add a function
  666.     ES:DX    address of function
  667. return    AX    0000h    successful
  668.         0FFFFh    unsuccessful
  669.  
  670.  
  671. entry    AH    17h    FOSSIL: Reboot system
  672.     AL    boot type
  673.         00h    cold boot
  674.         01h    warm boot
  675. return    none
  676.  
  677.  
  678. entry    AH    18h    FOSSIL: Read block
  679.     CX    maximum number of characters to transfer
  680.     DX    port number (NOP if DX=00FFh)
  681.     ES:DI    pointer to user buffer
  682. return    AX    number of characters transferred
  683. note 1) This function does not wait for more characters to become available if
  684.     the value in CX exceeds the number of characters currently stored.
  685.      2) ES:DI are left unchanged by the call; the count of bytes actually
  686.     transferred will be returned in AX.
  687.  
  688.  
  689. entry    AH    19h    FOSSIL: Write block
  690.     CX    maximum number of characters to transfer
  691.     DX    port number  (NOP if DX=00FFh)
  692.     ES:DI    pointer to user buffer
  693. return    AX    number of characters transfered
  694. note    ES and DI are not modified by this call.
  695.  
  696.                                     -42-
  697.  
  698. entry    AH    1Ah    FOSSIL: Break signal begin or end
  699.     AL    00h    stop sending 'break'
  700.         01h    start sending 'break'
  701.     DX    port number  (NOP if DX=00FFh)
  702. return    none
  703. note 1) Resets all transmit flow control restraints such as an XOFF received
  704.     from remote.
  705.      2) Init (fn 04h) or UnInit (fn 05h) will stop an in-progress break.
  706.      3) The application must determine the "length" of the break.
  707.  
  708.  
  709. entry    AH    1Bh    FOSSIL: Return information about the driver
  710.     CX    size of user buffer in bytes
  711.     DX    port number  (if DX=00FFh, port data will not be valid)
  712.     ES:DI    pointer to user buffer
  713. return    AX    number of characters transferred
  714.     ES:DI    user buffer structure:
  715.         00h    word    size of structure in bytes
  716.         02h    byte    FOSSIL driver version
  717.         03h    byte    revision level of this specific driver
  718.         04h    dword    FAR pointer to ASCII ID string
  719.         08h    word    size of the input buffer in bytes
  720.         0Ah    word    number of bytes in input buffer
  721.         0Ch    word    size of the output buffer in bytes
  722.         0Eh    word    number of bytes in output buffer
  723.         10h    byte    width of screen in characters
  724.         11h    byte    screen height in characters
  725.         12h    byte    actual baud rate, computer to modem
  726.                 (see mask in function 00h
  727. note 1) The baud rate byte contains the bits that fn 00h would use to set the
  728.     port to that speed.
  729.      2) The fields related to a particular port (buffer size, space left in the
  730.     buffer, baud rate) will be undefined if port=0FFh or an invalid port is
  731.     contained in DX.
  732.      3) Additional information will always be passed after these, so that the
  733.     fields will never change with FOSSIL revision changes.
  734.  
  735.  
  736. entry    AH    7Eh    FOSSIL: Install an external application function
  737.     AL    code assigned to external application
  738.     ES:DX    pointer to entry point
  739. return    AX    1954h    FOSSIL driver present
  740.         not 1954h    FOSSIL driver not present
  741.     BH    00h    failed
  742.         01h    successful
  743.     BL    code assigned to application (same as input AL)
  744. note 1) Application codes 80h-0BFh are supported. Codes 80h-83h are reserved.
  745.      2) An error code of BH=00h with AX=1954h should mean that another external
  746.     application has already been installed with the code specified in AL.
  747.      3) Applications are entered via a FAR call and should make a FAR return.
  748.  
  749.  
  750. entry    AH    7Fh    FOSSIL: Remove an external application function
  751.     AL    code assigned to external application
  752.     ES:DX    pointer to entry point
  753. return    AX    1954h
  754.     BH    00h    failed
  755.         01h    successful
  756.     BL    code assigned to application (same as input AL)
  757.  
  758.                                     -43-
  759.  
  760. ┌─────────────────────────────────────────────────────────────────────────────┐
  761. │Interrupt 15h    Cassette I/O                        3**8  │
  762. └─────────────────────────────────────────────────────────────────────────────┘
  763. (0:0054h)    1) Renamed "System Services" on PS/2 line.
  764.          2) Issuing int 15h on an XT may cause a system crash.
  765.         On AT and after, interrupts are disabled with CLI when the
  766.         interrupt service routine is called, but most ROM versions do
  767.         not restore interrupts with STI.
  768.          3) For the original IBM PC, int 15h returns AH=80h and CF set for
  769.         all calls with AH not 0,1, or 2.
  770.          4) For the PC/XT int 15h returns AH=86h, CF set if called at all.
  771.         (the PC/XT ROM BIOS does not support int 15h)
  772.          5) For the AT/339, int 15h returns AH=86h, CF set if called with
  773.         an invalid function code.
  774.  
  775.  
  776. Function 00h    Turn Cassette Motor On                (PC, PCjr only)
  777. entry    AH    00h
  778. return    CF    set on error
  779.         AH    error code
  780.             00h    no errors
  781.             01h    CRC error
  782.             02h    bad tape signals
  783.                 no data transitions (PCjr)
  784.             03h    no data found on tape
  785.                 not used (PCjr)
  786.             04h    no data
  787.                 no leader (PCjr)
  788.             80h    invalid command
  789.             86h    no cassette present
  790.                 not valid in PCjr
  791. note    NOP for systems where cassette not supported.
  792.  
  793.  
  794. Function 01h    Turn Cassette Motor Off             (PC, PCjr only)
  795. entry    AH    01h
  796. return    CF    set on error
  797.     AH    error code (86h)
  798. note    NOP for systems where cassette not supported.
  799.  
  800.  
  801. Function 02h    Read Blocks From Cassette            (PC, PCjr only)
  802. entry    AH    02h
  803.     CX    number of bytes to read
  804.     ES:BX    segment:offset + 1 of last byte read
  805. return    CF    set on error
  806.         AH    error code (01h, 02h, 04h, 80h, 86h)
  807.     DX    count of bytes actually read
  808.     ES:BX    pointer past last byte written
  809. note 1) NOP for systems where cassette not supported.
  810.      2) Cassette operations normally read 256 byte blocks.
  811.  
  812.  
  813. Function 03h    Write Data Blocks to Cassette            (PC, PCjr only)
  814. entry    AH    03h
  815.     CX    count of bytes to write
  816.     ES:BX    pointer to data buffer
  817. return    CF    set on error
  818.         AH    error code (80h, 86h)
  819.     CX    00h
  820.     ES:BX    pointer to last byte written+1
  821. note 1) NOP for systems where cassette not supported.
  822.      2) The last block is padded to 256 bytes with zeroes if needed.
  823.      3) No errors are returned by this service.
  824.  
  825.                                     -44-
  826.  
  827.  
  828. Function 0Fh    ESDI Format Unit Periodic Interrupt         (PS/2 50+)
  829. entry    AH    0Fh
  830.     AL    phase code
  831.         00h    reserved
  832.         01h    surface analysis
  833.         02h    formatting
  834. return    CF    clear    if formatting should continue
  835.         set    if it should terminate
  836. note 1) Called the BIOS on the ESDI Fixed Disk Drive Adapter/A during a format
  837.     or surface analysis operation after each cylinder is completed.
  838.      2) This function call can be captured by a program so that it will be
  839.     notified as each cylinder is formatted or analyzed. The program can
  840.     count interrupts for each phase to determine the current cylinder
  841.     number.
  842.      3) The BIOS default handler for this function returns with CF set.
  843.  
  844.  
  845. Function 10h    TopView API Function Calls            (TopView)
  846. entry    AH    00h    PAUSE    Give Up CPU Time
  847.             return    00h    after other processes run
  848.         01h    GETMEM    allocate "system" memory
  849.             BX    number of bytes to allocate
  850.             return    ES:DI    pointer to a block of memory
  851.         02h    PUTMEM    deallocate "system" memory
  852.             ES:DI    pointer to previously allocated block
  853.             return    block freed
  854.         03h    PRINTC    display character/attribute on screen
  855.             BH    attribute
  856.             BL    character
  857.             DX    segment of object handle for window
  858.             note    BX=0 does not display anything, it only
  859.                 positions the hardware cursor.
  860.         04h-09h unknown
  861.         10h    unknown
  862.             AL    04h thru 12h
  863.             return    TopView - unimplemented in DV 2.0x
  864.                 pops up "Programming error" window in DV 2.0x
  865.         11h    unknown
  866.         12h    unknown
  867.         13h    GETBIT    define a 2nd-level interrupt handler
  868.             ES:DI    pointer to FAR service routine
  869.             return    BX    bit mask indicating which bit was
  870.                     allocated
  871.                     0 if no more bits available
  872.         14h    FREEBIT undefine a 2nd-level interrupt handler
  873.             BX    bit mask from int 15/fn1013h
  874.         15h    SETBIT    schedule one or more 2nd-level interrupts
  875.             BX    bit mask for interrupts to post
  876.             return    indicated routines will be called at next ???
  877.         16h    ISOBJ    verify object handle
  878.             ES:DI    possible object handle
  879.             return     BX    -1 if ES:DI is a valid object handle
  880.                      0 if ES:DI is not
  881.         17h    TopView - unimplemented in DV 2.00
  882.             return    pops up "Programming Error" window in DV 2.00
  883.         18h    LOCATE    Find Window at a Given Screen Location
  884.             BH    column
  885.             BL    row
  886.             ES    segment of object handle for ?
  887.                 (0 = use default)
  888.             return    ES    segment of object handle for window
  889.                     which is visible at the indicated
  890.                     position
  891.  
  892.                                     -45-
  893.  
  894.         19h    SOUND    Make Tone
  895.             BX    frequency in Hertz
  896.             CX    duration in clock ticks (18.2 ticks/sec)
  897.             return    immediately, tone continues to completion
  898.             note 1) If another tone is already playing, the new tone
  899.                 does not start until completion of the previous
  900.                 one. In DV 2.00, it is possible to enqueue
  901.                 about 32 tones before the process is blocked
  902.                 until a note completes.
  903.                  2) In DV 2.00, the lowest tone allowed is 20 Hz.
  904.         1Ah    OSTACK    Switch to Task's Internal Stack
  905.             return    stack switched
  906.         1Bh    BEGINC    Begin Critical Region
  907.             return    task-switching temporarily disabled
  908.             note    Will not task-switch until End Critical Region
  909.                 (AH=101Ch) is called.
  910.         1Ch    ENDC    End Critical Region
  911.             return    task-switching enabled
  912.         1Dh    STOP    STOP TASK
  913.             ES    segment of object handle for task to be stopped
  914.                 (= handle of main window for that task)
  915.             return    indicated task will no longer get CPU time
  916.             note    At least in DV 2.00, this function is ignored
  917.                 unless the indicated task is the current task.
  918.         1Eh    START    Start Task
  919.             ES    segment of object handle for task to be started
  920.                 (= handle of main window for that task)
  921.             return    Indicated task is started up again
  922.         1Fh    DISPEROR Pop-Up Error Window
  923.             BX    bit fields:
  924.                 0-12    number of characters to display
  925.                 13,14    which mouse button may be pressed to
  926.                     remove window
  927.                     00    either
  928.                     01    left
  929.                     10    right
  930.                     11    either
  931.                 15    beep if 1
  932.             CH    width of error window (0 = default)
  933.             CL    height of error window (0 = default)
  934.             DS:DI    pointer to text of message
  935.             DX    segment of object handle
  936.             return    BX    status:
  937.                     1    left button pressed
  938.                     2    right button pressed
  939.                     27    ESC key pressed
  940.             note    Window remains on-screen until ESC or indicated
  941.                 mouse button is pressed.
  942.         20h    TopView - unimplemented in DV 2.0x
  943.             return    pops up "Programming Error" window in DV 2.0x
  944.         21h    PGMINT    Interrupt Another Task (TopView)
  945.             BX    segment of object handle for task to interrupt
  946.             DX:CX    address of FAR routine to jump to next time
  947.                 task is run
  948.             return    nothing?
  949.             note    The current ES, DS, SI, DI, and BP are passed
  950.                 to the FAR routine.
  951.         22h    GETVER    Get Version
  952.             BX    00h
  953.             return    BX    nonzero, TopView or compatible loaded
  954.                 BH    minor version
  955.                 BL    major version
  956.             notes    TaskView v1.1C returns BX = 0001h
  957.                 DESQview  v2.0 returns BX = 0A01h
  958.  
  959.                                     -46-
  960.  
  961.         23h    POSWIN    Position Window
  962.             BX    segment of object handle for parent window
  963.                 within which to position the window (0 = full
  964.                 screen)
  965.             CH    # columns to offset from position in DL
  966.             CL    # rows to offset from position in DL
  967.             DL    bit flags
  968.                 0,1    horizontal position
  969.                     00    current
  970.                     01    center
  971.                     10    left
  972.                     11    right
  973.                 2,3    vertical position
  974.                     00    current
  975.                     01    center
  976.                     10    top
  977.                     11    bottom
  978.                 4    don't redraw screen if set
  979.                 5-7    not used
  980.             ES    segment of object handle for window to be
  981.                 positioned
  982.             return    nothing
  983.         24h    GETBUF    Get Virtual Screen Information
  984.             BX    segment of object handle for window (0=default)
  985.             return    CX    size of virtual screen in bytes
  986.                 DL    0 or 1, unknown
  987.                 ES:DI    address of virtual screen
  988.         25h    USTACK    Switch Back to User's Stack
  989.             return    stack switched back
  990.             note    Call only after int 15h, fn101Ah.
  991.         26h-2Ah DesQview (TopView?) - unimplemented in DV 2.0x
  992.             return    pops up "Programming Error" window in DV 2.0x
  993.         2Bh    POSTTASK  Awaken Task        DesQview 2.0 (TopView?)
  994.             BX    segment of object handle for task
  995.             return    nothing
  996.         2Ch    Start New Application in New Process
  997.             DesQview 2.0 (TopView?)
  998.             ES:DI    pointer to contents of .PIF/.DVP file
  999.             BX    size of .PIF/.DVP info
  1000.             return    BX    segment of object handle for new task
  1001.                     00h    if error
  1002.         2Dh    Keyboard Mouse Control         DesQview 2.0+
  1003.             BL    subfunction
  1004.                 00h    determine whether using keyboard mouse
  1005.                 01h    turn keyboard mouse on
  1006.                 02h    turn keyboard mouse off
  1007.             return    (calling BL was 00h)
  1008.                 BL    0    using real mouse
  1009.                     1    using keyboard mouse
  1010.  
  1011.  
  1012. Function 11h    Topview commands
  1013. entry    AH    11h
  1014.     AL    various
  1015. note    In DesQview 2.0x, these function calls are identical to AH=0DEh, so
  1016.     see those below.
  1017.  
  1018.  
  1019. Function 20h    PRINT.COM  (DOS internal)     (AT, XT-286, PS/2 50+)
  1020. entry    AH    20h
  1021.     AL    subfunction
  1022.         00h    unknown (PRINT)
  1023.         01h    unknown (PRINT)
  1024.         10h    sets up SysReq routine on AT, XT/286, PS/2
  1025.         11h    completion of SysReq routine (software only)
  1026. note 1) AL=0 or 1 sets or resets some flags which affect what PRINT does when
  1027.     it tries to access the disk.
  1028.  
  1029.                                     -47-
  1030.  
  1031.  
  1032. Function 21h    Read Power-On Self Test (POST) Error Log       (PS/2 50+)
  1033. entry    AH    21h
  1034.     AL    00h    read POST log
  1035.         01h    write POST log
  1036.             BH    device ID
  1037.             BL    device error code
  1038. return    CF    set on error
  1039.     AH    status
  1040.         00h    successful read
  1041.             BX    number of POST error codes stored
  1042.             ES:DI    pointer to error log
  1043.         01h    list full
  1044.         80h    invalid command
  1045.         86h    function unsupported
  1046. note    The log is a series of words, the first byte of which identifies the
  1047.     error code and the second is the device ID.
  1048.  
  1049.  
  1050. Function 40h    Read/Modify Profiles                (Convertible)
  1051. entry    AH    40h
  1052.     AL    00h    read system profile in CX,BX
  1053.         01h    write system profile from CX, BX
  1054.         02h    read internal modem profile in BX
  1055.         03h    write internal modem profile from BX
  1056.     BX    profile info
  1057. return    BX    internal modem profile (from 02h)
  1058.     CX,BX    system profile (from 00h)
  1059.  
  1060.  
  1061. Function 41h    Wait On External Event                (Convertible)
  1062. entry    AH    41h
  1063.     AL    condition type
  1064.        bits 0-2    condition to wait for
  1065.             0,0,0    any external event
  1066.             0,0,1    compare and return if equal
  1067.             0,1,0    compare and return if not equal
  1068.             0,1,1    test and return if not zero
  1069.             1,0,0    test and return if zero
  1070.         3    reserved
  1071.         4    0    user byte
  1072.             1    port address
  1073.         5-7    reserved
  1074.     BH    condition compare or mask value
  1075.         condition codes:
  1076.         00h    any external event
  1077.         01h    compare and return if equal
  1078.         02h    compare and return if not equal
  1079.         03h    test and return if not zero
  1080.         04h    test and return if zero
  1081.     BL    timeout value times 55 milliseconds
  1082.         00h    if no time limit
  1083.     DX    I/O port address (if AL bit 4=1)
  1084.     ES:DI    pointer to user byte (if AL bit 4=0)
  1085.  
  1086.  
  1087. Function 42h    Request System Power Off            (Convertible)
  1088. entry    AH    42h
  1089.     AL    00h    to use system profile
  1090.         01h    to force suspend regardless of profile
  1091. return    unknown
  1092.  
  1093.                                     -48-
  1094.  
  1095.  
  1096. Function 43h    Read System Status                (Convertible)
  1097. entry    AH    43h
  1098. return    AL    status byte
  1099.         bit 0    LCD detached
  1100.         1    reserved
  1101.         2    RS232/parallel powered on
  1102.         3    internal modem powered on
  1103.         4    power activated by alarm
  1104.         5    bad time
  1105.         6    external power in use
  1106.         7    battery low
  1107.  
  1108.  
  1109. Function 44h    (De)activate Internal Modem Power        (Convertible)
  1110. entry    AH    44h
  1111.     AL    00h     to power off
  1112.         01h     to power on
  1113. return    unknown
  1114.  
  1115.  
  1116. Function 4Fh    OS Hook - Keyboard Intercept          (except PC, PCjr, and XT)
  1117. entry    AH    4Fh
  1118.     AL    scan code, CF set
  1119. return    AL    scan code
  1120.     CF    set    processing desired
  1121.         clear    scan code should not be used
  1122. note 1) Called by int 9 handler for each keystroke to translate scan codes.
  1123.      2) An OS or a TSR can capture this function to filter the raw keyboard
  1124.     data stream. The new handler can substitute a new scan code, return the
  1125.     same scan code, or return the carry flag clear causing the keystroke to
  1126.     be discarded. The BIOS default routine simply returns the scan code
  1127.     unchanged.
  1128.      3) A program can call int 15h/fn0C0h to determine whether the host
  1129.     machine's BIOS supports keyboard intercept.
  1130.  
  1131.  
  1132. Function 52h    MicroSoft RAM-Resident Software Specification 1.0
  1133.         This standard was proposed by MicroSoft in 1986 as a common
  1134.         interface for TSR programs. It appears to have been largely
  1135.         unknown or disregarded.
  1136.  
  1137. Function 0: Get Program Information by Name
  1138. entry    DS:BX    The Program ID of the memory-resident program to look for
  1139. return    AL    0FFh    if the program we are looking for is installed
  1140.         00h    if it is not installed
  1141.     CX    The number of this program. The first program installed is
  1142.         number 0, with the second program being number 1, etc. By using
  1143.         a dynamic numbering system, we avoid conflicts between programs
  1144.         that might otherwise choose the same ID. We also provide a good
  1145.         way to scan all the resident programs using function 1.
  1146.     ES:DX    pointer to the Program ID Record (PIDR)
  1147. note    This function tests to see if a program is memory resident and returns
  1148.     a pointer to its program information if it is resident. To use this
  1149.     function, set DS:BX to point to the program ID. Each installed program
  1150.     will check to see if this program ID agrees with its own internal
  1151.     program ID.
  1152.  
  1153.                                     -49-
  1154.  
  1155.  
  1156. Function 1: Get Program Information by Number
  1157. entry    CX    Number of the program we want the information for
  1158.  
  1159. return    AL    0FFh    if the program we are looking for is installed
  1160.         00h    if it is not installed
  1161.     ES:DX    pointer to the Program ID Record (PIDR)
  1162. note    This function returns exactly the same information as function 0. The
  1163.     only difference is how we identify the program we want, which is
  1164.     determined by its position in the interrupt chain; program 0 is the
  1165.     last program in the chain, and the first program in the chain (usually
  1166.     the most recently installed) has the highest number.
  1167.  
  1168. Function 2: Activate Program
  1169. entry    CX    The number of the program we want to activate
  1170.     DS:BX    Activation Record. This record will give program information on
  1171.         how and what it should activate within the program
  1172. return    none
  1173. note    This function activates one of the installed programs. It is useful
  1174.     if you want to control many desk accessories with a single control
  1175.     panel like the one used in SideKick. You can also use it with a
  1176.     program like ProKey to run a named macro under program control, or
  1177.     with SideKick to bring up one of the desk accessories from within a
  1178.     program or batch file.
  1179.  
  1180. Function 3: Deactivate Program
  1181. entry    CX    The number of the program we want to deactivate
  1182.     DS:BX    Deactivation Record. This record will give program information
  1183.         on how and what it should deactivate within the program
  1184. return    none
  1185. note    This function is the opposite of function 2 (activate program).
  1186.  
  1187. Function 4: Enable Program
  1188. entry    CX    The number of the program we want to enable
  1189.     DS:BX    Enable mask record. This mask describes what features we want
  1190.         to enable. A null record enables all the features.
  1191. return    none
  1192. note    This function is the opposite of function 5 (disable program).
  1193.  
  1194. Function 5: Disable Program
  1195. entry    CX    The number of the program we want to disable
  1196.     DS:BX    Disable mask record.  This mask describes what features we want
  1197.         to disable. A null record disables all the features.
  1198. return    none
  1199. note    Sometimes it becomes necessary to disable a program to prevent it from
  1200.     conflicting with another program, this function is designed to do that.
  1201.     This function is the opposite of function 4 (Enable Program).
  1202.  
  1203.  
  1204. Function 70h    EEROM handler                     (Tandy 1000HX)
  1205. entry    AH    00h    read from EEROM
  1206.         BL    00h
  1207.         01h    write to EEROM
  1208.         BL    word number to write (0-15)
  1209.         DX    word value to write
  1210. return    DX    (AH=00h) word value
  1211.     CF    set on error (system is not a Tandy 1000 HX)
  1212.  
  1213.                                     -50-
  1214.  
  1215.  
  1216. Function 80h    OS Hook - Device Open                 (AT, XT/286, PS/2)
  1217. entry    AH    80h
  1218.     BX    device ID
  1219.     CX    process ID
  1220. return    CF    set on error
  1221.     AH    status
  1222. note 1) Acquires ownership of a logical device for a process.
  1223.      2) This call, along with fns 81h and 82h, defines a simple protocol that
  1224.     can be used to arbitrate usage of devices by multiple processes. A
  1225.     multitasking program manager would be expected to capture int 15h and
  1226.     provide the appropriate service.
  1227.      3) The default BIOS routine for this function simply returns with CF clear
  1228.     and AH=00h.
  1229.  
  1230.  
  1231. Function 81h    OS Hook - Device Close                 (AT, XT/286, PS/2)
  1232. entry    AH    81h
  1233.     BX    device ID
  1234.     CX    process ID
  1235. return    CF    set on error
  1236.     AH    status
  1237. note 1) Releases ownership of a logical device for a process.
  1238.      2) A multitasking program manager would be expected to capture int 15h and
  1239.     provide the appropriate service.
  1240.      3) The BIOS default routine for this function simply returns with the CF
  1241.     clear and AH=00h.
  1242.  
  1243.  
  1244. Function 82h    Program Termination                 (AT, XT/286, PS/2)
  1245.     AH    82h
  1246.     BX    device ID
  1247. return    CF    set on error
  1248.     AH    status
  1249. note 1) Closes all logical devices opened with function 80h.
  1250.      2) A multitasking program manager would be expected to capture int 15h and
  1251.     provide the appropriate service.
  1252.      3) The BIOS default routine for this function simply returns with CF clear
  1253.     and AH=00h.
  1254.  
  1255.  
  1256. Function 83h    Event Wait           (AT, XT/286, Convertible, PS/2 50+)
  1257. entry    AH    83h
  1258.     AL    00h    to set interval
  1259.         01h    to cancel
  1260.     CX:DX    number of microseconds to wait (granularity is 976 microseconds)
  1261.     ES:BX    pointer to semaphore flag (bit 7 is set when interval expires)
  1262.         (pointer is to caller's memory) (some sources list bit 15 set)
  1263. return    CF    set (1) if function already busy
  1264. note 1) Requests setting of a semaphore after a specified interval or cancels a
  1265.     previous request.
  1266.      2) The calling program is responsible for clearing the semaphore before
  1267.     requesting this function.
  1268.      3) The actual duration of an event wait is always an integral multiple of
  1269.     976 microseconds. The CMOS date/clock chip interrupts are used to
  1270.     implement this function.
  1271.      4) Use of this function allows programmed, hardware-independent delays at
  1272.     a finer resolution than can be obtained through use of the MS-DOS Get
  1273.     Time function (int 21h/fn 2Ch) which returns time in hundredths of a
  1274.     second.
  1275.      5) CX:DX is a four-byte integer.
  1276.  
  1277.                                     -51-
  1278.  
  1279.  
  1280. Function 84h    Read Joystick Input Settings             (AT, XT/286, PS/2)
  1281. entry    AH    84h
  1282.     DX    00h    to read the current switch settings  (return in AL)
  1283.         01h    to read the resistive inputs
  1284. return    CF    set on error
  1285.     (fn 00h)
  1286.     AL    switch settings (bits 7-4)
  1287.     (fn 01h)
  1288.     AX    stick A (X) value
  1289.     BX    stick A (Y) value
  1290.     CX    stick B (X) value
  1291.     DX    stick B (Y) value
  1292. note 1) An error is returned if DX does not contain a valid subfunction number.
  1293.      2) If no game adapter is installed, all returned values are 00h.
  1294.      3) Using a 250K Ohm joystick, the potentiometer values usually lie within
  1295.     the range 0-416 (0000h-01A0h).
  1296.  
  1297.  
  1298. Function 85h    System Request (SysReq) Key Pressed       (except PC, PCjr, XT)
  1299. entry    AH    85h
  1300.     AL    00h     key pressed
  1301.         01h     key released
  1302. return    CF    set on error
  1303.     AH    error code
  1304. note 1) Called by BIOS keyboard decode routine when the SysReq key is detected.
  1305.      2) The BIOS handler for this call is a dummy routine that always returns a
  1306.     success status unless called with an invalid subfunction number in AL.
  1307.      3) A multitasking program manager would be expected to capture int 15h so
  1308.     that it can be notified when the user strikes the SysReq key.
  1309.  
  1310.  
  1311. Function 86h    Delay                      (except PC, PCjr, XT)
  1312.     AH    86h
  1313.     CX:DX    4-byte integer, number of microseconds to wait
  1314. return    CF    clear    after wait elapses
  1315.     CF    set    immediately due to error
  1316. note 1) Suspends the calling program for a specified interval in microseconds.
  1317.      2) The actual duration of the wait is always an integral multiple of 976
  1318.     microseconds.
  1319.      3) Use of this function allows programmed, hardware-independent delays at
  1320.     a finer resolution than can be obtained through use of the MS-DOS Get
  1321.     Time function (int 21h fn 2Ch) which returns time in hundredths of a
  1322.     second).
  1323.  
  1324.  
  1325. Function 87h    Memory Block Move            (2-3-486 machines only)
  1326.     AH    87h
  1327.     CX    number of words to move
  1328.     ES:SI    pointer to Global Descriptor Table (GDT)
  1329.         offset 00h-0Fh    reserved, set to zero
  1330.                00h    null descriptor
  1331.                08h    uninitialized, will be made into GDT descriptor
  1332.                10h-11h    source segment length in bytes
  1333.                 (2*CX-1 or greater)
  1334.                12h-14h    24-bit linear source address
  1335.                15h    access rights byte (always 93h)
  1336.                16h-17h    reserved, set to zero
  1337.                18h-19h    destination segment length in bytes
  1338.                 (2*CX-1 or greater)
  1339.                1Ah-1Ch    24-bit linear destination address
  1340.                1Dh    access rights byte (always 93h)
  1341.                1Eh-2Fh    reserved, set to zero
  1342.                20h    uninitialized, used by BIOS
  1343.                28h    uninitialized, will be made into SS descriptor
  1344.  
  1345.                                     -52-
  1346.  
  1347.  
  1348. return    CF    set on error
  1349.     AH    status
  1350.         00h    source copied into destination
  1351.         01h    parity error
  1352.         02h    exception interrupt error
  1353.         03h    address line 20 gating failed
  1354. note 1) The GDT table is composed of six 8-byte descriptors to be used by the
  1355.     CPU in protected mode. The four descriptors in offsets 00h-0Fh and
  1356.     20h-2Fh are filled in by the BIOS before the CPU mode switch.
  1357.      2) The addresses used in the descriptor table are linear (physical)
  1358.     24-bit addresses in the range 000000h-0FFFFFFh - not segments and
  1359.     offsets - with the least significant byte at the lowest address and the
  1360.     most significant byte at the highest address.
  1361.      3) Interrupts are disabled during this call; use may interfere with the
  1362.     operation of comm programs, network drivers, or other software that
  1363.     relies on prompt servicing of hardware interrupts.
  1364.      4) This call is not valid in the OS/2 Compatibility Box.
  1365.      5) This call will move a memory block from any real or protected mode
  1366.     address to any other real or protected mode address.
  1367.  
  1368.  
  1369. Function 88h    Get Extended Memory Size           (AT, XT/286, PS/2)
  1370. entry    AH    88h
  1371. return    AX    number of contiguous 1K blocks of extended memory starting at
  1372.         address 1024k
  1373. note    This call will not work in the OS/2 Compatibility Box.
  1374.  
  1375.  
  1376. Function 89h    Switch Processor to Protected Mode          (AT, XT/286, PS/2)
  1377. entry    AH    89h
  1378.     BH    interrupt number for IRQ0, written to ICW2 of 8259 PIC #1
  1379.         (must be evenly divisible by 8, determines IRQ0-IRQ7)
  1380.     BL    interrupt number for IRQ8, written to ICW2 of 8259 PIC #2
  1381.         (must be evenly divisible by 8, determines IRQ8-IRQ15)
  1382.     ES:SI    pointer to 8-entry Global Descriptor Table for protected mode:
  1383.         offset    00h    null descriptor, initialized to zero
  1384.             08h    GDT descriptor
  1385.             10h    IDT (Interrupt Descriptor Table) descriptor
  1386.             18h    DS, user's data segment
  1387.             20h    ES, user's extra segment
  1388.             28h    SS, user's stack segment
  1389.             30h    CS, user's code segment
  1390.             38h    uninitialized, used to build descriptor for
  1391.                 BIOS code segment
  1392. return    CF    set on error
  1393.         AH    0FFh  error enabling address line 20
  1394.     CF    clear    function successful (CPU is in protected mode)
  1395.         AH    00h
  1396.         CS    user-defined selector
  1397.         DS    user-defined selector
  1398.         ES    user-defined selector
  1399.         SS    user-defined selector
  1400. note    The user must initialize the first seven descriptors; the eighth is
  1401.     filled in by the BIOS to provide addressability for its own execution.
  1402.     The calling program may modify and use the eighth descriptor for any
  1403.     purpose after return from this function call.
  1404.  
  1405.                                     -53-
  1406.  
  1407.  
  1408. Function 90h    Device Busy Loop             (except PC, PCjr, XT)
  1409. entry    AH    90h
  1410.     AL    predefined device type code:
  1411.         00h    disk                     (may timeout)
  1412.         01h    diskette                 (may timeout)
  1413.         02h    keyboard                 (no timeout)
  1414.         03h    PS/2 pointing device             (may timeout)
  1415.         80h    network
  1416.                                  (no timeout)
  1417.         0FCh    hard disk reset (PS/2)             (may timeout)
  1418.         0FDh    diskette motor start             (may timeout)
  1419.         0FEh    printer                  (may timeout)
  1420.     ES:BX    pointer to request block for type codes 80h through 0FFh
  1421.         (for network adapters ES:BX is a pointer to network control
  1422.         block)
  1423. return    CF    1 (set) if wait time satisfied
  1424.         0 (clear) if driver must perform wait
  1425. note 1) Used by NETBIOS.
  1426.      2) Generic type codes are allocated as follows:
  1427.     00h-7Fh   non-reentrant devices; OS must arbitrate access
  1428.           serially reusable devices
  1429.     80h-0BFh  reentrant devices; ES:BX points to a unique control block
  1430.     0C0h-0FFh wait-only calls, no complementary POST int 15/fn 91h call
  1431.      3) Invoked by the BIOS disk, printer, network, and keyboard handlers prior
  1432.     to performing a programmed wait for I/O completion.
  1433.      4) A multitasking program manager would be expected to capture int 15h/
  1434.     fn 90h so that it can dispatch other tasks while I/O is in progress.
  1435.      5) The default BIOS routine for this function simply returns with the CF
  1436.     clear and AH=00h.
  1437.  
  1438.  
  1439. Function 91h    Interrupt Completed            (AT, XT/286, PS/2 50+)
  1440. entry    AH    91h
  1441.     AL    type code (see AH=90h above)
  1442.         00h-7Fh  serially reusable devices
  1443.         80h-0BFh reentrant devices
  1444.     ES:BX    pointer to request block for type codes 80h through 0BFh
  1445. return    AH     00h
  1446. note 1) Used by NETBIOS.
  1447.      2) Invoked by the BIOS disk network, and keyboard handlers to signal that
  1448.     I/O is complete and/or the device is ready.
  1449.      3) Predefined device types that may use Device POST are:
  1450.     00H  disk            (may timeout)
  1451.     01H  floppy disk        (may timeout)
  1452.     02H  keyboard            (no timeout)
  1453.     03H  PS/2 pointing device   (may timeout)
  1454.     80H  network            (no timeout)
  1455.      4) The BIOS printer routine does not invoke this function because printer
  1456.     output is not interrupt driven.
  1457.      5) A multitasking program manager would be expected to capture int 15h/
  1458.     fn 91h so that it can be notified when I/O is completed and awaken the
  1459.     requesting task.
  1460.      6) The default BIOS routine for this function simply returns with the CF
  1461.     flag clear and AH=00h.
  1462.  
  1463.                                     -54-
  1464.  
  1465.  
  1466. Function 0C0h    Get System Configuration      (XT after 1/10/86, PC Convertible,
  1467.                            XT/286, AT, PS/2)
  1468. entry    AH    0C0h
  1469. return    CF    set    if BIOS doesn't support call
  1470.     ES:BX    pointer to ROM system descriptor table
  1471.       bytes 00h-01h number of bytes in the following table (norm. 16 bytes)
  1472.         02h    system ID byte; see Chapter 2 for interpretation
  1473.         03h    secondary ID distingushes between AT and XT/286, etc.
  1474.         04h    BIOS revision level, 0 for 1st release, 1 for 2nd, etc.
  1475.         05h    feature information byte
  1476.            bits 7    DMA channel 3 used by hard disk BIOS
  1477.             6    second 8259 installed (cascaded IRQ2)
  1478.             5    realtime clock installed
  1479.             4    kbd intrcpt:int 15h, fn 04h called upon int 09h
  1480.             3    wait for external event supported (int 15fn41)
  1481.                  used on Convertible; reserved on PS/2 systems
  1482.             2    extended BIOS area allocated at 640k
  1483.             1    bus is Micro Channel instead of PC
  1484.             0    reserved
  1485.         06h    unknown (set to 0) (reserved by IBM)
  1486.         07h    unknown (set to 0) (reserved by IBM)
  1487.         08h    unknown (set to 0)
  1488.         09h    unknown (set to 0) (Award copyright here)
  1489. note 1) Int 15h is also used for the Multitask Hook on PS/2 machines. No
  1490.     register settings availible yet.
  1491.      2) The 1/10/86 XT BIOS returns an incorrect value for the feature byte.
  1492.  
  1493.  
  1494. Function 0C1h    Return Extended BIOS Data Area Segment Address           (PS/2)
  1495. entry    AH    0C1h
  1496. return    CF    set on error
  1497.     ES    segment of XBIOS data area
  1498. note 1) The XBIOS Data Area is allocated at the high end of conventional memory
  1499.     during the POST (Power-On-Self-Test) sequence.
  1500.      2) The word at 0040:0013h (memory size) is updated to reflect the reduced
  1501.     amount of memory available for DOS and application programs.
  1502.      3) The 1st byte in the XBIOS Data Area is initialized to its length in K.
  1503.      4) A program can determine whether the XBIOS Data Area exists by using
  1504.     int 15h/fn 0C0h.
  1505.  
  1506.  
  1507. Function 0C2h    Pointing Device BIOS Interface        (DesQview 2.x)    (PS/2)
  1508. entry    AH    0C2h
  1509.     AL    00h    enable/disable pointing device
  1510.             BH    00h    disable
  1511.                 01h    enable
  1512.         01h    reset pointing device
  1513.              Resets the system's mouse or other pointing device,
  1514.             sets the sample rate, resolution, and other
  1515.             characteristics to their default values.
  1516.             return    BH    device ID (0=first)
  1517.             note 1) After a reset operation, the state of the
  1518.                  pointing device is as follows:
  1519.                  disabled;
  1520.                  sample rate at 100 reports per second;
  1521.                  resolution at 4 counts per millimeter;
  1522.                  scaling at 1 to 1.
  1523.                  2) The data package size is unchanged by this fn.
  1524.                  3) Apps can use the fn 0C2h subfunctions to
  1525.                 initialize the pointing device to other parms,
  1526.                 then enable the device with fn 00h.
  1527.                  4) BL is altered on return.
  1528.  
  1529.                                     -55-
  1530.  
  1531.  
  1532.         02h    set sampling rate
  1533.             BH    00h    10/second
  1534.                 01h    20/second
  1535.                 02h    40/second
  1536.                 03h    60/second
  1537.                 04h    80/second
  1538.                 05h    100/second  (default)
  1539.                 06h    200/second
  1540.         03h    set pointing device resolution
  1541.             BH    00h    one count per mm
  1542.                 01h    two counts per mm
  1543.                 02h    four counts per mm  (default)
  1544.                 03h    eight counts per mm
  1545.         04h    get pointing device type
  1546.             return    BH    ID code for the mouse or other pointing
  1547.                     device.
  1548.         05h    initialize pointing device interface
  1549.              Sets the data package size for the system's mouse or
  1550.             other pointing device, and initializes the resolution,
  1551.             sampling rate, and scaling to their default values.
  1552.             BH    data package size (1 - 8 bytes)
  1553.             note    After this operation, the state of the pointing
  1554.                 device is as follows:
  1555.                 a) disabled;
  1556.                 b) sample rate at 100 reports per second;
  1557.                 c) resolution at 4 counts per millimeter;
  1558.                 d) scaling set at 1 to 1.
  1559.         06h    get status or set scaling factor
  1560.              Returns the current status of the system's mouse or
  1561.             other pointing device or sets the device's scaling
  1562.             factor.
  1563.             BH    00h    return device status
  1564.                 return    BL    status byte
  1565.                   bits    0    set if right button pressed
  1566.                     1    reserved
  1567.                     2    set if left button pressed
  1568.                     3    reserved
  1569.                     4    0    1:1 scaling
  1570.                         1    2:1 scaling
  1571.                     5    0    device disabled
  1572.                         1    device enabled
  1573.                     6    0    stream mode
  1574.                         1    remote mode
  1575.                     7    reserved
  1576.                     CL    resolution
  1577.                         00h    1 count per millimeter
  1578.                         01h    2 counts per millimeter
  1579.                         02h    4 counts per millimeter
  1580.                         03h    8 counts per millimeter
  1581.                     DL    sample rate (hex count)
  1582.                         0Ah    10 reports per second
  1583.                         14h    20 reports per second
  1584.                         28h    40 reports per second
  1585.                         3Ch    60 reports per second
  1586.                         50h    80 reports per second
  1587.                         64h    100 reports per second
  1588.                         0C8h    200 reports per second
  1589.                 01h    set scaling at 1:1
  1590.                 02h    set scaling at 2:1
  1591.         07h    set pointing device handler address
  1592.              Notifies BIOS pointing device driver of the address
  1593.             for a routine to be called each time pointing device
  1594.             data is available.
  1595.             ES:BX    address user device handler
  1596.             return    AL    00h
  1597.  
  1598.                                     -56-
  1599.  
  1600.  
  1601. return    CF    set on error
  1602.     AH    status
  1603.         00h    successful
  1604.         01h    invalid function
  1605.         02h    invalid input
  1606.         03h    interface error
  1607.         04h    need to resend
  1608.         05h    no device handler installed
  1609. note 1) The values in BH for those functions that take it as input are stored
  1610.     in different locations for each subfunction.
  1611.      2) The user's handler for pointing device data is entered via a far call
  1612.     with four parameters on the stack:
  1613.     SS:SP+0Ah    status
  1614.     SS:SP+08h    x coordinate
  1615.     SS:SP+06h    y coordinate
  1616.     SS:SP+04h    z coordinate (always 0)
  1617.      The handler must exit via a far return without removing the parameters
  1618.     from the stack.
  1619.      3) The status parameter word passed to the user's handler is interpreted
  1620.     as follows:
  1621.     bits    0    left button pressed
  1622.         1    right button pressed
  1623.         2-3    reserved
  1624.         4    sign of x data is negative
  1625.         5    sign of y data is negative
  1626.         6    x data has overflowed
  1627.         7    y data has overflowed
  1628.         8-0Fh    reserved
  1629.  
  1630.  
  1631. Function 0C3h    Enable/Disable Watchdog Timeout         (PS/2 50+)
  1632. entry    AH    0C3h
  1633.     AL    00h    disable
  1634.         01h    enable
  1635.             BX    timer counter
  1636. return    CF    set on error
  1637. note 1) The watchdog timer generates an NMI.
  1638.      2) This would be subject to protection with a real OS so temporary masters
  1639.     would not be able to seize the bus forever.
  1640.  
  1641.  
  1642. Function 0C4h    Programmable Option Select            (PS/2 50+)
  1643. entry    AH    04Ch
  1644.     AL    00h    return base POS register address
  1645.         01h    enable slot
  1646.             BL    slot number
  1647.         02h    enable adapter
  1648. return    CF    set on error
  1649.     DX    base POS register address (if function 00h)
  1650. note 1) Returns the base Programmable Option Select register address, enables
  1651.     a slot for setup, or enables an adapter.
  1652.      2) Valid on machines with Micro Channel Architecture (MCA) bus only.
  1653.      3) After a slot is enabled with fn 01h, specific information can be
  1654.     obtained for the adapter in that slot by performing port input
  1655.     operations:
  1656.     Port    Function
  1657.     100h    MCA ID (low byte)
  1658.     101h    MCA ID (high byte)
  1659.     102h    Option Select Byte 1
  1660.         bit 0    0    if disabled
  1661.             1    if enabled
  1662.     103h    Option Select Byte 2
  1663.     104h    Option Select Byte 3
  1664.     105h    Option Select Byte 4
  1665.         bits 6-7 are channel check indicators
  1666.     106h    Subaddress Extension (low byte)
  1667.     107h    Subaddress Extension (high byte)
  1668.  
  1669.                                     -57-
  1670.  
  1671. Function 0DEh    DesQview Services                  (DesQview)
  1672. entry    AH    0DEh
  1673.     AL    00h    Get Program Name
  1674.             return    AX    offset into DESQVIEW.DVO of current
  1675.                     program's record:
  1676.                     byte    length of name
  1677.                       n bytes    name
  1678.                       2 bytes    keys to invoke program (second
  1679.                         = 00h if only one key used)
  1680.                     word    ? (normally 0)
  1681.                     byte    end flag: 00h for all but last
  1682.                         entry, which is 0FFh
  1683.         01h    Update "Open Window" Menu
  1684.             return    none
  1685.             note    Reads DESQVIEW.DVO, disables Open menu if file
  1686.                 not in current directory
  1687.         02h    unimplemented in DV 2.0x
  1688.             return    nothing (NOP in DV 2.0x)
  1689.         03h    unimplemented in DV 2.0x
  1690.             return    nothing (NOP in DV 2.0x)
  1691.         04h    Get Available Common Memory
  1692.             return    BX    bytes of common memory available
  1693.                 CX    largest block available
  1694.                 DX    total common memory in bytes
  1695.         05h    Get Available Conventional Memory
  1696.             return    BX    K of memory available
  1697.                 CX    largest block available
  1698.                 DX    total conventional memory in K
  1699.         06h    Get Available Expanded Memory
  1700.             return    BX    K of expanded memory available
  1701.                 CX    largest block available
  1702.                 DX    total expanded memory in K
  1703.         07h    APPNUM    Get Current Program's Number
  1704.             return    AX    number of program as it appears on the
  1705.                     "Switch Windows" menu
  1706.         08h    GET (unknown)
  1707.             return    AX    00h    unknown
  1708.                     01h    unknown
  1709.         09h    unimplemented in DV 2.00
  1710.             return    nothing (NOP in DV 2.00)
  1711.         0Ah    DBGPOKE Display Character on Status Line      (DV 2.0+)
  1712.             BL    character
  1713.             return    character displayed, next call will display in
  1714.                 next position (which wraps back to the start of
  1715.                 the line if off the right edge of screen)
  1716.             note 1) Displays character on bottom line of *physical*
  1717.                 screen, regardless of current size of window
  1718.                 (even entirely hidden)
  1719.                  2) Does not know about graphics display modes,
  1720.                 just pokes the characters into display memory
  1721.         0Bh    APILEVEL Define Minimum API Level Required    (DV 2.0+)
  1722.             BL    API level. A value higher than 02h pops up "You
  1723.                 need a newer version" error window in DV 2.00.
  1724.             BH    unknown
  1725.             return    AX    maximum API level?
  1726.         0Ch    GETMEM    Allocate "System" Memory          (DV 2.0+)
  1727.             BX    number of bytes
  1728.             return    ES:DI    pointer to allocated block
  1729.         0Dh    PUTMEM    Deallocate "System" Memory          (DV 2.0+)
  1730.             ES:DI    pointer to previously allocated block
  1731.             return    nothing
  1732.         0Eh    Find Mailbox by Name                  (DV 2.0+)
  1733.             ES:DI    pointer to name to find
  1734.             CX    length of name
  1735.             return    BX    00h    not found
  1736.                     01h    found
  1737.                 DS:SI    object handle
  1738.  
  1739.                                     -58-
  1740.  
  1741.  
  1742.         0Fh    Enable DesQview Extensions              (DV 2.0+)
  1743.             return    AX and BX destroyed (seems to be bug, weren't
  1744.                 saved & restored)
  1745.             note 1) Sends a manager stream with opcodes 0AEh, 0BDh,
  1746.                 and 0BFh to task's window
  1747.                  2) Enables an additional mouse mode
  1748.         10h    PUSHKEY  Put Key Into Keyboard Input Stream   (DV 2.0+)
  1749.             BH    scan code
  1750.             BL    character
  1751.             return    BX    unknown (sometimes, but not always,
  1752.                     same as BX passed in)
  1753.             note    A later read will get the keystroke as if it
  1754.                 had been typed by the user
  1755.         11h    Enable/Disable Auto Justification of Window   (DV 2.0+)
  1756.             BL    00h    viewport will not move automatically
  1757.                 nonzero viewport will move to keep cursor
  1758.                     visible
  1759.             return    none
  1760.         12h    unknown                       (DV 2.0+)
  1761.             BX    00h    clear something?
  1762.                 nonzero set something?
  1763.             return    none
  1764.  
  1765.  
  1766. ┌─────────────────────────────────────────────────────────────────────────────┐
  1767. │Interrupt 16h    Keyboard I/O                        3**9  │
  1768. └─────────────────────────────────────────────────────────────────────────────┘
  1769. (0:0058h)    Access the keyboard. Scancodes are found in Appendix 1. ASCII
  1770.         codes are found in Appendix 2.
  1771.  
  1772.         IBM's original keyboard layout is referred to as the 84-key
  1773.         or "old style". It has the function keys on the left and an
  1774.         embedded cursor/numeric keypad on the right. The 101-key "new
  1775.         style" or "enhanced" keyboard (such as used on the PS/2s) adds
  1776.         several keys. The early BIOS will not detect the new scancodes
  1777.         and the new BIOS for some reason added new function calls for
  1778.         this purpose instead of enhancing the old ones. This causes
  1779.         some hassle when writing programs which need to support both
  1780.         keyboards fully. Most programs limit themselves to the 84-key
  1781.         functions in the interest of backward compatibility.
  1782.  
  1783.  
  1784. Function  00h    Get Keyboard Input - read the next character in keyboard buffer,
  1785.         if no key ready, wait for one.
  1786. entry    AH    00h
  1787. return    AH    scan code
  1788.     AL    ASCII character
  1789. note 1) Removes keystroke from buffer (destructive read).
  1790.      2) Does not work with the extra keys on the 101-key "enhanced" keyboard.
  1791.  
  1792.  
  1793. Function  01h    Check Keystroke Buffer - Do Not Clear
  1794. entry    AH    01h
  1795. return    ZF    0 (clear) if character in buffer
  1796.         1 (set)   if no character in buffer
  1797.     AH    scan code of character (if ZF=0)
  1798.     AL    ASCII character if applicable
  1799. note 1) Keystroke is not removed from buffer. The same character and scan code
  1800.     will be returned by the next call to Int 16h/fn 00h.
  1801.      2) This call flushes the 101-key codes from the buffer if they precede
  1802.     an 84-key code.
  1803.  
  1804.                                     -59-
  1805.  
  1806. Function  02h    Shift Status - fetch bit flags indicating shift status
  1807. entry    AH    02h
  1808. return    AL    status byte (same as [0040:0017])
  1809.        bits 7    Insert on
  1810.         6    CapsLock on
  1811.         5    NumLock on
  1812.         4    ScrollLock on
  1813.         3    Alt key down
  1814.         2    Control key down
  1815.         1    Left shift (left caps-shift key) down
  1816.         0    Right shift (right caps-shift key) down
  1817. note    The Keyboard Flags Byte is stored in the BIOS Data Area at 0000:0417h.
  1818.  
  1819.  
  1820. Function 03h    Keyboard - Set Repeat Rate          (PCjr, AT, XT/286, PS/2)
  1821. entry    AH    03h
  1822.     AL    00h    reset typematic defaults             (PCjr)
  1823.         01h    increase initial delay                 (PCjr)
  1824.         02h    decrease repeat rate by 1/2             (PCjr)
  1825.         03h    increase both delays by 1/2             (PCjr)
  1826.         04h    turn off typematic                 (PCjr)
  1827.         05h    set typematic rate                 (AT, PS/2)
  1828.     BH    00h-03h for delays of 250ms, 500ms, 750ms, or 1 second
  1829.             0,0    250ms
  1830.             0,1    500ms
  1831.             1,0    750ms
  1832.             1,1    1 second
  1833.     BL    00h-1Fh for typematic rates of 30cps down to 2cps
  1834.             00000 30     01011 10.9   10101 4.5
  1835.             00001 26.7   01100 10      10110 4.3
  1836.             00010 24     01101 9.2      10111 4
  1837.             00011 21.8   01110 8.6      11000 3.7
  1838.             00100 20     01111 8      11001 3.3
  1839.             00101 18.5   10000 7.5      11010 3
  1840.             00110 17.1   10001 6.7      11011 2.7
  1841.             00111 16     10010 6      11100 2.5
  1842.             01000 15     10011 5.5      11101 2.3
  1843.             01001 13.3   10011 5.5      11110 2.1
  1844.             01010 12     10100 5      11111 2
  1845. return    nothing
  1846. note 1) Subfunction 05h is available on ATs with ROM BIOS dated 11/15/85 and
  1847.     later, the XT/286, and the PS/2.
  1848.      2) Subfunction 0 (Return to Default Keyboard State) restores the keyboard
  1849.     to its original state. The original state at power-on is typematic on,
  1850.     normal initial delay and normal typematic rate.
  1851.      3) Subfunction 1 (Increase Initial Delay) increases the delay between the
  1852.     first character typed and the burst of typematic characters.
  1853.      4) For Subfunctions 0 through 4, each time the typematic rate is changed,
  1854.     all previous states are removed.
  1855.  
  1856.  
  1857. Function 04h    Keyboard Click Toggle              (PCjr and Convertible)
  1858. entry    AH    04h
  1859.     AL    00h    for click off
  1860.         01h    for click on
  1861. return    nothing
  1862.  
  1863.  
  1864. Function 05h    Load Keyboard Buffer        (AT or PS/2 with enhanced kbd)
  1865. entry    AH    05h
  1866.     CH    scan code
  1867.     CL    ASCII character
  1868. return    CF    set on error
  1869.     AL    00h    success
  1870.         01h    if buffer full
  1871. note    Places a character and scan code at the end of the keyboard type-ahead
  1872.     buffer.
  1873.  
  1874.                                     -60-
  1875.  
  1876.  
  1877. Function 06h    Keyboard Buffer Write             (Fansi-Console to 2.00)
  1878. entry    AH    06h
  1879.     BX    extended key value to place in typeahead buffer
  1880. return    unknown
  1881. note    This call may be dropped since it now duplicates function 05h.
  1882.  
  1883.  
  1884. Function 07h    Change Shift Key Status          (Fansi-Console to 2.00)
  1885. entry    AH    07h
  1886.     AL    shift key status value
  1887. return    unknown
  1888. note    Status byte is same as function 02h.
  1889.  
  1890.  
  1891. Function 10h    Get Enhanced Keystroke And Read      (F11, F12 Enhanced Keyb'd)
  1892.         (XT/286, PS/2, AT with "Enhanced" keyboard)
  1893. entry    AH    10h
  1894. return    AH    scan code
  1895.     AL    ASCII character if applicable
  1896. note 1) Reads a character and scan code from the keyboard type-ahead buffer.
  1897.      2) Use this function for the enhanced keyboard instead of Int 16h fn 00h.
  1898.     It allows applications to obtain the scan codes for the additional F11,
  1899.     F12, and cursor control keys.
  1900.      3) This is the enhanced version of function 00h.
  1901.  
  1902.  
  1903. Function 11h    Check Enhanced Keystroke     (F11-F12 on enhanced keyboard)
  1904.         (XT/286, PS/2, AT with "Enhanced" keyboard)
  1905. entry    AH    11h
  1906. return    ZF    0    (clear) if key pressed
  1907.             AH    scan code
  1908.             AL    ASCII character if applicable
  1909.         1    if buffer is empty
  1910. note 1) Keystroke is not removed from buffer. The same char and scan code will
  1911.     be returned by the next call to Int 16h/fn 10h.
  1912.      2) Use this function for the enhanced keyboard instead of Int 16h/fn 00h.
  1913.     It allows applications to test for the additional F11, F12, and cursor
  1914.     control keys.
  1915.  
  1916.  
  1917. Function 12h    Extended Get Shift Status      (F11, F12 Enhanced keyboard)
  1918. entry    AH    12h
  1919. return    AX    status word
  1920.         AL bit    0    right Shift key depressed
  1921.             1    left Shift key depressed
  1922.             2    Control key depressed
  1923.             3    Alt key depressed
  1924.             4    ScrollLock state active
  1925.             5    NumLock state active
  1926.             6    CapsLock state active
  1927.             7    insert state is active
  1928.         AH bit    0    left Control key pressed
  1929.             1    left Alt key depressed
  1930.             2    right Control key pressed
  1931.             3    right Alt key depressed
  1932.             4    Scroll Lock key depressed
  1933.             5    NumLock key depressed
  1934.             6    CapsLock key depressed
  1935.             7    SysReq key depressed
  1936. note    Use this function for the enhanced keyboard instead of int 16h/fn 02h.
  1937.  
  1938.                                     -61-
  1939.  
  1940. Function  75h    Set Tick Count for Scanning      (pcAnywhere 2.00)
  1941. entry    AH    75h
  1942.     AL    tick count
  1943. return    none
  1944. note 1) Sets count of 55ms timer ticks between checks for new screen changes.
  1945.      2) pcAnywhere is a program that allows operation of a remote machine
  1946.     over a serial link.
  1947.  
  1948. Function  76h    Set Error Checking Mode       (pcAnywhere 2.00)
  1949. entry    AH    76h
  1950.     AL    error checking type
  1951.         00h    none
  1952.         01h    fast
  1953.         02h    slow
  1954. return    none
  1955.  
  1956. Function  77h    reserved              (pcAnywhere 2.00)
  1957. pcAnywhere API - reserved
  1958.  
  1959. Function  78h    Log Off               (pcAnywhere 2.00)
  1960. entry    AL    00h    wait for another call
  1961.         01h    exit but remain TSR
  1962.         02h    automatic mode - watches DTR
  1963. return    none
  1964.  
  1965. Function  79h    Installation Check          (pcAnywhere 2.00)
  1966. entry    AH    79h
  1967.     AL    00h    installation check
  1968. return    AX    0FFFFh    resident and active
  1969.         0FFFEh    resident but not active
  1970.         0FFFDh    resident TSR
  1971.         0FFFCh    automatic mode
  1972.         any other value - not resident
  1973.  
  1974. Function  7Ah    Cancel pcAnywhere Session      (pcAnywhere 2.00)
  1975. entry    AH    7Ah
  1976. return    none
  1977. note    Leaves pcAnywhere resident but unable to answer another call.
  1978.  
  1979. Function  7Bh    Enable/Disable Operation      (pcAnywhere 2.00)
  1980. entry    AH    7Bh
  1981.     AL    state
  1982.         00h    disabled
  1983.         01h    enabled
  1984. return    none
  1985. note    Remote screen is automatically refreshed when session is enabled.
  1986.  
  1987. Function  7Ch    Get Port Configuration          (pcAnywhere 2.00)
  1988. entry    AH    7Ch
  1989. return    AH    port number in binary (0-15)
  1990.     AL    baud rate
  1991.         00h    50
  1992.         01h    75
  1993.         02h    110
  1994.         03h    134.5
  1995.         04h    150
  1996.         05h    300
  1997.         06h    600
  1998.         07h    1200
  1999.         08h    1800
  2000.         09h    2000
  2001.         0Ah    2400
  2002.         0Bh    4800
  2003.         0Ch    7200
  2004.         0Dh    9600
  2005.         0Fh    19,200
  2006.  
  2007.                                     -62-
  2008. Function  7Dh    Get/Set Terminal Parameters      (pcAnywhere 2.00)
  2009. entry    AH    7Dh
  2010.     AL    00h    set parameters
  2011.         01h    get parameters
  2012.         02h    get configuration header and terminal parameters
  2013.     CX:DS    address of Terminal Parameter Block
  2014. return    AL    00h    nothing
  2015.         01h    current Terminal Parameter Block in CX:DS
  2016.         02h    configuration header and Terminal Parameter Block
  2017.             in CX:DS
  2018. note    Terminal Parameter Block format:   (1152 bytes) (decimal)
  2019.     384 bytes  CRT Control Information
  2020.         bytes    function
  2021.         1-8    cursor up
  2022.            9-16    cursor down
  2023.           17-24    cursor left
  2024.           25-32    cursor right
  2025.           33-40    cursor home
  2026.           41-48    clear screen
  2027.           49-56    clear to end of line
  2028.           57-64    clear to end of page
  2029.           65-72    insert line
  2030.           73-80    delete line
  2031.           81-88    insert character
  2032.           89-96    delete character
  2033.          97-104    cursor position lead in
  2034.         105-112    between row and column
  2035.         113-120    after cursor position
  2036.         121-128    CRT initialization
  2037.     256 bytes  Character Translation Table
  2038.         translates ASCII characters from host. Normally changes IBM
  2039.         graphics characters to other displayable symbols
  2040.     512 bytes  keyboard sequences
  2041.         641-644    cursor up
  2042.         645-648    cursor down
  2043.         649-652    cursor left
  2044.         653-656    cursor right
  2045.         657-660    home
  2046.         661-664    end
  2047.         665-668    PgUp
  2048.         669-672    PgDn
  2049.         673-676    insert
  2050.         677-680    delete
  2051.         681-684    control-home
  2052.         685-688    control-end
  2053.         689-692    control-PgUp
  2054.         693-696    control-PgDn
  2055.         697-700    escape
  2056.         701-740    F1...F10
  2057.         741-780    sF1...sF10
  2058.         781-820    ^F1...^F10
  2059.         821-860    aF1...aF10
  2060.         861-964    alt A-Z
  2061.        965-1004    alt 0-9
  2062.       1005-1008    alt =
  2063.       1009-1012    alt -
  2064.       1013-1016    print screen
  2065.       1017-1020    ctrl-left arrow
  2066.       1021-1024    ctrl-right arrow
  2067.       1025-1120    reserved
  2068.       1121-1124    begin conv. mode
  2069.       1125-1128    remote printing off
  2070.       1129-1132    remote printing on
  2071.       1133-1136    backspace
  2072.       1137-1140    refresh screen
  2073.       1141-1144    send next code
  2074.       1145-1148    display top 24 lines
  2075.       1149-1152    display bottom 24 lines
  2076.  
  2077.                                     -63-
  2078.  
  2079.  
  2080. Function  7Eh    Serial I/O Through pcAnywhere Port   (pcAnywhere 2.00)
  2081. entry    AH    7Eh
  2082.     AL    I/O function
  2083.         01h    get port input status
  2084.         02h    get port input character
  2085.         03h    output character
  2086.         04h    hang up phone
  2087.     CX    ASCII character to output (fn 03h)
  2088. return    (if AL=01h)
  2089.     AX    00h    no character ready
  2090.         01h    character is available
  2091.     (if AL=02h)
  2092.     AL    ASCII code received
  2093.  
  2094.  
  2095. Function  7Fh    Set Keyboard/Screen Mode        (pcAnywhere 2.00)
  2096. entry    AH    7Fh
  2097.     AL    parameters
  2098.         00h    enable remote keyboard only  |
  2099.         01h    enable host keyboard only    |    keyboard group
  2100.         02h    enable both keyboards         |
  2101.  
  2102.         08h    display top 24 lines         |    screen group
  2103.         09h    display bottom 24 lines      |
  2104.  
  2105.         10h    Hayes modem             |
  2106.         11h    other modems             |    modem group
  2107.         12h    direct connect             |
  2108.  
  2109.  
  2110. Function 0EDh    Borland Turbo Lightning API  (partial)
  2111. entry    AH    0EDh
  2112.     BH    0EDh
  2113.     BL    function
  2114.         00h    installation check
  2115.         02h    pointer to Lightning internal data structure lobyte
  2116.         03h    pointer to Lightning internal data structure hibyte
  2117.         04h    load auxiliary dictionary
  2118.         06h    autoproof mode
  2119.         0Fh    get number of substitutions (segment)
  2120.     DS:DI    pointer to string to be processed
  2121. return    AX    error code (unknown)
  2122.  
  2123.  
  2124. Function 0F0h    Set CPU speed                      (Compaq 386)
  2125. entry    AH    0F0h    set speed
  2126.     AL    speed
  2127.         00h    equivalent to 6 mHz 80286 (COMMON)
  2128.         01h    equivalent to 8 mHz 80286 (FAST)
  2129.         02h    full 16 mHz (HIGH)
  2130.         03h    toggles between 8 mHz-equivalent and speed set by
  2131.             system board switch (AUTO or HIGH)
  2132.         04h-07h unknown
  2133.         08h    full 16 mHz except 8 mHz-equivalent during floppy disk
  2134.             access
  2135.         09h    specify speed directly
  2136.             CX    speed value, 1 (slowest) to 50 (full), 3 ~=8088
  2137. return    none?
  2138. note 1) Used by Compaq DOS MODE command.
  2139.  
  2140.                                     -64-
  2141.  
  2142.  
  2143. Function 0F1h    Read Current CPU Speed                  (Compaq 386)
  2144. entry    AH    0F1h
  2145. return    AL    speed code (see function 0F0h above)
  2146.         if AL=09h, CX=speed code
  2147.  
  2148.  
  2149. Function 0F2h    Determine Attached Keyboard Type          (Compaq 386)
  2150. entry    AH    0F2h
  2151. return    AL    type
  2152.         00h    if 11-bit AT keyboard is in use
  2153.         01h    if 9-bit PC keyboard is in use
  2154.  
  2155.  
  2156. Function 0FFh    PC-Tools API
  2157. entry    AH    0FFh
  2158. other parameters unknown
  2159. note    PC-Tools is a Swiss-army-knife software package with an editor, DOS
  2160.     shell, cache, disk optimizer, and several other functions from Central
  2161.     Point Software.
  2162.  
  2163.  
  2164.  
  2165. ┌─────────────────────────────────────────────────────────────────────────────┐
  2166. │Interrupt 17h    Printer                         3**10 │
  2167. └─────────────────────────────────────────────────────────────────────────────┘
  2168. (0:005Ch)    access the parallel printer(s)
  2169.         AH is changed. All other registers left alone.
  2170.  
  2171. Function  00h    Print Character/send AL to printer DX (0, 1, or 2)
  2172. entry    AH    00h
  2173.     AL    ASCII character code
  2174.     DX    printer to be used
  2175.         00h    PRN or LPT1
  2176.         01h    LPT2
  2177.         02h    LPT3
  2178. return    AH    status byte
  2179.        bits 0    time out
  2180.         1    unused
  2181.         2    unused
  2182.         3    I/O error
  2183.         4    printer selected
  2184.         5    out of paper
  2185.         6    acknowledge
  2186.         7    not busy
  2187.  
  2188.  
  2189. Function 01h    Initialize Printer - set init line low, send 0Ch to printer DX
  2190. entry    AH    01h
  2191.     DX    printer port to be initialized (0,1,2)
  2192. return    status as below
  2193.  
  2194.                                     -65-
  2195.  
  2196.  
  2197. Function  02h    Printer Status - read status of printer DX into AH
  2198. entry    AH    02h
  2199.     DX    printer port to be used (0,1,2)
  2200. return    AH    status byte
  2201.        bits 7    0    busy/paused: the printer cannot immediately
  2202.                 take more data because it is in the middle of
  2203.                 accepting a character, printing a line, is
  2204.                 offline, or it is in error status.
  2205.             1    ready
  2206.         6   ACKnowledge line toggled: reflects the state of the ACK
  2207.             line on the printer port at the moment the status was read.
  2208.             ACK is a strobe: it goes low for a very short time (12
  2209.             microseconds on an Epson) when the printer is ready for
  2210.             another character. As far as printer status is concerned,
  2211.             this is useless; it's only useful for something like an
  2212.             interrupt-driven interface. Most of the time, you'll see
  2213.             ACK high (bit 6 on), but occasionally, if you check status
  2214.             just after sending a character, you might see it low.
  2215.             ACK is low when the printer is powered off.
  2216.         5   out-of-paper line toggled
  2217.         4   printer selected: printer is selected/ready/online. There
  2218.             is usually a button on the printer to control this.
  2219.         3   I/O error: offline, out of paper or other error condition
  2220.             such as out of ribbon.
  2221.         2   unused
  2222.         1   unused
  2223.         0   timeout error: printer failed to send ACK and drop busy
  2224.             after being sent a character.
  2225. note 1) You can expect to see these states in a properly functioning printer:
  2226.     Normal              Offline             Power off
  2227.     ======              =======             =========
  2228.     not busy/paused       busy/paused         busy/paused
  2229.     not out of paper      not out of paper         not out of paper
  2230.     selected/online       not selected/online    not selected/online
  2231.     not I/O error          I/O error (usually)    I/O error
  2232.     not timeout error     not timeout error      not timeout error
  2233.      2) Not all printers return the status codes properly. That's OK, not all
  2234.     clone BIOS do it right either. If your program depends on the return
  2235.     codes, you might want to make the code easily patched or configured
  2236.     for nonstandard hardware.
  2237.  
  2238.  
  2239.  
  2240.  
  2241. ┌─────────────────────────────────────────────────────────────────────────────┐
  2242. │Interrupt 18h    ROM BASIC                        3**11 │
  2243. └─────────────────────────────────────────────────────────────────────────────┘
  2244. (0:0060h)    Execute ROM BASIC at address 0F600h:0000h
  2245. entry    no parameters used
  2246. return    jumps into ROM BASIC on IBM systems
  2247. note 1) Often reboots a compatible.
  2248.      2) Used by Turbo C 1.5. 2.0 and later do not use it.
  2249.      3) On IBM systems, this interrupt is called if disk boot failure occurs.
  2250.      4) Video interrupt on DEC Rainbow.
  2251.      5) Digital Research's ROM-based implementation of DR-DOS uses int 18h as
  2252.     the initial entry vector into the operating system code. Note that
  2253.     some clone BIOSes may not properly implement int 18h in the ROM and
  2254.     use of DR-DOS ROMs may not always work.
  2255.  
  2256.                                     -66-
  2257.  
  2258. ┌─────────────────────────────────────────────────────────────────────────────┐
  2259. │Interrupt 19h    Bootstrap Loader / Extended Memory VDISK ID        3**12 │
  2260. └─────────────────────────────────────────────────────────────────────────────┘
  2261. (0:0064h)
  2262. entry    no parameters used
  2263. return    none
  2264. note 1) Reads track 0, sector 1 into address 0000h:7C00h, then transfers
  2265.     control to that address. If no diskette drive available, transfers to
  2266.     ROM-BASIC via int 18h or displays loader error message.
  2267.      2) Causes reboot of disk system if invoked while running. (no memory test
  2268.     performed).
  2269.      3) If location 0000:0472h does not contain the value 1234h, a memory test
  2270.     (POST) will be performed before reading the boot sector.
  2271.      4) VDISK from DOS 3.0+ traps this vector to determine when the CPU has
  2272.     shifted from protected mode to real mode. A detailed discussion can
  2273.     be found by Ray Duncan in PC Magazine, May 30, 1989.
  2274.      5) Reportedly, some versions of DOS 2.x and all versions of DOS 3.x+
  2275.     intercept int 19h in order to restore some interrupt vectors DOS takes
  2276.     over, in order to put the machine back to a cleaner state for the
  2277.     reboot, since the POST will not be run on the int 19h. These vectors
  2278.     are reported to be: 02h, 08h, 09h, 0Ah, 0Bh, 0Ch, 0Dh, 0Eh, 70h, 72h,
  2279.     73h, 74h, 75h, 76h, and 77h. After restoring these, it restores the
  2280.     original int 19h vector and calls int 19h.
  2281.      6) The system checks for installed ROMs by searching memory from 0C000h to
  2282.     the beginning of the BIOS, in 2k chunks. ROM memory is identified if it
  2283.     starts with the word 0AA55h. It is followed a one byte field length of
  2284.     the ROM (divided by 512). If ROM is found, the BIOS will call the ROM
  2285.     at an offset of 3 from the beginning. This feature was not supported in
  2286.     the earliest PC machines. The last task turns control over to the
  2287.     bootstrap loader (assuming the floppy controller is operational).
  2288.  
  2289.  
  2290.  
  2291. ┌─────────────────────────────────────────────────────────────────────────────┐
  2292. │Interrupt 1Ah    Time of Day                        3**13 │
  2293. └─────────────────────────────────────────────────────────────────────────────┘
  2294. (0:0068h)    1) Accesses the PC internal clock.
  2295.          2) This interrupt is not supported on some machines, such as
  2296.         the HP150 PC.
  2297.          3) Some "turbo" BIOSes run the clock slower than normal in order
  2298.         to throw off benchmark software, which usually uses int 1Ah
  2299.         for timekeeping.
  2300.  
  2301.  
  2302. Function 00h    Read System Timer Tick Counter               (except PC)
  2303. entry    AH    00h
  2304. return    AL    00h    if clock was read or written (via AH=0,1) within the
  2305.             current 24-hour period.
  2306.         <>0    midnight was passed since last read
  2307.     CX:DX    32-bit tick count (high 16 bits in CX)
  2308. note 1) The returned value is the cumulative number of clock ticks since
  2309.     midnight. There are 18.2 clock ticks per second, or one every 54.92ms.
  2310.     When the counter reaches 1,573,040, it is cleared to zero, and the
  2311.     rollover flag is set.
  2312.      2) The rollover flag is cleared by this function call, so the flag will
  2313.     only be returned nonzero once per day.
  2314.      3) Int 1Ah/fn 01h can be used to set the counter to an arbitrary 32 bit
  2315.     value.
  2316.  
  2317.                                     -67-
  2318.  
  2319.  
  2320. Function 01h    Set Clock Tick Counter Value            (except PC)
  2321. entry    AH    01h
  2322.     CX:DX    32-bit high word/low word count of timer ticks
  2323. return    none
  2324. note 1) The clock ticks are incremented by timer interrupt at 18.2065 times
  2325.     per second or 54.9254 milliseconds/count. Therefore:
  2326.         counts per second   18        (12h)
  2327.         counts per minute   1092    (444h)
  2328.         counts per hour     65543   (10011h)
  2329.         counts per day        1573040 (1800B0h)
  2330.      2) The counter is zeroed when system is rebooted.
  2331.      3) Stores a 32-bit value in the clock tick counter.
  2332.      4) The rollover flag is cleared by this call.
  2333.  
  2334.  
  2335. Function 02h    Read Real Time Clock Time            (AT and after)
  2336. entry    AH    02h
  2337. return    CH    hours in BCD
  2338.     CL    minutes in BCD
  2339.     DH    seconds in BCD
  2340.     DL    00h    standard time
  2341.         01h    daylight savings time
  2342.     CF    0    if clock running
  2343.         1    if clock not operating
  2344. note    Reads the current time from the CMOS time/date chip.
  2345.  
  2346.  
  2347. Function 03h    Set Real Time Clock Time            (AT and after)
  2348. entry    AH    03h
  2349.     CH    hours in BCD
  2350.     CL    minutes in BCD
  2351.     DH    seconds in BCD
  2352.     DL    0 (clear) if standard time
  2353.         1 (set)   if daylight savings time option
  2354. return    none
  2355. note    Sets the time in the CMOS time/date chip.
  2356.  
  2357.  
  2358. Function 04h    Read Real Time Clock Date            (AT and after)
  2359. entry    AH    04h
  2360. return    CH    century in BCD (19 or 20)
  2361.     CL    year in BCD
  2362.     DH    month in BCD
  2363.     DL    day in BCD
  2364.     CF    0 (clear) if clock is running
  2365.         1 (set)   if clock is not operating
  2366. note    Reads the current date from the CMOS time/date chip.
  2367.  
  2368.  
  2369. Function 05h    Set Real Time Clock Date            (AT and after)
  2370. entry    AH    05h
  2371.     CH    century in BCD (19 or 20)
  2372.     CL    year in BCD
  2373.     DH    month in BCD
  2374.     DL    day in BCD
  2375. return    none
  2376. note    Sets the date in the CMOS time/date chip.
  2377.  
  2378.                                     -68-
  2379.  
  2380.  
  2381. Function 06h    Set Real Time Clock Alarm            (AT and after)
  2382. entry    AH    06h
  2383.     CH    hours in BCD
  2384.     CL    minutes in BCD
  2385.     DH    seconds in BCD
  2386. return    CF    set if alarm already set or clock inoperable
  2387. note 1) Sets alarm in the CMOS date/time chip. Int 4Ah occurs at specified
  2388.     alarm time every 24hrs until reset with Int 1Ah/fn 07h.
  2389.      2) A side effect of this function is that the clock chip's interrupt
  2390.     level (IRQ8) is enabled.
  2391.      3) Only one alarm may be active at any given time.
  2392.      4) The program using this function must place the address of its interrupt
  2393.     handler for the alarm in the vector for Int 4Ah.
  2394.  
  2395.  
  2396. Function 07h    Reset Real Time Clock Alarm            (AT and after)
  2397. entry    AH    07h
  2398. return    none
  2399. note 1) Cancels any pending alarm request on the CMOS date/time chip.
  2400.      2) This function does not disable the clock chip's interrupt level (IRQ8).
  2401.  
  2402.  
  2403. Function 08h    Set Real Time Clock Activated Power On Mode    (Convertible)
  2404. entry    AH    08h
  2405.     CH    hours in BCD
  2406.     CL    minutes in BCD
  2407.     DH    seconds in BCD
  2408.  
  2409.  
  2410. Function 09h    Read Real Time Clock Alarm Time and Status
  2411.                         (Convertible and PS/2 Model 30)
  2412. entry    AH    09h
  2413. return    CH    hours in BCD
  2414.     CL    minutes in BCD
  2415.     DH    seconds in BCD
  2416.     DL    alarm status:
  2417.         00h    if alarm not enabled
  2418.         01h    if alarm enabled but will not power up system
  2419.         02h    if alarm will power up system
  2420.  
  2421.  
  2422. Function 0Ah    Read System-Timer Day Counter                   (PS/2)
  2423. entry    AH    0Ah
  2424. return    CF    set on error
  2425.     CX    count of days since Jan 1,1980
  2426. note    Returns the contents of the system's day counter.
  2427.  
  2428.  
  2429. Function 0Bh    Set System-Timer Day Counter                   (PS/2)
  2430. entry    AH    0Bh
  2431.     CX    count of days since Jan 1,1980
  2432. return    CF    set on error
  2433. note    Stores an arbitrary value in the system's day counter.
  2434.  
  2435.  
  2436. Function 80h    Set Up Sound Multiplexor        (PCjr) (Tandy 1000?)
  2437. entry    AH    80h
  2438.     AL    sound source
  2439.         00h    source is 8253 timer chip, channel 2
  2440.         01h    source is cassette input
  2441.         02h    source is I/O channel "audio in" line
  2442.         03h    source is TI sound generator chip
  2443. return    none
  2444. note    Sets up the source for tones that will appear on the PCjr's Audio Out
  2445.     bus line or RF modulator.
  2446.  
  2447.                                     -69-
  2448.  
  2449.  
  2450. Function 1Ah    Read Time and Date                   (AT&T 6300)
  2451. entry    AH    0FEh
  2452. return    BX    days count (1=Jan 1, 1984)
  2453.     CH    hours
  2454.     CL    minutes
  2455.     DH    seconds
  2456.     DL    hundredths
  2457. note    Day count in BX is unique to AT&T/Olivetti computers.
  2458.  
  2459.  
  2460.  
  2461. ┌─────────────────────────────────────────────────────────────────────────────┐
  2462. │Interrupt 1Bh    Control-Break                        3**14 │
  2463. └─────────────────────────────────────────────────────────────────────────────┘
  2464. (0:006Ch)    This interrupt is called when the keyboard handler of the IBM
  2465.         machines detects Ctrl and Break pressed at the same time. DOS
  2466.         normally point this interrupt at its own Ctrl-Break handler.
  2467.  
  2468. note 1) If the break occurred while processing an interrupt, one or more
  2469.     end of interrupt commands must be send to the 8259 Programmable
  2470.     Interrupt Controller.
  2471.      2) All I/O devices should be reset in case an operation was underway at
  2472.     the time.
  2473.      3) It is normally pointed to an IRET during system initialization so that
  2474.     it does nothing, but some programs change it to return a Ctrl-C scan
  2475.     code and thus invoke int 23h.
  2476.  
  2477.  
  2478.  
  2479. ┌─────────────────────────────────────────────────────────────────────────────┐
  2480. │Interrupt 1Ch    Timer Tick                        3**15 │
  2481. └─────────────────────────────────────────────────────────────────────────────┘
  2482. (0:0070h)
  2483. note 1) Taken 18.2065 times per second by the int 08h interrupt.
  2484.      2) Normally vectors to dummy IRET unless PRINT.COM has been installed.
  2485.      3) If an application moves the interrupt pointer, it is the responsibility
  2486.     of that application to save and restore all registers that may be
  2487.     modified.
  2488.      4) returns values at absolute address 40:6x (BIOS Data Area); number of
  2489.     ticks since midnight
  2490.     40:6C    word    timer counter high word
  2491.     40:6E    word    timer counter low word
  2492.  
  2493.                                     -70-
  2494.  
  2495. ┌─────────────────────────────────────────────────────────────────────────────┐
  2496. │Interrupt 1Dh    Vector of Video Initialization Parameters        3**16 │
  2497. └─────────────────────────────────────────────────────────────────────────────┘
  2498. (0:0074h)    This doubleword address points to 3 sets of 16-bytes containing
  2499.         data to initialize for video modes for video modes 0 & 1 (40
  2500.         column), 2 & 3 (80 column), and 4, 5 & 6 (graphics) on the
  2501.         Motorola 6845 CRT controller chip.
  2502.  6845 registers:
  2503.     R0    horizontal total        (horizontal sync in characters)
  2504.     R1    horizontal displayed              (characters per line)
  2505.     R2    horizontal sync position       (move display left or right)
  2506.     R3    sync width       (vertical and horizontal pulse: 4-bits each)
  2507.     R4    vertical total                (total character lines)
  2508.     R5    vertical adjust            (adjust for 50 or 60 Hz refresh)
  2509.     R6    vertical displayed             (lines of chars displayed)
  2510.     R7    vertical sync position             (lines shifted up or down)
  2511.     R8    interlace (bits 4 and 5) and skew (bits 6 and 7)
  2512.     R9    max scan line addr         (scan lines per character row)
  2513.     R10    cursor start             (starting scan line of cursor)
  2514.     R11    cursor stop               (ending scan line of cursor)
  2515.     R12    video memory start address high byte               (6 bits)
  2516.     R13    video memory start address low byte               (8 bits)
  2517.     R14    cursor address high byte                   (6 bits)
  2518.     R15    cursor address low byte                    (8 bits)
  2519.  
  2520.  6845 Video Init Tables:
  2521.     table for modes 0 and 1   \
  2522.     table for modes 2 and 3    \ each table is 16 bytes long and
  2523.     table for modes 4,5, and 6 / contains values for 6845 registers
  2524.     table for mode 7      /
  2525.       4 words    size of video RAM for modes 0/1, 2/3, 4/5, and 6/7
  2526.       8 bytes    number of columns in each mode
  2527.       8 bytes    video controller mode byte for each mode
  2528. note 1) There are 4 separate tables, and all 4 must be initialized if all
  2529.     video modes will be used.
  2530.      2) The power-on initialization code of the computer points this vector
  2531.     to the ROM BIOS video routines.
  2532.      3) IBM recommends that if this table needs to be modified, it should be
  2533.     copied into RAM and only the nescessary changes made.
  2534.  
  2535. ┌─────────────────────────────────────────────────────────────────────────────┐
  2536. │Interrupt 1Eh    Vector of Diskette Controller Parameters        3**17 │
  2537. └─────────────────────────────────────────────────────────────────────────────┘
  2538. (0:0078h)    Dword address points to data base table that is used by BIOS.
  2539.         Default location is at 0F000:0EFC7h. 11-byte table format:
  2540.       bytes:
  2541.         00h    4-bit step rate, 4-bit head unload time
  2542.         01h    7-bit head load time, 1-bit DMA flag
  2543.         02h    54.9254 ms ticks - delay til motor off (36-38 typical)
  2544.         03h    sector size:
  2545.             00h    128 bytes
  2546.             01h    256 bytes
  2547.             02h    512 bytes
  2548.             03h    1024 bytes
  2549.         04h    last sector on track              (8 or 9 typical)
  2550.         05h    inter-sector gap on read/write          (42 typical)
  2551.         06h    data length for DMA transfers        (0FFh typical)
  2552.         07h    gap length between sectors for format      (80 typical)
  2553.         08h    sector fill byte for format        (0F6h typical)
  2554.         09h    head settle time (in milliseconds)  (15 to 25 typical)
  2555.             DOS 1.0   0
  2556.             DOS 1.10  0
  2557.             DOS 2.10  15
  2558.             DOS 3.1   1
  2559.         0Ah    motor start time (in 1/8 sec intervals)  (2-4 typical)
  2560.             DOS 2.10  2
  2561.  
  2562.                                     -71-
  2563.  
  2564.  
  2565. note 1) This vector is pointed to the ROM BIOS diskette tables on system
  2566.     initialization
  2567.      2) IBM recommends that if this table needs to be modified, it should be
  2568.     copied into RAM and only the nescessary changes made.
  2569.      3) Some versions of DOS 3.2 may contain a bug. DOS 3.2 assumes that the
  2570.     dword at 0070:0F37 contains the address of the diskette parameter
  2571.     block and changes values in that block. The location does contain a
  2572.     copy of the value at 0:78 (int 1Eh, DISK_POINTER) if DOS is booted from
  2573.     diskette, but when booted from the hard disk, the location contains
  2574.     0:0. This leads to strange things, especially when running under a
  2575.     debugger since DOS overwrites parts of the interrupt vectors for
  2576.     interrupts 1 to 3. The solution to the problem is to either upgrade
  2577.     to DOS 3.3 or to copy the disk parameter vector to 70:F37 before
  2578.     running or at the start of your program.
  2579.  
  2580.  
  2581.  
  2582.  
  2583.  
  2584. ┌─────────────────────────────────────────────────────────────────────────────┐
  2585. │Interrupt 1Fh    Ptr to Graphics Character Extensions (Graphics Set 2)    3**18 │
  2586. └─────────────────────────────────────────────────────────────────────────────┘
  2587. (0:007Ch)    This is the pointer to data used by the ROM video routines to
  2588.         display characters above ASCII 127 while in CGA medium and high
  2589.         res graphics modes.
  2590.  
  2591. note 1) Doubleword address points to 1K table composed of 28 8-byte character
  2592.     definition bit-patterns. First byte of each entry is top row, last byte
  2593.     is bottom row.
  2594.      2) The first 128 character patterns are located in system ROM.
  2595.      3) This vector is set to 000:0 at system initialization.
  2596.      4) Used by DOS' external GRAFTABL command.
  2597.  
  2598.