home *** CD-ROM | disk | FTP | other *** search
/ DP Tool Club 3 / CDASC03.ISO / sorties / 314 / interrup.txt < prev    next >
Text File  |  1993-04-01  |  252KB  |  8,876 lines

  1. @Interrupt Services DOS∙BIOS∙EMS∙Mouse           Copyright 1991 David Jurgens
  2. :int table:interrupt table:exceptions:IRQ
  3. ^Intel Defined CPU Exception Table (see notes)
  4.  
  5. %    Interrupt      Function
  6.  
  7.      0    Divide by zero
  8.      1    Single step
  9.      2    Non-maskable  (NMI)
  10.      3    Breakpoint
  11.      4    Overflow trap
  12.      5    BOUND range exceeded (186,286,386)
  13.      6    Invalid opcode (186,286,386)
  14.      7    Coprocessor not available (286,386)
  15.      8    Double fault exception (286,386)
  16.      9    Coprocessor segment overrun (286,386)
  17.      A    Invalid task state segment (286,386)
  18.      B    Segment not present (286,386)
  19.      C    Stack exception (286,386)
  20.      D    General protection exception (286,386)
  21.      E    Page fault (286,386)
  22.      F    Reserved
  23.     10    Coprocessor error (286,386)
  24.  
  25. ^IBM PC Hardware Interrupt Table (in order of priority)
  26.  
  27. %    IRQ#  Interrupt     Function
  28.  
  29.     IRQ0     8    ~timer~ (55ms intervals, 18.2 per second)
  30.     IRQ1     9    keyboard service required
  31.     IRQ2     A    slave ~8259~ or EGA/VGA vertical retrace
  32.     IRQ8    70    real time clock  (AT,XT286,PS50+)
  33.     IRQ9    71    software redirected to IRQ2  (AT,XT286,PS50+)
  34.     IRQ10    72    reserved  (AT,XT286,PS50+)
  35.     IRQ11    73    reserved  (AT,XT286,PS50+)
  36.     IRQ12    74    mouse interrupt  (PS50+)
  37.     IRQ13    75    numeric coprocessor error  (AT,XT286,PS50+)
  38.     IRQ14    76    fixed disk controller (AT,XT286,PS50+)
  39.     IRQ15    77    reserved  (AT,XT286,PS50+)
  40.     IRQ3     B    COM2 or COM4 service required, (COM3-COM8 on MCA PS/2)
  41.     IRQ4     C    COM1 or COM3 service required
  42.     IRQ5     D    fixed disk or data request from LPT2
  43.     IRQ6     E    floppy disk service required
  44.     IRQ7     F    data request from LPT1 (unreliable on IBM mono)
  45.  
  46.  
  47. ^Interrupt Table as Implemented by System BIOS/DOS
  48.  
  49. %      INT #   Locus        Function
  50.  
  51.      0    CPU    divide by zero
  52.      1    CPU    single step
  53.      2    CPU    non-maskable
  54.      3    CPU    breakpoint
  55.      4    CPU    overflow trap
  56.      5    BIOS    print screen
  57.      6    CPU    Invalid opcode (186,286,386)
  58.      7    CPU    coprocessor not available (286,386)
  59.      8    IRQ0    ~timer~ (55ms intervals, 18.21590 per second)
  60.      9    IRQ1    keyboard service required (see ~INT 9~)
  61.      A    IRQ2    slave ~8259~ or EGA/VGA vertical retrace
  62.      B    IRQ3    COM2 service required (PS/2 MCA COM3-COM8)
  63.      C    IRQ4    COM1 service required
  64.      D    IRQ5    fixed disk or data request from LPT2
  65.      E    IRQ6    floppy disk service required
  66.      F    IRQ7    data request from LPT1 (unreliable on IBM mono)
  67.     10    BIOS    video (see ~INT 10~)
  68.     11    BIOS    Equipment determination (see ~INT 11~)
  69.     12    BIOS    memory size (see ~INT 12~)
  70.     13    BIOS    disk I/O service  (see ~INT 13~)
  71.     14    BIOS    serial communications (see ~INT 14~)
  72.     15    BIOS    system services, cassette (see ~INT 15~)
  73.     16    BIOS    keyboard services (see ~INT 16~)
  74.     17    BIOS    parallel printer (see ~INT 17~)
  75.     18    BIOS    ROM BASIC loader
  76.     19    BIOS    bootstrap loader (unreliable, see ~INT 19~)
  77.     1A    BIOS    time of day    (see ~INT 1A~)
  78.     1B    BIOS    user defined ctrl-break handler (see ~INT 1B~)
  79.     1C    BIOS    user defined clock tick handler (see ~INT 1C~)
  80.     1D    BIOS    ~6845~ video parameter pointer
  81.     1E    BIOS    diskette parameter pointer (base table)
  82.     1F    BIOS    graphics character table
  83.     20    DOS    general program termination
  84.     21    DOS    function request services (see ~INT 21~)
  85.     22    DOS    terminate address (see ~INT 22~)
  86.     23    DOS    control break termination address (see ~INT 23~)
  87.     24    DOS    critical error handler (see ~INT 24~)
  88.     25    DOS    absolute disk read (see ~INT 25~)
  89.     26    DOS    absolute disk write (see ~INT 26~)
  90.     27    DOS    terminate and stay resident (see ~INT 27~)
  91.     28    DOS    idle loop, issued by DOS when idle (see ~INT 28~)
  92.     29    DOS    fast TTY console I/O (see ~INT 29~)
  93.     2A    DOS    critical section and NETBIOS (see ~INT 2A~)
  94.     2B    DOS    internal, simple ~IRET~ in DOS 2.0-5.0
  95.     2C    DOS    internal, simple IRET in DOS 2.0-5.0
  96.     2D    DOS    internal, simple IRET in DOS 2.0-5.0
  97.     2E    DOS    exec command from base level command
  98.             interpreter    (see ~INT 2E~)
  99.     2F    DOS    multiplexer (see ~INT 2F~)
  100.     30-31    CPM    far jump vector for CPM (not an interrupt)
  101.     31    DPMI    DOS Protected Mode Interface (for DOS extenders)
  102.     32        reserved
  103.     33        mouse support (see ~INT 33~)
  104.     34-3E        Microsoft/Borland floating point emulation
  105.     3F        overlay manager
  106.     40    BIOS    hard disk
  107.     41    BIOS    fixed disk 0 parameters pointer (see ~INT 13,9~)
  108.     42    BIOS    relocated video handler (EGA/VGA/PS)
  109.     43    BIOS    user font table (EGA/VGA/PS)
  110.     44    BIOS    first 128 graphics characters (also Netware)
  111.     45    BIOS    reserved for BIOS
  112.     46    BIOS    fixed disk 1 parameters ptr (see ~INT 13,9~/INT 41)
  113.     47    BIOS    reserved for BIOS
  114.     48    BIOS    PCjr cordless keyboard translation
  115.     49    BIOS    PCjr non-keyboard scancode translation table
  116.     4A    BIOS    user alarm  (AT,CONV,PS/2) (see ~INT 4A~)
  117.     4B-4F    BIOS    reserved
  118.     50    BIOS    periodic alarm from timer (PS/2)
  119.     51-58    BIOS    reserved
  120.     59    BIOS    GSS Computer Graphics Interface
  121.     5A    BIOS    cluster adapter BIOS entry point
  122.     5B    BIOS    cluster adapter boot
  123.     5C    NETBIOS    NETBIOS interface, TOPS interface
  124.     5D-5F    BIOS    reserved for BIOS
  125.     60-67        reserved for user software interrupts
  126.     67    EMS    LIM/EMS specification (see ~INT 67~)
  127.     68        APPC
  128.     69-6B        reserved by IBM
  129.     6C    DOS    DOS 3.2 real time clock update
  130.         BIOS    system resume vector
  131.     6D-6F        reserved
  132.     70    IRQ8    real time clock  (AT,XT286,PS50+, see ~INT 15~)
  133.     71    IRQ9    software redirected to IRQ2    (AT,XT286,PS50+)
  134.     72    IRQ10    reserved  (AT,XT286,PS50+)
  135.     73    IRQ11    reserved  (AT,XT286,PS50+)
  136.     74    IRQ12    mouse interrupt  (PS50+)
  137.     75    IRQ13    numeric coprocessor NMI error  (AT,XT286,PS50+)
  138.     76    IRQ14    fixed disk controller (AT,XT286,PS50+)
  139.     77    IRQ15    reserved  (AT,XT286,PS50+)
  140.     78-79        unused
  141.     80-85        ROM BASIC
  142.     86-F0    DOS    reserved for BASIC interpreter use
  143.     86    NETBIOS    NETBIOS relocated INT 18
  144.     E0    CPM    CP/M 86 function calls
  145.     F1-FF        reserved by IBM
  146.     FE-FF        may be destroyed by return from protected
  147.             mode using VDISK on 286 machines (Apr 86, DDJ)
  148.  
  149.  
  150.     - Intel defined 0 through 20h for use for internal CPU;  IBM
  151.       redefined interrupts 0 through 1Fh for its own use, hence
  152.       the duplicate definitions in the tables
  153.     - all interrupts except the internal CPU exceptions push the
  154.       flags and the CS:IP of the next instruction onto the stack.
  155.       CPU exception interrupts are similar but push the CS:IP of the
  156.       causal instruction.    8086/88 divide exceptions are different,
  157.       they return to the instruction following the division
  158.     - interrupts are disabled upon entry into any interrupt routine and
  159.       should be enabled by the user or by an ~IRET~
  160.     - in DOS 3.2+ hardware IRQ interrupts are re-vectored through DOS
  161.       to provide standard stack frames
  162.  
  163. :int 5
  164. ^INT 5 - Print Screen
  165.  
  166.  
  167.     no input data
  168.  
  169.  
  170. %    related memory:
  171.  
  172.     50:00    = 00    Print screen has not been called, or upon return
  173.             from a call there were no errors
  174.         = 01    Print screen is already in progress
  175.         = FF    Error encountered during printing
  176.  
  177.  
  178.     - invoked from ~INT 9~
  179.  
  180. :int 8:BIOS timer interrupt
  181. ^INT 8 - System timer
  182.  
  183.     no input data
  184.  
  185. %    related memory:
  186.  
  187.     40:6C = Daily timer counter (4 bytes)
  188.     40:70 = 24 hr overflow flag (1 byte)
  189.     40:67 = Day counter on all products after AT
  190.     40:40 = Motor shutoff counter - decremented until 0 then
  191.         shuts off diskette motor
  192.  
  193.  
  194.     - ~INT 1C~ is invoked as a user interrupt
  195.     - the byte at 40:70 is a flag that certain DOS functions use
  196.       and adjust the date if necessary.  Since this is a flag and
  197.       not a counter it results in DOS (not the ~RTC~) losing days
  198.       when several midnights pass before a DOS call
  199.     - generated 18.2 times per second by the ~8253~ Programmable Interval
  200.       Timer (PIT)
  201.     - normal INT 8 execution takes approximately 100 microseconds, though
  202.       some machines have been witnessed taking 1.3 ms.
  203.     - the Daily Timer Counter at 40:6C may not be reliable on some AT&T
  204.       systems.
  205.  
  206.     - see    ~8253~   ~INT 1C~   ~INT 1A~
  207.  
  208. :int 9:keyboard interrupt
  209. ^INT 9 - Keyboard Interrupt (Hardware Handler)
  210.  
  211.     no input data
  212.  
  213. %    related memory:
  214.  
  215.     40:17 = updates keyboard flag byte 0
  216.     40:18 = updates keyboard flag byte 1
  217.     40:1A = queue head ptr is set to buffer start if Ctrl-Break is hit
  218.     40:1C = updates buffer tail pointer for each keystroke; sets
  219.         queue tail ptr is set to queue start if Ctrl-Break is hit
  220.     40:1E = updates keyboard buffer (32 bytes)
  221.     40:71 = updates bit 7 of the BIOS break flag if Ctrl-Break is hit
  222.     40:72 = updates reset flag with 1234H if Ctrl-Alt-Del pressed
  223.     40:96 = indicates keyboard type (AT,PS/2)
  224.     40:97 = updates keyboard LED flags (AT,PS/2)
  225.     FFFF:0 = reboot code called if Ctrl-Alt-Del pressed
  226.  
  227. %    related interrupts:
  228.  
  229.     ~INT 5~     invoked if print screen key pressed
  230.     ~INT 1B~    invoked if Ctrl-Break key sequence pressed
  231.     ~INT 15,85~ invoked on AT if system request key is pressed
  232.     ~INT 15,4F~ invoked on machines after PC/AT with AL = scan code
  233.  
  234.  
  235.     - records key press and key release via IRQ1/8259 and
  236.       stores scan codes in the BIOS buffer located at 40:1C
  237.     - keyboard controllers also buffer data when interrupts are
  238.       disabled at the ~8259~ interrupt controller
  239.     - keyboard controller is capable of storing 16 keystrokes
  240.       even when interrupts are disabled at the 8259
  241.     - normal INT 9 execution takes approximately 500 microseconds;
  242.       at least one standard XT BIOS is known to take up to 1.3
  243.       milliseconds to execute
  244.  
  245.     - see    ~MAKE CODES~   ~KB FLAGS~
  246.  
  247. :int 10:BIOS video services:video interrupt
  248. ^INT 10 - Video BIOS Services
  249.  
  250. %    For more information, see the following topics:
  251.  
  252.      ~INT 10,0~ - Set video mode
  253.      ~INT 10,1~ - Set cursor type
  254.      ~INT 10,2~ - Set cursor position
  255.      ~INT 10,3~ - Read cursor position
  256.      ~INT 10,4~ - Read light pen
  257.      ~INT 10,5~ - Select active display page
  258.      ~INT 10,6~ - Scroll active page up
  259.      ~INT 10,7~ - Scroll active page down
  260.      ~INT 10,8~ - Read character and attribute at cursor
  261.      ~INT 10,9~ - Write character and attribute at cursor
  262.      ~INT 10,A~ - Write character at current cursor
  263.      ~INT 10,B~ - Set color palette
  264.      ~INT 10,C~ - Write graphics pixel at coordinate
  265.      ~INT 10,D~ - Read graphics pixel at coordinate
  266.      ~INT 10,E~ - Write text in teletype mode
  267.      ~INT 10,F~ - Get current video state
  268.     ~INT 10,10~ - Set/get palette registers (EGA/VGA)
  269.     ~INT 10,11~ - Character generator routine (EGA/VGA)
  270.     ~INT 10,12~ - Video subsystem configuration (EGA/VGA)
  271.     ~INT 10,13~ - Write string (BIOS after 1/10/86)
  272.     ~INT 10,14~ - Load LCD char font (convertible)
  273.     ~INT 10,15~ - Return physical display parms (convertible)
  274.     ~INT 10,1A~ - Video Display Combination (VGA)
  275.     ~INT 10,1B~ - Video BIOS Functionality/State Information (MCGA/VGA)
  276.     ~INT 10,1C~ - Save/Restore Video State  (VGA only)
  277.     ~INT 10,FE~ - Get DESQView/TopView Virtual Screen Regen Buffer
  278.     ~INT 10,FF~ - Update DESQView/TopView Virtual Screen Regen Buffer
  279.  
  280.  
  281.     Warning: Some BIOS implementations have a bug that causes register
  282.     BP to be destroyed.   It is advisable to save BP before a call to
  283.     Video BIOS routines on these systems.
  284.  
  285.     - registers CS, DS, ES, SS, BX, CX, DX are preserved unless
  286.       explicitly changed
  287.     - see  ~INT 1F~  ~INT 1D~  ~INT 29~  ~INT 21,2~  ~INT 21,6~  ~INT 21,9~
  288.  
  289. :int 10,0:video modes
  290. ^INT 10,0 - Set Video Mode
  291.  
  292.     AH = 00
  293.     AL = 00  40x25 B/W text (CGA,EGA,MCGA,VGA)
  294.        = 01  40x25 16 color text (CGA,EGA,MCGA,VGA)
  295.        = 02  80x25 16 shades of gray text (CGA,EGA,MCGA,VGA)
  296.        = 03  80x25 16 color text (CGA,EGA,MCGA,VGA)
  297.        = 04  320x200 4 color graphics (CGA,EGA,MCGA,VGA)
  298.        = 05  320x200 4 color graphics (CGA,EGA,MCGA,VGA)
  299.        = 06  640x200 B/W graphics (CGA,EGA,MCGA,VGA)
  300.        = 07  80x25 Monochrome text (MDA,HERC,EGA,VGA)
  301.        = 08  160x200 16 color graphics (PCjr)
  302.        = 09  320x200 16 color graphics (PCjr)
  303.        = 0A  640x200 4 color graphics (PCjr)
  304.        = 0B  Reserved (EGA BIOS function 11)
  305.        = 0C  Reserved (EGA BIOS function 11)
  306.        = 0D  320x200 16 color graphics (EGA,VGA)
  307.        = 0E  640x200 16 color graphics (EGA,VGA)
  308.        = 0F  640x350 Monochrome graphics (EGA,VGA)
  309.        = 10  640x350 16 color graphics (EGA or VGA with 128K)
  310.          640x350 4 color graphics (64K EGA)
  311.        = 11  640x480 B/W graphics (MCGA,VGA)
  312.        = 12  640x480 16 color graphics (VGA)
  313.        = 13  320x200 256 color graphics (MCGA,VGA)
  314.        = 8x  EGA, MCGA or VGA ignore bit 7, see below
  315.        = 9x  EGA, MCGA or VGA ignore bit 7, see below
  316.  
  317.  
  318.     - if AL bit 7=1, prevents EGA,MCGA & VGA from clearing display
  319.     - function updates byte at 40:49;  bit 7 of byte 40:87
  320.       (EGA/VGA Display Data Area) is set to the value of AL bit 7
  321.  
  322. :int 10,1
  323. ^INT 10,1 - Set Cursor Type
  324.  
  325.  
  326.     AH = 01
  327.     CH = cursor starting scan line (cursor top) (low order 5 bits)
  328.     CL = cursor ending scan line (cursor bottom) (low order 5 bits)
  329.  
  330.  
  331.     returns nothing
  332.  
  333.  
  334.     - cursor scan lines are zero based
  335.     - cursor size can also be set via the ~6845~ CRT controller
  336.     - cursor size can be determined using the CRTC,  ~INT 10,3~  or the
  337.       ~BIOS Data Area~ bytes 40:60 (ending scan line) and 40:61 (starting
  338.       scan line)
  339.     - the following is a list of the cursor scan lines associated with
  340.       most common adapters;  screen sizes over 40 lines may differ
  341.       depending on adapters.
  342.  
  343. %        Line     Starting     Ending      Character
  344. %    Video    Count     Scan Line    Scan Line   Point Size
  345.  
  346.     CGA     25        06         07          08
  347.     MDA     25        0B         0C          0E
  348.     EGA     25        06         07          0E
  349.     EGA     43      04/06      07          08
  350.     VGA     25        0D         0E          10
  351.     VGA     40        08         09          0A
  352.     VGA     50        06         07          08
  353.  
  354.     - use CX = 2000h to disable cursor
  355.  
  356. :int 10,2
  357. ^INT 10,2 - Set Cursor Position
  358.  
  359.  
  360.     AH = 02
  361.     BH = page number (0 for graphics modes)
  362.     DH = row
  363.     DL = column
  364.  
  365.  
  366.     returns nothing
  367.  
  368.  
  369.     - positions relative to 0,0 origin
  370.     - 80x25 uses coordinates 0,0 to 24,79;    40x25 uses 0,0 to 24,39
  371.     - the ~6845~ can also be used to perform this function
  372.     - setting the data in the BIOS Data Area at location 40:50 does not
  373.       take immediate effect and is not recommended
  374.     - see    ~VIDEO PAGES~   ~6845~   ~BDA~
  375.  
  376. :int 10,3
  377. ^INT 10,3 - Read Cursor Position and Size
  378.  
  379.  
  380.     AH = 03
  381.     BH = video page
  382.  
  383.  
  384.     on return:
  385.     CH = cursor starting scan line (low order 5 bits)
  386.     CL = cursor ending scan line (low order 5 bits)
  387.     DH = row
  388.     DL = column
  389.  
  390.  
  391.     - returns data from ~BIOS DATA AREA~ locations 40:50, 40:60 and 40:61
  392.     - the ~6845~ can also be used to read the cursor position
  393.     - the return data can be circumvented by direct port I/O to the 6845
  394.       CRT Controller since this function returns the data found in the
  395.       BIOS Data Area without actually checking the controller
  396.     
  397. :int 10,4
  398. ^INT 10,4 - Read Light Pen Position
  399.  
  400.  
  401.     AH = 04
  402.  
  403.  
  404.     on return:
  405.     AH = 0    light pen switch not triggered
  406.        = 1    light pen triggered
  407.     BX = pixel column (0-319 or 0-639, mode dependent)
  408.     CH = raster line (0-199) (CGA and EGA modes 4, 5 and 6)
  409.     CX = raster line (EGA modes except 4, 5 and 6)
  410.     DH = row (0-24)
  411.     DL = column (0-79 or 0-79 mode dependent)
  412.  
  413.  
  414.     - data returned as a byte coordinate, leaving horizontal
  415.       accuracy to within 2 pixels (320) or 4 pixels (640)
  416.     - vertical accuracy within 2 lines
  417.     - PS/2's don't support the light pen interface
  418.  
  419. :int 10,5
  420. ^INT 10,5 - Select Active Display Page
  421.  
  422.     AH = 05
  423.     AL = new page number, see ~VIDEO PAGES~
  424.  
  425.     for PCjr only:
  426.     AL = 80h to read CRT/CPU page registers
  427.          81h to set CPU page register
  428.          BL = CPU page register
  429.          82h to set CRT page register
  430.          BH = CRT page register
  431.          83h to set CPU and page registers
  432.          BH = CRT page register
  433.          BL = CPU page register
  434.  
  435.  
  436.     on return: (PCjr only)
  437.     BH = CRT page register
  438.     BL = CPU page register
  439.  
  440. :int 10,6
  441. ^INT 10,6 - Scroll Window Up
  442.  
  443.  
  444.     AH = 06
  445.     AL = number of lines to scroll, previous lines are
  446.          blanked, if 0 or AL > screen size, window is blanked
  447.     BH = attribute to be used on blank line
  448.     CH = row of upper left corner of scroll window
  449.     CL = column of upper left corner of scroll window
  450.     DH = row of lower right corner of scroll window
  451.     DL = column of lower right corner of scroll window
  452.  
  453.  
  454.     returns nothing
  455.  
  456.  
  457.     - in video mode 4 (300x200 4 color) on the EGA, MCGA and VGA
  458.       this function scrolls page 0 regardless of the current page
  459.     - can be used to scroll graphics screens, using character coords
  460.     - on CGA's this function disables video adapter, causing flitter
  461. :int 10,7
  462. ^INT 10,7 - Scroll Window Down
  463.  
  464.  
  465.     AH = 07
  466.     AL = number of lines to scroll, previous lines are
  467.          blanked, if 0 or AL > screen size, window is blanked
  468.     BH = attribute to be used on blank line
  469.     CH = row of upper left corner of scroll window
  470.     CL = column of upper left corner of scroll window
  471.     DH = row of lower right corner of scroll window
  472.     DL = column of lower right corner of scroll window
  473.  
  474.  
  475.     returns nothing
  476.  
  477.  
  478.     - in video mode 4 (300x200 4 color) on the EGA, MCGA and VGA
  479.       this function scrolls page 0 regardless of the current page
  480.     - can be used to scroll graphics screens, using character coords
  481.     - on CGA's this function disables video adapter, causing flitter
  482.  
  483. :int 10,8
  484. ^INT 10,8 - Read Character and Attribute at Cursor Position
  485.  
  486.  
  487.     AH = 08
  488.     BH = display page
  489.  
  490.  
  491.     on return:
  492.     AH = attribute of character (alpha modes only)
  493.     AL = character at cursor position
  494.  
  495.  
  496.     - in video mode 4 (300x200 4 color) on the EGA, MCGA and VGA
  497.       this function works only on page zero
  498.  
  499. :int 10,9
  500. ^INT 10,9 - Write Character and Attribute at Cursor Position
  501.  
  502.  
  503.     AH = 09
  504.     AL = ASCII character to write
  505.     BH = display page  (or mode 13h, background pixel value)
  506.     BL = character attribute (text) foreground color (graphics)
  507.     CX = count of characters to write (CX >= 1)
  508.  
  509.  
  510.     returns nothing
  511.  
  512.  
  513.     - does not move the cursor
  514.     - in graphics mode (except mode 13h), if BL bit 7=1 then
  515.       value of BL is XOR'ed with the background color
  516.  
  517. :int 10,a
  518. ^INT 10,A - Write Character Only at Current Cursor Position
  519.  
  520.  
  521.     AH = 0A
  522.     AL = ASCII character to write
  523.     BH = display page  (or mode 13h, background pixel value)
  524.     BL = foreground color (graphics mode only)
  525.     CX = count of characters to write (CX >= 1)
  526.  
  527.  
  528.     return nothing
  529.  
  530.  
  531.     - similar to ~INT 10,9~ except color ignored in text modes
  532.  
  533. :int 10,b
  534. ^INT 10,B - Set Color Palette
  535.  
  536.     AH = 0B
  537.     BH = palette color ID
  538.        = 0    to set background and border color
  539.        = 1    to select 4 color palette
  540.     BL = color value (when BH = 0)
  541.        = palette value (when BH = 1)
  542.  
  543.     Palette    Pixel      Color
  544.        0         0        current background color
  545.              1        green (2)
  546.              2        red (4)
  547.              3        brown (6)
  548.        1         0        current background color
  549.              1        cyan (3)
  550.              2        magenta (5)
  551.              3        white (7)
  552.  
  553.     - does not work for all EGA and VGA video modes
  554.     - sets border color in text mode (BH = 0)
  555.  
  556. :int 10,c
  557. ^INT 10,C - Write Graphics Pixel at Coordinate
  558.  
  559.  
  560.     AH = 0C
  561.     AL = color value (XOR'ED with current pixel if bit 7=1)
  562.     BH = page number, see ~VIDEO PAGES~
  563.     CX = column number (zero based)
  564.     DX = row number (zero based)
  565.  
  566.  
  567.     returns nothing
  568.  
  569.  
  570.     - if bit 7 is 1, color specified is XOR'ed with current pixel
  571.     - page number in BH ignored for 320x200 4 color graphics mode
  572.     - this function is known to destroy AX and possibly SI and DI on
  573.       on some PS/2 VGA systems
  574.  
  575. :int 10,d
  576. ^INT 10,D - Read Graphics Pixel at Coordinate
  577.  
  578.  
  579.     AH = 0D
  580.     BH = page number, see ~VIDEO PAGES~
  581.     CX = column number (zero based)
  582.     DX = row number (zero based)
  583.  
  584.  
  585.     on return:
  586.     AL = color of pixel read
  587.  
  588.  
  589.     - 64K IBM EGAs with BIOS dated 9/13/84 in 350 line video
  590.       modes,  return invalid data in AL
  591.     - page number in BH ignored for 320x200 4 color graphics mode
  592.  
  593. :int 10,e
  594. ^INT 10,E - Write Text in Teletype Mode
  595.  
  596.  
  597.     AH = 0E
  598.     AL = ASCII character to write
  599.     BH = page number (text modes)
  600.     BL = foreground pixel color (graphics modes)
  601.  
  602.  
  603.     returns nothing
  604.  
  605.  
  606.     - cursor advances after write
  607.     - characters BEL (7), BS (8), LF (A), and CR (D) are
  608.       treated as control codes
  609.     - for some older BIOS (10/19/81), the BH register must point
  610.       to the currently displayed page
  611.     - on CGA adapters this function can disable the video signal while
  612.       performing the output which causes flitter.
  613.  
  614. :int 10,f
  615. ^INT 10,F - Get Video State
  616.  
  617.  
  618.     AH = 0F
  619.  
  620.  
  621.     on return:
  622.     AH = number of screen columns
  623.     AL = mode currently set (see ~VIDEO MODES~)
  624.     BH = current display page
  625.  
  626.  
  627.     - video modes greater than 13h on EGA, MCGA and VGA indicate
  628.       ~INT 10,0~ was called with the high bit of the mode (AL) set
  629.       to 1, meaning the display does not need cleared
  630.     - function returns byte value at 40:49;  On EGA, MCGA and
  631.       VGA bit 7 of register AL is determined by bit 7 of BIOS Data
  632.       Area byte 40:87.   This bit is usually set by INT 10,0
  633.       with bit 7 of the requested mode (in AL) set to 1
  634.  
  635. :int 10,10
  636. ^INT 10,10 - Set/Get Palette Registers (EGA/VGA)
  637.  
  638.     AH = 10h
  639.  
  640. %    AL = 00  set individual palette register
  641.        BH = color value
  642.        BL = palette register
  643.  
  644.  
  645. %    AL = 01  set border color (overscan register)
  646.        BH = color value
  647.  
  648.  
  649. %    AL = 02  set all palette registers and border
  650.        ES:DX = pointer to 17 byte table representing 16 palette
  651.            registers and border color register
  652.  
  653.  
  654. %    AL = 03  toggle intensity/blinking (EGA)
  655.        BL = 0  enable intensity
  656.         1  enable blinking
  657.  
  658.  
  659. %    AL = 07  read palette register (PS/2)
  660.        BL = palette register to read (0-15)
  661.  
  662.     on return:
  663.       BH = value of palette register
  664.  
  665.  
  666. %    AL = 08  read border color (overscan register, PS/2)
  667.  
  668.     on return:
  669.       BH = value of border color (overscan register)
  670.  
  671.  
  672. %    AL = 09  read palette registers and border (PS/2)
  673.        ES:DX = pointer to 17 byte table representing 16 palette
  674.            registers and border color register
  675.  
  676.     on return:
  677.     ES:DX = pointer to table provided as input
  678.  
  679.  
  680. %    AL = 10  set DAC color register
  681.        BX = color register to set
  682.        CH = green value
  683.        CL = blue value
  684.        DH = red value
  685.  
  686.  
  687. %    AL = 12  set block of DAC color registers
  688.        BX = first color register to set
  689.        CX = number of color registers to set
  690.        ES:DX = pointer to table of color values to set
  691.  
  692.  
  693. %    AL = 13  set attribute controller color select state
  694.        BL = 0  set Mode Control register bit 7
  695.           BH = value for bit 7
  696.        BL = 1  set color select register
  697.           BH = value for color select register
  698.  
  699.  
  700. %    AL = 15  read DAC color register (PS/2)
  701.        BX = color register to read
  702.  
  703.     on return:
  704.     CH = green value
  705.     CL = blue value
  706.     DH = red value
  707.  
  708.  
  709. %    AL = 17  read block of DAC color registers
  710.        BX = first color register to read
  711.        CX = number of color registers to read
  712.        ES:DX = pointer to buffer for color registers
  713.  
  714.     on return:
  715.     ES:DX = pointer to color table provided as input
  716.  
  717.  
  718. %    AL = 18  update video DAC mask register
  719.        BL = new mask
  720.  
  721.  
  722. %    AL = 19  read video DAC mask register
  723.  
  724.     on return:
  725.     BL = value read from video DAC mask register
  726.  
  727.  
  728. %    AL = 1A  read color page state
  729.        BL = bit 7 of Mode Control Register
  730.        BH = bits 2 thru 3 of Color select register if BL = 0
  731.           = bits 0 thru 3 of Color select register if BL = 1
  732.  
  733.     on return:
  734.     BL = current paging mode
  735.     CX = current page
  736.  
  737.  
  738.  
  739. %    AL = 1B  sum color values to shades of gray
  740.        BX = first color register to sum
  741.        CX = number of color registers to sum
  742.  
  743.  
  744.     - controls the pixel color mapping bit values
  745.     - BIOS extension to EGA/VGA systems
  746.  
  747. :int 10,11
  748. ^INT 10,11 - Character Generator Routine (EGA/VGA)
  749.  
  750.     AH = 11h
  751.  
  752. %    AL = 00  user character load
  753.        BH = number of bytes per character
  754.        BL = table in character generator RAM
  755.        CX = count of characters in table
  756.        DX = ASCII code of first character defined
  757.        ES:BP = pointer to user table
  758.  
  759.  
  760. %    AL = 01  ROM BIOS 8x14 monochrome set
  761.        BL = table in character generator RAM
  762.  
  763.  
  764. %    AL = 02  ROM BIOS 8x8 double dot
  765.        BL = table in character generator RAM
  766.  
  767.  
  768. %    AL = 03  set displayed definition table
  769.        BL = value for character Map Select register (EGA,VGA)
  770.           = character generator RAM table numbers (MCGA)
  771.  
  772.  
  773. %    AL = 04  ROM BIOS 8x16 character set
  774.        BL = table in character generator RAM
  775.  
  776.  
  777. %    AL = 10  user specified character definition table
  778.        BH = bytes per character (points)
  779.        BL = table in character generator RAM
  780.        CX = number of characters defined in table
  781.        DX = ASCII code of first character defined
  782.        ES:BP = pointer to user table
  783.  
  784.  
  785. %    AL = 11  ROM BIOS 8x14 monochrome character set
  786.        BL = table in character generator RAM
  787.  
  788.  
  789. %    AL = 12  ROM 8x8 double dot character definitions
  790.        BL = table in character generator RAM
  791.  
  792.  
  793. %    AL = 14  ROM 8x16 double dot character definitions
  794.        BL = table in character generator RAM
  795.  
  796.  
  797. %    AL = 20  pointer to graphics character table for ~INT 1F~ (8x8)
  798.        ES:BP = pointer to user table
  799.  
  800.  
  801. %    AL = 21  user graphics character pointer at INT 43
  802.        BL = row specifier
  803.           = 0 - user specified  (DL = rows)
  804.           = 1 is 14 rows
  805.           = 2 is 25 rows
  806.           = 3 is 43 rows
  807.        CX = bytes per character (points)
  808.        DL = rows (when BL = 0)
  809.        ES:BP = pointer to user table
  810.  
  811.  
  812. %    AL = 22  ROM 8x14 character set
  813.        BL = number of rows (see AL=21)
  814.        DL = rows (when BL = 0)
  815.  
  816.  
  817. %    AL = 23  ROM 8x8 double dot character set
  818.        BL = row specifier (see AL=21)
  819.        DL = rows (when BL = 0)
  820.  
  821.  
  822. %    AL = 24  ROM 8x16 character set
  823.        BL = row specifier (see AL=21)
  824.        DL = rows (when BL = 0)
  825.  
  826.  
  827. %    AL = 30  get current character generator information
  828.        BH = information desired:
  829.           = 0  ~INT 1F~ pointer
  830.           = 1  INT 44h pointer
  831.           = 2  ROM 8x14 pointer
  832.           = 3  ROM 8x8 double dot pointer (base)
  833.           = 4  ROM 8x8 double dot pointer (top)
  834.           = 5  ROM 9x14 alpha alternate pointer
  835.           = 6  ROM 8x16 character table pointer
  836.           = 7  ROM 9x16 alternate character table pointer
  837.  
  838.     on return:
  839.     CX = bytes per character (points)
  840.     DL = rows (less 1)
  841.     ES:BP = pointer to table
  842.  
  843. :int 10,12
  844. ^INT 10,12 - Video Subsystem Configuration (EGA/VGA)
  845.  
  846.     AH = 12h
  847.  
  848.  
  849. %    BL = 10  return video configuration information
  850.  
  851.     on return:
  852.     BH = 0 if color mode in effect
  853.        = 1 if mono mode in effect
  854.     BL = 0 if 64k EGA memory
  855.        = 1 if 128k EGA memory
  856.        = 2 if 192k EGA memory
  857.        = 3 if 256k EGA memory
  858.     CH = feature bits
  859.     CL = switch settings
  860.  
  861.  
  862. %    BL = 20  select alternate print screen routine
  863.  
  864. %    BL = 30  select scan lines for alphanumeric modes
  865.        AL = 0  200 scan lines
  866.           = 1  350 scan lines
  867.           = 2  400 scan lines
  868.  
  869.     on return:
  870.     AL = 12
  871.  
  872.  
  873. %    BL = 31  select default palette loading
  874.        AL = 0 enable default palette loading
  875.           = 1 disable default palette loading
  876.  
  877.     on return:
  878.     AL = 12
  879.  
  880.  
  881. %    BL = 32  CPU access to video RAM
  882.        AL = 0  enable CPU access to video RAM and I/O ports
  883.           = 1  disable CPU access to video RAM and I/O ports
  884.  
  885.     on return:
  886.     AL = 12
  887.  
  888.  
  889. %    BL = 33  Gray scale summing
  890.        AL = 0  enable gray scale summing
  891.           = 2  disable gray scale summing
  892.  
  893.     on return:
  894.     AL = 12
  895.  
  896.  
  897. %    BL = 34  cursor emulation
  898.        AL = 0  enable cursor emulation
  899.           = 1  disable cursor emulation
  900.  
  901.     on return:
  902.     AL = 12
  903.  
  904.  
  905. %    BL = 35  PS/2 video display switching
  906.        AL = 0 initial adapter video off
  907.           = 1 initial planar video on
  908.           = 2 switch active video off
  909.           = 3 switch inactive video on
  910.        ES:DX pointer to 128 byte save area (when AL = 0, 2 or 3)
  911.  
  912.     on return:
  913.     AL = 12
  914.  
  915.  
  916. %    BL = 36  video refresh control
  917.        AL = 0 enable refresh
  918.           = 1 disable refresh
  919.  
  920.     on return:
  921.     AL = 12
  922.  
  923. :int 10,13
  924. ^INT 10,13 - Write String (BIOS versions from 1/10/86)
  925.  
  926.     AH = 13h
  927.     AL = write mode (see bit settings below)
  928.        = 0 string is chars only, attribute in BL, cursor not moved
  929.        = 1 string is chard only, attribute in BL, cursor moved
  930.        = 2 string contains chars and attributes, cursor not moved
  931.        = 3 string contains chars and attributes, cursor moved
  932.     BH = video page number
  933.     BL = attribute if mode 0 or 1 (AL bit 1=0)
  934.     CX = length of string (ignoring attributes)
  935.     DH = row coordinate
  936.     DL = column coordinate
  937.     ES:BP = pointer to string
  938.  
  939.  
  940.     Bit settings for write mode (register AL):
  941.  
  942.     │7│6│5│4│3│2│1│0│  AL
  943.      │ │ │ │ │ │ │ └──── 0=don't move cursor, 1=move cursor
  944.      │ │ │ │ │ │ └───── 0=BL has attributes, 1=string has attributes
  945.      └─┴─┴─┴─┴─┴────── unused
  946.  
  947.  
  948.     returns nothing
  949.  
  950.  
  951.     - BEL, BS, CR, LF are treated as ASCII control codes
  952.     - wraps data and scrolls if unable to fit data on one line
  953.  
  954. :int 10,14
  955. ^INT 10,14 - Load LCD Character Font (convertible only)
  956.  
  957.     AH = 14h
  958.  
  959. %    AL = 0 - load user specified font
  960.        ES:DI = pointer to character font
  961.        CX = number of characters to store
  962.        DX = char offset into ram font area
  963.        BH = number of bytes per character
  964.        BL = 0  load main font (block 0)
  965.           = 1  load alternate font (block 1)
  966.  
  967. %    AL = 1 - load system ROM default font
  968.        BL = 0  load main font (block 0)
  969.           = 1  load alternate font (block 1)
  970.  
  971. %    AL = 2 - set mapping of LCD high intensity attribute
  972.        BL = 0  ignore high intensity attribute
  973.           = 1  map high intensity to underscore
  974.           = 2  map high intensity to reverse video
  975.           = 3  map high intensity to select alternate font
  976. :int 10,15
  977. ^INT 10,15 - Return Physical Display Parms (convertible)
  978.  
  979.  
  980.     AH = 15h
  981.  
  982.     on return:
  983.     AX = alternate display adapter type
  984.     ES:DI = pointer to parameter table:
  985.  
  986.  
  987. %    Offset Size      Description
  988.  
  989.       01   word   monitor model number
  990.       02   word   vertical pels per meter
  991.       03   word   horizontal pels per meter
  992.       04   word   total number of vertical pels
  993.       05   word   total number of horizontal pels
  994.       06   word   horizontal pel separation in micrometers
  995.       07   word   vertical pel separation in micrometers
  996.  
  997. :int 10,1a
  998. ^INT 10,1A - Video Display Combination (VGA)
  999.  
  1000.     AH = 1A
  1001.     AL = 00 get video display combination
  1002.        = 01 set video display combination
  1003.          BL = active display  (see table below)
  1004.          BH = inactive display
  1005.  
  1006.  
  1007.     on return:
  1008.     AL = 1A, if a valid function was requested in AH
  1009.     BL = active display  (AL=00, see table below)
  1010.     BH = inactive display  (AL=00)
  1011.  
  1012. %    Valid display codes:
  1013.  
  1014.      FF  Unrecognized video system
  1015.      00  No display
  1016.      01  MDA with monochrome display
  1017.      02  CGA with color display
  1018.      03  Reserved
  1019.      04  EGA with color display
  1020.      05  EGA with monochrome display
  1021.      06  Professional graphics controller
  1022.      07  VGA with analog monochrome display
  1023.      08  VGA with analog color display
  1024.      09  Reserved
  1025.      0A  MCGA with digital color display
  1026.      0B  MCGA with analog monochrome display
  1027.      0C  MCGA with analog color display
  1028.  
  1029.     - returns value at byte 40:8A indicating display combination status
  1030.     - used to detect video display capabilities
  1031.  
  1032. :int 10,1b
  1033. ^INT 10,1B - Video BIOS Functionality and
  1034. ^State Information (MCGA/VGA)
  1035.  
  1036.     AH = 1B
  1037.     BX = implementation type (must be zero)
  1038.     ES:DI = pointer to 64 byte buffer
  1039.  
  1040.  
  1041.     on return:
  1042.     AL = 1B
  1043.     ES:DI = pointer to updated buffer  (see below)
  1044.  
  1045.  
  1046.     - returns static and dynamic information about the current
  1047.       state and capabilities of the current video system
  1048.     - bytes 0-3 of the dynamic data table at ES:DI contain a far
  1049.       pointer to the video static information table
  1050.  
  1051.  
  1052. ^Video BIOS Dynamic Functionality State Table (MCGA/VGA)
  1053.  
  1054. %    Dynamic Video State Table
  1055.  
  1056.     00  dword   address of static functionality table
  1057.     04  byte    video mode
  1058.     05  word    number of columns
  1059.     07  word    length of displayed video buffer (# bytes)
  1060.     09  word    start address of upper left corner of video buffer
  1061.     0B  16bytes cursor position table for 8 pages (col,row)
  1062.     1B  byte    cursor end line
  1063.     1C  byte    cursor start line
  1064.     1D  byte    active video page
  1065.     1E  word    I/O port for CRTC address register
  1066.     20  byte    current value of CRTC 3x8 register
  1067.     21  byte    current value of CRTC 3x9 register
  1068.     22  byte    number of displayed character rows
  1069.     23  word    height of character matrix (points)
  1070.     25  byte    active display combination code
  1071.     26  byte    inactive display combination code
  1072.     27  word    number of displayed colors (mono = 0)
  1073.     29  byte    number of supported video pages
  1074.     2A  byte    raster scan lines 0=200, 1=350, 2=400, 3=480
  1075.     2B  byte    text character table used
  1076.     2C  byte    text character table used
  1077.     2D  byte    other state information:
  1078.  
  1079.         │7│6│5│4│3│2│1│0│ State Information byte at offset 2D
  1080.          │ │ │ │ │ │ │ └─── 1 = all modes active (MCGA always 0)
  1081.          │ │ │ │ │ │ └──── 1 = gray scale summing enabled
  1082.          │ │ │ │ │ └───── 1 = monochrome display attached
  1083.          │ │ │ │ └────── 1 = default palette loading disabled
  1084.          │ │ │ └─────── 1 = cursor emulation enabled
  1085.          │ │ └──────── 1 = blinking attribute enabled
  1086.          └─┴───────── 1 = reserved
  1087.  
  1088.     2E 3bytes   reserved
  1089.     31  byte    video RAM available 0=64K, 1=128K, 2=192K, 3=256K
  1090.     32  byte    save area status
  1091.  
  1092.         │7│6│5│4│3│2│1│0│ Save Area Status
  1093.          │ │ │ │ │ │ │ └─── 1 = two text char sets are active
  1094.          │ │ │ │ │ │ └──── 1 = dynamic save area is active
  1095.          │ │ │ │ │ └───── 1 = text char set override is active
  1096.          │ │ │ │ └────── 1 = graphics char set is override active
  1097.          │ │ │ └─────── 1 = palette override is active
  1098.          │ │ └──────── 1 = display combination code ext. active
  1099.          └─┴───────── 1 = reserved
  1100.  
  1101.     33  dword   reserved
  1102.  
  1103.  
  1104. ^Video BIOS Static Functionality Table    (EGA/VGA)
  1105.  
  1106.         │7│6│5│4│3│2│1│0│ Video modes supported, byte at offset 00
  1107.          │ │ │ │ │ │ │ └─── 1 = mode 0
  1108.          │ │ │ │ │ │ └──── 1 = mode 1
  1109.          │ │ │ │ │ └───── 1 = mode 2
  1110.          │ │ │ │ └────── 1 = mode 3
  1111.          │ │ │ └─────── 1 = mode 4
  1112.          │ │ └──────── 1 = mode 5
  1113.          │ └───────── 1 = mode 6
  1114.          └────────── 1 = mode 7
  1115.  
  1116.         │7│6│5│4│3│2│1│0│ Video modes supported, byte at offset 01
  1117.          │ │ │ │ │ │ │ └─── 1 = mode 8
  1118.          │ │ │ │ │ │ └──── 1 = mode 9
  1119.          │ │ │ │ │ └───── 1 = mode A
  1120.          │ │ │ │ └────── 1 = mode B
  1121.          │ │ │ └─────── 1 = mode C
  1122.          │ │ └──────── 1 = mode D
  1123.          │ └───────── 1 = mode E
  1124.          └────────── 1 = mode F
  1125.  
  1126.         │7│6│5│4│3│2│1│0│ Video modes supported, byte at offset 02
  1127.          │ │ │ │ │ │ │ └─── 1 = mode 10
  1128.          │ │ │ │ │ │ └──── 1 = mode 11
  1129.          │ │ │ │ │ └───── 1 = mode 12
  1130.          │ │ │ │ └────── 1 = mode 13
  1131.          └─┴─┴─┴─────── reserved
  1132.  
  1133.     03  dword  reserved
  1134.     07  byte   scan lines supported in text modes
  1135.  
  1136.         │7│6│5│4│3│2│1│0│ Scan lines supported, byte at offset 07
  1137.          │ │ │ │ │ │ │ └─── 1 = 200 lines
  1138.          │ │ │ │ │ │ └──── 1 = 350 lines
  1139.          └─┴─┴─┴─┴─┴───── 1 = 400 lines
  1140.  
  1141.     08  byte   max number of displayable text character sets
  1142.     09  byte   # of text definition tables in char generator RAM
  1143.     0A  byte   other capability flags
  1144.  
  1145.         │7│6│5│4│3│2│1│0│ Other flags, byte at offset 0A
  1146.          │ │ │ │ │ │ │ └─── 1 = all modes (0 on MCGA)
  1147.          │ │ │ │ │ │ └──── 1 = gray scale summing
  1148.          │ │ │ │ │ └───── 1 = character set loading
  1149.          │ │ │ │ └────── 1 = default palette loading
  1150.          │ │ │ └─────── 1 = cursor emulation
  1151.          │ │ └──────── 1 = 64 color palette
  1152.          │ └───────── 1 = video DAC loading
  1153.          └────────── 1 = DAC controlled by ACCS
  1154.  
  1155.     0B  byte   other capability flags
  1156.  
  1157.         │7│6│5│4│3│2│1│0│ Other flags, byte at offset 0B
  1158.          │ │ │ │ │ │ │ └─── 1 = light pen support
  1159.          │ │ │ │ │ │ └──── 1 = save/restore video state
  1160.          │ │ │ │ │ └───── 1 = blinking/background intensity
  1161.          │ │ │ │ └────── 1 = display combination code
  1162.          └─┴─┴─┴─────── reserved
  1163.  
  1164.     0C  word   reserved
  1165.     0E  byte   save area capabilities
  1166.  
  1167.         │7│6│5│4│3│2│1│0│  save area capabilities at offset 0E
  1168.          │ │ │ │ │ │ │ └──── 1 = multiple text character sets
  1169.          │ │ │ │ │ │ └───── 1 = dynamic save area
  1170.          │ │ │ │ │ └────── 1 = text character set override
  1171.          │ │ │ │ └─────── 1 = graphics character set override
  1172.          │ │ │ └──────── 1 = palette override
  1173.          │ │ └───────── 1 = display combination code extension
  1174.          └─┴────────── reserved
  1175.  
  1176.     0F  byte    reserved
  1177. :int 10,1c
  1178. ^INT 10,1C - Save/Restore Video State  (VGA only)
  1179.  
  1180.     AH = 1C
  1181.  
  1182. %    AL = 0    get save buffer size
  1183.        CX = requested states
  1184.         bit 0: video hardware state
  1185.         bit 1: video BIOS data areas
  1186.         bit 2: video DAC state
  1187.  
  1188.     on return:
  1189.     AL = 1C
  1190.     BX = buffer size in 64 byte blocks
  1191.  
  1192. %    AL = 1    save requested state
  1193.        CX = requested states (see AL = 0)
  1194.        ES:BX = pointer to buffer
  1195.  
  1196.     returns nothing
  1197.  
  1198. %    AL = 2    restore requested states
  1199.        CX = requested states (see AL = 0)
  1200.        ES:BX = pointer to buffer
  1201.  
  1202.     returns nothing
  1203.  
  1204. :int 10,fe
  1205. ^INT 10,FE - Get DESQView/TopView Virtual Screen Regen Buffer
  1206.  
  1207.  
  1208.     AH = FE
  1209.     ES:DI = set to sentinel value (test for INT 10,FE supported)
  1210.  
  1211.  
  1212.     returns:
  1213.     ES:DI = address of DESQView/TopView video buffer, DI will always
  1214.         be zero
  1215.  
  1216.  
  1217.     - on return ES:DI should be tested against the original value;
  1218.       the value will change if this function is supported (DESQView
  1219.       or TopView loaded), otherwise it will remain unchanged
  1220.     - if ES:DI changes this address can be used as the video screen
  1221.       regen buffer
  1222.  
  1223. :int 10,ff
  1224. ^INT 10,FF - Update DESQView/TopView Virtual Screen Regen Buffer
  1225.  
  1226.  
  1227.     AH = FF
  1228.     CX = number of characters changed
  1229.     ES:DI = pointer to first character in buffer to change,  ES is
  1230.         set to segment returned by ~INT 10,FE~
  1231.  
  1232.  
  1233.     returns nothing
  1234.  
  1235.  
  1236.     - the physical screen does not get updated until INT 10,FF is
  1237.       called in TopView
  1238.     - it is not necessary to make this call under DESQView since it
  1239.       handles updates automatically
  1240.     - calling this function under DESQView will cancel the automatic
  1241.       update mode
  1242.  
  1243. :int 11:equipment flags
  1244. ^INT 11 - BIOS Equipment Determination / BIOS Equipment Flags
  1245.  
  1246.     no input data
  1247.  
  1248.     on return:
  1249.     AX contains the following bit flags:
  1250.  
  1251.     │F│E│D│C│B│A│9│8│7│6│5│4│3│2│1│0│  AX
  1252.      │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ └──── diskettes drives installed
  1253.      │ │ │ │ │ │ │ │ │ │ │ │ │ │ └───── math coprocessor
  1254.      │ │ │ │ │ │ │ │ │ │ │ │ └─┴────── old PC system board RAM < 256K
  1255.      │ │ │ │ │ │ │ │ │ │ │ │ │ └───── pointing device installed (PS/2)
  1256.      │ │ │ │ │ │ │ │ │ │ │ │ └────── not used on PS/2
  1257.      │ │ │ │ │ │ │ │ │ │ └─┴─────── initial video mode
  1258.      │ │ │ │ │ │ │ │ └─┴────────── # of diskette drives, less 1
  1259.      │ │ │ │ │ │ │ └───────────── 0 if DMA installed
  1260.      │ │ │ │ └─┴─┴────────────── number of serial ports
  1261.      │ │ │ └─────────────────── game adapter installed
  1262.      │ │ └──────────────────── unused, internal modem (PS/2)
  1263.      └─┴───────────────────── number of printer ports
  1264.  
  1265.     - bits 3 & 2,  system board RAM if less than 256K motherboard
  1266.         00 - 16K             01 - 32K
  1267.         10 - 48K             11 - 64K (normal)
  1268.  
  1269.     - bits 5 & 4,  initial video mode
  1270.         00 - unused          01 - 40x25 color
  1271.         10 - 80x25 color         11 - 80x25 monochrome
  1272.  
  1273.     - bits 7 & 6,  number of disk drives attached, when bit 0=1
  1274.         00 - 1 drive         01 - 2 drives
  1275.         10 - 3 drive         11 - 4 drives
  1276.  
  1277.     - returns data stored at ~BIOS Data Area~ location 40:10.  This
  1278.       word is stored in Intel backwards format where bits 7-0 occur
  1279.       before bits F-8.
  1280.     - some flags are not guaranteed to be correct on all machines
  1281.     - bit 13 is used on the PCjr to indicate serial printer
  1282.  
  1283. :int 12
  1284. ^INT 12 - Memory Size Determination
  1285.  
  1286.  
  1287.     no input data
  1288.  
  1289.  
  1290.     on return:
  1291.     AX  = the number of contiguous 1k memory blocks found at startup
  1292.  
  1293.     - contiguous memory does not include video memory or extended RAM
  1294.  
  1295. :int 13:BIOS disk services
  1296. ^INT 13 - Diskette BIOS Services
  1297.  
  1298. ^For more information see the following topics:
  1299.  
  1300.      ~INT 13,0~  Reset disk system
  1301.      ~INT 13,1~  Get disk status
  1302.      ~INT 13,2~  Read disk sectors
  1303.      ~INT 13,3~  Write disk sectors
  1304.      ~INT 13,4~  Verify disk sectors
  1305.      ~INT 13,5~  Format disk track
  1306.      ~INT 13,6~  Format track and set bad sector flag (XT & portable)
  1307.      ~INT 13,7~  Format the drive starting at track (XT & portable)
  1308.      ~INT 13,8~  Get current drive parameters (XT & newer, see note ╪)
  1309.      ~INT 13,9~  Initialize 2 fixed disk base tables (XT & newer, see note ╪)
  1310.      ~INT 13,A~  Read long sector (XT & newer, see note ╪)
  1311.      ~INT 13,B~  Write long sector (XT & newer, see note ╪)
  1312.      ~INT 13,C~  Seek to cylinder (XT & newer, see note ╪)
  1313.      ~INT 13,D~  Alternate disk reset (XT & newer, see note ╪)
  1314.      ~INT 13,E~  Read sector buffer (XT & portable only)
  1315.      ~INT 13,F~  Write sector buffer (XT & portable only)
  1316.     ~INT 13,10~  Test for drive ready (XT & newer, see note ╪)
  1317.     ~INT 13,11~  Recalibrate drive (XT & newer, see note ╪)
  1318.     ~INT 13,12~  Controller ram diagnostic (XT & portable only)
  1319.     ~INT 13,13~  Drive diagnostic (XT & portable only)
  1320.     ~INT 13,14~  Controller internal diagnostic (XT & newer, see note ╪)
  1321.     ~INT 13,15~  Read disk type/DASD type (XT BIOS from 1/10/86 & newer)
  1322.     ~INT 13,16~  Disk change line status (XT BIOS from 1/10/86 & newer)
  1323.     ~INT 13,17~  Set dasd type for format (XT BIOS from 1/10/86 & newer)
  1324.     ~INT 13,18~  Set media type for format (BIOS date specific)
  1325.     ~INT 13,19~  Park fixed disk heads (AT & newer)
  1326.     ~INT 13,1A~  Format ESDI drive unit (PS/2 50+)
  1327.  
  1328.  
  1329.     ╪  The 1983 version of the "IBM XT BIOS Technical Reference"
  1330.        shows these functions are available for the XT but many other
  1331.        programming references say they aren't available until the AT.
  1332.        This is probably due to misunderstanding the design of the disk
  1333.        BIOS.   Upon bootup the hard disk BIOS replaces the default
  1334.        INT 13h diskette handler with the hard disk INT 13h handler.
  1335.  
  1336.  
  1337. %    Most disk BIOS calls use the following parameter scheme:
  1338.  
  1339.         AH = function request number
  1340.         AL = number of sectors  (1-128 dec.)
  1341.         CH = cylinder number  (0-1023 dec.)
  1342.         CL = sector number    (1-17 dec.)
  1343.         DH = head number  (0-15 dec.)
  1344.         DL = drive number (0=A:, 1=2nd floppy, 80h=drive 0, 81h=drive 1)
  1345.         DL = drive number (0=A:, 1=2nd floppy, 80h=C:, 81h=D:)
  1346.          Note that some programming references use (0-3) as the
  1347.          drive number which represents diskettes only.
  1348.         ES:BX = address of user buffer
  1349.  
  1350.  
  1351. %    and return with:
  1352.     CF = 0 if successful
  1353.        = 1 if error
  1354.     AH = status of operation  (see INT 13,STATUS)
  1355.  
  1356.  
  1357.     - INT 13 diskette read functions should be retried at least 3
  1358.       times to assure the disk motor has time to spin up to speed
  1359.     - physical sector numbers can be converted to and from DOS sector
  1360.       numbers with the following formulas:
  1361.  
  1362.       dos_sector = (sector - 1) + (head * sectors_per_track) +
  1363.                (track * sectors_per_track * num_heads)
  1364.  
  1365.       physical_sector = 1 + (dos_sector  MOD  sectors_per_track)
  1366.       physical_head = (dos_sector / sectors_per_track)  MOD  num_heads
  1367.       physical_track = dos_sector / (sectors_per_track * num_heads)
  1368.  
  1369.     - registers DS, BX, CX and DX are preserved
  1370.     - see  ~INT 13,STATUS~
  1371.  
  1372. :int 13,0
  1373. ^INT 13,0 - Reset Disk System
  1374.  
  1375.  
  1376.     AH = 00
  1377.     DL = drive number (0=A:, 1=2nd floppy, 80h=drive 0, 81h=drive 1)
  1378.  
  1379.  
  1380.     on return:
  1381.     AH = disk operation status  (see ~INT 13,STATUS~)
  1382.     CF = 0 if successful
  1383.        = 1 if error
  1384.  
  1385.  
  1386.     - clears reset flag in controller and pulls heads to track 0
  1387.     - setting the controller reset flag causes the disk to recalibrate
  1388.       on the next disk operation
  1389.     - if bit 7 is set, the diskette drive indicated by the lower 7 bits
  1390.       will reset then the hard disk will follow; return code in AH is
  1391.       for the drive requested
  1392.  
  1393. :int 13,1:int 13,status
  1394. ^INT 13,1 - Disk Status
  1395.  
  1396.     AH = 01
  1397.  
  1398.     on return:
  1399.     AL = status:
  1400.  
  1401. %    Status in AL
  1402.  
  1403.        00  no error
  1404.        01  bad command passed to driver
  1405.        02  address mark not found or bad sector
  1406.        03  diskette write protect error
  1407.        04  sector not found
  1408.        05  fixed disk reset failed
  1409.        06  diskette changed or removed
  1410.        07  bad fixed disk parameter table
  1411.        08  DMA overrun
  1412.        09  DMA access across 64k boundary
  1413.        0A  bad fixed disk sector flag
  1414.        0B  bad fixed disk cylinder
  1415.        0C  unsupported track/invalid media
  1416.        0D  invalid number of sectors on fixed disk format
  1417.        0E  fixed disk controlled data address mark detected
  1418.        0F  fixed disk DMA arbitration level out of range
  1419.        10  ECC/CRC error on disk read
  1420.        11  recoverable fixed disk data error, data fixed by ECC
  1421.        20  controller error (NEC for floppies)
  1422.        40  seek failure
  1423.        80  time out, drive not ready
  1424.        AA  fixed disk drive not ready
  1425.        BB  fixed disk undefined error
  1426.        CC  fixed disk write fault on selected drive
  1427.        E0  fixed disk status error/Error reg = 0
  1428.        FF  sense operation failed
  1429.  
  1430.  
  1431.     - codes represent controller status after last disk operation
  1432.     - returns the status byte located at 40:41 in the ~BIOS Data Area~
  1433.  
  1434. :int 13,2
  1435. ^INT 13,2 - Read Disk Sectors
  1436.  
  1437.     AH = 02
  1438.     AL = number of sectors to read    (1-128 dec.)
  1439.     CH = track/cylinder number  (0-1023 dec., see below)
  1440.     CL = sector number  (1-17 dec.)
  1441.     DH = head number  (0-15 dec.)
  1442.     DL = drive number (0=A:, 1=2nd floppy, 80h=drive 0, 81h=drive 1)
  1443.     ES:BX = pointer to buffer
  1444.  
  1445.  
  1446.     on return:
  1447.     AH = status  (see ~INT 13,STATUS~)
  1448.     AL = number of sectors read
  1449.     CF = 0 if successful
  1450.        = 1 if error
  1451.  
  1452.  
  1453.     - BIOS disk reads should be retried at least three times and the
  1454.       controller should be reset upon error detection
  1455.     - be sure ES:BX does not cross a 64K segment boundary or a
  1456.       DMA boundary error will occur
  1457.     - many programming references list only floppy disk register values
  1458.     - only the disk number is checked for validity
  1459.     - the parameters in CX change depending on the number of cylinders;
  1460.       the track/cylinder number is a 10 bit value taken from the 2 high
  1461.       order bits of CL and the 8 bits in CH (low order 8 bits of track):
  1462.  
  1463.       │F│E│D│C│B│A│9│8│7│6│5-0│  CX
  1464.        │ │ │ │ │ │ │ │ │ │    └─────    sector number
  1465.        │ │ │ │ │ │ │ │ └─┴───────  high order 2 bits of track/cylinder
  1466.        └─┴─┴─┴─┴─┴─┴─┴──────────  low order 8 bits of track/cyl number
  1467.  
  1468.     - see    ~INT 13,A~
  1469.  
  1470. :int 13,3
  1471. ^INT 13,3 - Write Disk Sectors
  1472.  
  1473.     AH = 03
  1474.     AL = number of sectors to write  (1-128 dec.)
  1475.     CH = track/cylinder number  (0-1023 dec.)
  1476.     CL = sector number  (1-17 dec., see below)
  1477.     DH = head number  (0-15 dec.)
  1478.     DL = drive number (0=A:, 1=2nd floppy, 80h=drive 0, 81h=drive 1)
  1479.     ES:BX = pointer to buffer
  1480.  
  1481.  
  1482.     on return:
  1483.     AH = 0 if CF=0; otherwise disk status  (see ~INT 13,STATUS~)
  1484.     AL = number of sectors written
  1485.     CF = 0 if successful
  1486.        = 1 if error
  1487.  
  1488.  
  1489.     - BIOS disk write attempts should reset the controller on error
  1490.     - be sure ES:BX does not cross a 64K segment boundary or a
  1491.       DMA boundary error will occur
  1492.     - IBM PC XT 286 does not require a value in AL, though it is
  1493.       recommended that one be supplied for portability
  1494.     - many programming references list only floppy disk register values
  1495.     - only the disk number is checked for validity
  1496.     - the parameters in CX change depending on the number of cylinders;
  1497.       the track/cylinder number is a 10 bit value taken from the 2 high
  1498.       order bits of CL and the 8 bits in CH (low order 8 bits of track):
  1499.  
  1500.       │F│E│D│C│B│A│9│8│7│6│5-0│  CX
  1501.        │ │ │ │ │ │ │ │ │ │    └─────    sector number
  1502.        │ │ │ │ │ │ │ │ └─┴───────  high order 2 bits of track/cylinder
  1503.        └─┴─┴─┴─┴─┴─┴─┴──────────  low order 8 bits of track/cyl number
  1504.  
  1505.     - see    ~INT 13,B~
  1506.  
  1507. :int 13,4
  1508. ^INT 13,4 - Verify Disk Sectors
  1509.  
  1510.     AH = 04
  1511.     AL = number of sectors to verify  (1-128 dec.)
  1512.     CH = track/cylinder number  (0-1023 dec., see below)
  1513.     CL = sector number  (1-17 dec.)
  1514.     DH = head number  (0-15 dec.)
  1515.     DL = drive number (0=A:, 1=2nd floppy, 80h=drive 0, 81h=drive 1)
  1516.     ES:BX = pointer to buffer
  1517.  
  1518.     on return:
  1519.     AH = status  (see ~INT 13,STATUS~)
  1520.     AL = number of sectors verified
  1521.     CF = 0 if successful
  1522.        = 1 if error
  1523.  
  1524.  
  1525.     - BIOS disk reads should be retried at least three times and the
  1526.       controller should be reset upon error detection
  1527.     - causes controller to calculate the CRC of the disk data and
  1528.       compare it against the CRC stored in the sector header
  1529.     - BIOS before 11/15/85 required ES:BX point to a valid buffer
  1530.       that doesn't cross DMA boundaries.   More recent BIOS versions
  1531.       actually ignore the buffer and the DMA boundary requirement
  1532.     - use this function to check for valid formatted diskette in a
  1533.       the specified drive and for drive ready for read
  1534.     - only the disk number is checked for validity
  1535.     - the parameters in CX change depending on the number of cylinders;
  1536.       the track/cylinder number is a 10 bit value taken from the 2 high
  1537.       order bits of CL and the 8 bits in CH (low order 8 bits of track):
  1538.  
  1539.       │F│E│D│C│B│A│9│8│7│6│5-0│  CX
  1540.        │ │ │ │ │ │ │ │ │ │    └─────    sector number
  1541.        │ │ │ │ │ │ │ │ └─┴───────  high order 2 bits of track/cylinder
  1542.        └─┴─┴─┴─┴─┴─┴─┴──────────  low order 8 bits of track/cyl number
  1543.  
  1544.     - see    ~DETECTING~
  1545.  
  1546. :int 13,5
  1547. ^INT 13,5 - Format Disk Track
  1548.  
  1549.     AH = 05
  1550.     AL = interleave value (XT only)
  1551.     CX = track/cylinder number (see below for format)
  1552.     DH = head number  (0-15 dec.)
  1553.     DL = drive number (0=A:, 1=2nd floppy, 80h=drive 0, 81h=drive 1)
  1554.     ES:BX = pointer to block of "track address fields" containing
  1555.         four byte fields for each sector to be formatted of the form:
  1556.  
  1557.            1 byte  track number
  1558.            1 byte  head number         Size      #
  1559.            1 byte  sector number         Codes   Bytes
  1560.            1 byte  sector size code        0      128
  1561.                            1      256
  1562.                            2      512
  1563.                            3     1024
  1564.     on return:
  1565.     AH = status  (see ~INT 13,STATUS~)
  1566.     CF = 0 if successful
  1567.        = 1 if error
  1568.  
  1569.  
  1570.     - BIOS disk write attempts should reset the controller on error
  1571.     - ~INT 13,17~ should be called to set the DASD type
  1572.     - this function is capable of doing great damage if the parameters
  1573.       are incorrectly specified; only the drive number is checked
  1574.     - initializes disk address fields and data sectors
  1575.     - interleave is specified by ordering of track address fields
  1576.     - after INT 13 disk format, if the disk is to be used with DOS the
  1577.       DOS data structure must be written
  1578.     - only the disk number is checked for validity
  1579.     - the parameters in CX change depending on the number of cylinders;
  1580.       the track/cylinder number is a 10 bit value taken from the 2 high
  1581.       order bits of CL and the 8 bits in CH (low order 8 bits of track):
  1582.  
  1583.     │F│E│D│C│B│A│9│8│7│6│5-0│  CX (cylinder value 0-1023 dec.)
  1584.      │ │ │ │ │ │ │ │ │ │  └─────  unused
  1585.      │ │ │ │ │ │ │ │ └─┴───────    high order 2 bits of track/cylinder
  1586.      └─┴─┴─┴─┴─┴─┴─┴──────────  low order 8 bits of track/cyl number
  1587.  
  1588. :int 13,6
  1589. ^INT 13,6 - Format Track and Set Bad Sector Flags (XT & portable)
  1590.  
  1591.     AH = 06
  1592.     AL = Interleave value (XT only)
  1593.     BX = format buffer, size = 512 bytes;  the first
  1594.          2*(sectors/track) bytes contain F,N for each sector
  1595.          F = 00h for good sector,
  1596.          F = 80h for bad sector
  1597.          N = sector number
  1598.  
  1599.  
  1600.     on return:
  1601.     AH = status  (see ~INT 13,STATUS~)
  1602.     CF = 0 if successful
  1603.        = 1 if error
  1604.  
  1605.  
  1606.     - BIOS disk write attempts should reset the controller on error
  1607.     - only the disk number is checked for validity
  1608. :int 13,7
  1609. ^INT 13,7 - Format Drive Starting at Specified Track (XT & portable)
  1610.  
  1611.     AH = 07
  1612.     AL = interleave value (XT only)
  1613.     BX = format buffer, size = 512 bytes;  the first 2*(sectors/track)
  1614.          bytes contain F, N for each sector where:
  1615.  
  1616.         F = 00h for good sector
  1617.         F = 80h for bad sector
  1618.         N = sector number
  1619.  
  1620.     on return:
  1621.     AH = status  (see ~INT 13,STATUS~)
  1622.     CF = 0 if successful
  1623.        = 1 if error
  1624.  
  1625.  
  1626.     - BIOS disk write attempts should reset the controller on error
  1627.     - only the disk number is checked for validity
  1628. :int 13,8
  1629. ^INT 13,8 - Get Current Drive Parameters (XT & newer)
  1630.  
  1631.     AH = 08
  1632.     DL = drive number (0=A:, 1=2nd floppy, 80h=drive 0, 81h=drive 1)
  1633.  
  1634.  
  1635.     on return:
  1636.     AH = status  (see ~INT 13,STATUS~)
  1637.     BL = CMOS drive type
  1638.          01 - 5¼  360K         03 - 3½  720K
  1639.          02 - 5¼  1.2Mb         04 - 3½ 1.44Mb
  1640.     CH = cylinders (0-1023 dec. see below)
  1641.     CL = sectors per track    (see below)
  1642.     DH = number of sides (0 based)
  1643.     DL = number of drives attached
  1644.     ES:DI = pointer to 11 byte ~Disk Base Table~ (DBT)
  1645.     CF = 0 if successful
  1646.        = 1 if error
  1647.  
  1648.  
  1649. %    Cylinder and Sectors Per Track Format
  1650.  
  1651.     │F│E│D│C│B│A│9│8│7│6│5│4│3│2│1│0│  CX
  1652.      │ │ │ │ │ │ │ │ │ │ └─┴─┴─┴─┴─┴──  sectors per track
  1653.      │ │ │ │ │ │ │ │ └─┴──────────    high order 2 bits of cylinder count
  1654.      └─┴─┴─┴─┴─┴─┴─┴──────────  low order 8 bits of cylinder count
  1655.  
  1656.     - the track/cylinder number is a 10 bit value taken from the 2 high
  1657.       order bits of CL and the 8 bits in CH (low order 8 bits of track)
  1658.     - many good programming references indicate this function is only
  1659.       available on the AT, PS/2 and later systems, but all hard disk
  1660.       systems since the XT have this function available
  1661.     - only the disk number is checked for validity
  1662.     - see  ~INT 1E~
  1663. :int 13,9
  1664. ^INT 13,9 - Initialize Fixed Disk Table (XT & newer)
  1665.  
  1666.     AH = 09
  1667.     DL = fixed disk number    (80h=drive 0, 81h=drive 1)
  1668.  
  1669.  
  1670.     on return:
  1671.     AH = status  (see ~INT 13,STATUS~)
  1672.     CF = 0 if successful
  1673.        = 1 if error
  1674.  
  1675.  
  1676.     - sets specified fixed disk table to the default values from ROM
  1677.     - many good programming references indicate this function is only
  1678.       available on the AT, PS/2 and later systems, but all hard disk
  1679.       systems since the XT have this function available
  1680.     - INT 41h vector is pointer to table for drive 0
  1681.     - INT 46h vector is pointer to table for drive 1
  1682.  
  1683.  
  1684. ^Table    definitions located by interrupt vectors  41H & 46H
  1685.  
  1686. %    Offset Size        Description
  1687.  
  1688.       00   word  maximum number of cylinders
  1689.       02   byte  maximum number of heads
  1690.       03   word  starting reduced write current cylinder
  1691.       05   word  starting write pre-comp cylinder
  1692.       07   byte  maximum ECC data burst length
  1693.       08   byte  control byte:
  1694.  
  1695.  
  1696.         │7│6│5│4│3│2│1│0│  Control byte
  1697.          │ │ │ │ │ └─┴─┴──── drive option
  1698.          │ │ └─┴─┴───────── always zero
  1699.          │ └────────────── disable ECC retries
  1700.          └─────────────── disable access retires
  1701. :int 13,a
  1702. ^INT 13,A - Read Long Sector (XT & newer)
  1703.  
  1704.     AH = 0A
  1705.     AL = number of sectors    (1-121 dec.)
  1706.     CH = track number  (0-1023 dec., see below)
  1707.     CL = sector number  (1-17 dec., see below)
  1708.     DH = head number  (0-15 dec.)
  1709.     DL = fixed drive number  (80h=drive 0, 81h=drive 1)
  1710.     ES:BX = address of buffer
  1711.  
  1712.  
  1713.     on return:
  1714.     AH = status  (see ~INT 13,STATUS~)
  1715.     AL = number of sectors actually transferred
  1716.     CF = 0 if successful
  1717.        = 1 if error
  1718.  
  1719.  
  1720.     - BIOS disk reads should be retried at least three times and the
  1721.       controller should be reset upon error detection
  1722.     - many good programming references indicate this function is only
  1723.       available on the AT, PS/2 and later systems, but all hard disk
  1724.       systems since the XT have this function available
  1725.     - reads regular data sectors (128-1024 bytes) with an additional
  1726.       4 byte ECC code included
  1727.     - a DMA boundary error will occur if the buffer at ES:BX crosses
  1728.       a 64K segment boundary
  1729.     - only the disk number is checked for validity
  1730.     - the parameters in CX change depending on the number of cylinders;
  1731.       the track/cylinder number is a 10 bit value taken from the 2 high
  1732.       order bits of CL and the 8 bits in CH (low order 8 bits of track):
  1733.  
  1734.       │F│E│D│C│B│A│9│8│7│6│5│4│3│2│1│0│  CX
  1735.        │ │ │ │ │ │ │ │ │ │ └─┴─┴─┴─┴─┴────    sector number
  1736.        │ │ │ │ │ │ │ │ └─┴────────────  high order 2 bits of track number
  1737.        └─┴─┴─┴─┴─┴─┴─┴────────────    low order 8 bits of track number
  1738.  
  1739.     - see    ~INT 13,2~
  1740.  
  1741. :int 13,b
  1742. ^INT 13,B - Write Long Sectors (XT & newer)
  1743.  
  1744.     AH = 0B
  1745.     AL = number of sectors    (1-121 dec.)
  1746.     CH = track number  (0-1023 dec., see below)
  1747.     CL = sector number  (1-17 dec., see below)
  1748.     DH = head number  (0-15 dec.)
  1749.     DL = fixed drive number  (80h=drive 0, 81h=drive 1)
  1750.     ES:BX = address of buffer
  1751.  
  1752.  
  1753.     on return:
  1754.     AL = number of sectors actually transferred
  1755.     AH = status  (see ~INT 13,STATUS~)
  1756.     CF = 0 if successful
  1757.        = 1 if error
  1758.  
  1759.  
  1760.     - BIOS disk write attempts should reset the controller on error
  1761.     - many good programming references indicate this function is only
  1762.       available on the AT, PS/2 and later systems, but all hard disk
  1763.       systems since the XT have this function available
  1764.     - writes regular sectors (128-1024 bytes) with additional 4 byte
  1765.       ECC code included in data
  1766.     - a DMA boundary error will occur if the buffer at ES:BX crosses
  1767.       a 64K segment boundary
  1768.     - only the disk number is checked for validity
  1769.     - the parameters in CX change depending on the number of cylinders;
  1770.       the track/cylinder number is a 10 bit value taken from the 2 high
  1771.       order bits of CL and the 8 bits in CH (low order 8 bits of track):
  1772.  
  1773.       │F│E│D│C│B│A│9│8│7│6│5│4│3│2│1│0│  CX
  1774.        │ │ │ │ │ │ │ │ │ │ └─┴─┴─┴─┴─┴────    sector number
  1775.        │ │ │ │ │ │ │ │ └─┴────────────  high order 2 bits of track number
  1776.        └─┴─┴─┴─┴─┴─┴─┴────────────    low order 8 bits of track number
  1777.  
  1778.     - see    ~INT 13,3~
  1779.  
  1780. :int 13,c
  1781. ^INT 13,C - Seek to Cylinder (XT & newer)
  1782.  
  1783.     AH = 0C
  1784.     CH = low order byte of cylinder number (see below)
  1785.     CL = high order byte of cylinder number (see below)
  1786.     DH = head number (0-15)
  1787.     DL = fixed drive number (80h=drive 0, 81h=drive 1)
  1788.  
  1789.  
  1790.     on return:
  1791.     AH = status  (see ~INT 13,STATUS~)
  1792.     CF = 0 if successful
  1793.        = 1 if error
  1794.  
  1795.  
  1796.     - many good programming references indicate this function is only
  1797.       available on the AT, PS/2 and later systems, but all hard disk
  1798.       systems since the XT have this function available
  1799.     - notice that CX is in reverse byte format similar to the way data
  1800.       is stored in memory and reverse of normal register storage
  1801.     - only the disk number is checked for validity
  1802.     - the parameters in CX change depending on the number of cylinders;
  1803.       the track/cylinder number is a 10 bit value taken from the 2 high
  1804.       order bits of CL and the 8 bits in CH (low order 8 bits of track):
  1805.  
  1806.       │F│E│D│C│B│A│9│8│7│6│5-0│  CX
  1807.        │ │ │ │ │ │ │ │ │ │    └─────    unused
  1808.        │ │ │ │ │ │ │ │ └─┴───────  high order 2 bits of track number
  1809.        └─┴─┴─┴─┴─┴─┴─┴──────────  low order 8 bits of track number
  1810. :int 13,d
  1811. ^INT 13,D - Alternate Disk Reset  (XT & newer)
  1812.  
  1813.     AH = 0D
  1814.     DL = fixed drive number  (80h=drive 0, 81h=drive 1)
  1815.  
  1816.  
  1817.     on return:
  1818.     AH = status  (see ~INT 13,STATUS~)
  1819.     CF = 0 if successful
  1820.        = 1 if error
  1821.  
  1822.  
  1823.     - many good programming references indicate this function is only
  1824.       available on the AT, PS/2 and later systems, but all hard disk
  1825.       systems since the XT have this function available
  1826.     - used to force drive recalibration similar to ~INT 13,0~
  1827.     - drive heads are positioned at track zero
  1828. :int 13,e
  1829. ^INT 13,E - Read Sector Buffer (XT & portable only)
  1830.  
  1831.  
  1832.     AH = 0E
  1833.  
  1834.  
  1835.     on return:
  1836.     AL = number of sectors actually transferred
  1837.     AH = status  (see ~INT 13,STATUS~)
  1838.     CF = 0 if successful
  1839.        = 1 if error
  1840. :int 13,f
  1841. ^INT 13,F - Write Sector Buffer (XT & portable only)
  1842.  
  1843.  
  1844.     AH = 0F
  1845.  
  1846.  
  1847.     on return:
  1848.     AL = number of sectors actually transferred
  1849.     AH = status  (see ~INT 13,STATUS~)
  1850.     CF = 0 if successful
  1851.        = 1 if error
  1852. :int 13,10
  1853. ^INT 13,10 - Test for Drive Ready (XT  & newer)
  1854.  
  1855.  
  1856.     AH = 10h
  1857.     DL = drive number (0=A:, 1=2nd floppy, 80h=drive 0, 81h=drive 1)
  1858.  
  1859.  
  1860.     on return:
  1861.     AH = status  (see ~INT 13,STATUS~)
  1862.     CF = 0 if successful
  1863.        = 1 if error
  1864.  
  1865.  
  1866.     - many good programming references indicate this function is only
  1867.       available on the AT, PS/2 and later systems, but all hard disk
  1868.       systems since the XT have this function available
  1869. :int 13,11
  1870. ^INT 13,11 - Recalibrate Drive (XT & newer)
  1871.  
  1872.  
  1873.     AH = 11h
  1874.     DL = drive number (0=A:, 1=2nd floppy, 80h=drive 0, 81h=drive 1)
  1875.  
  1876.  
  1877.     on return:
  1878.     AH = status  (see ~INT 13,STATUS~)
  1879.     CF = 0 if successful
  1880.        = 1 if error
  1881.  
  1882.  
  1883.     - many good programming references indicate this function is only
  1884.       available on the AT, PS/2 and later systems, but all hard disk
  1885.       systems since the XT have this function available
  1886. :int 13,12
  1887. ^INT 13,12 - Controller RAM Diagnostic (XT & portable only)
  1888.  
  1889.  
  1890.     AH = 12h
  1891.  
  1892.  
  1893.     on return:
  1894.     AH = status  (see ~INT 13,STATUS~)
  1895.     CF = 0 if successful
  1896.        = 1 if error
  1897. :int 13,13
  1898. ^INT 13,13 - Drive Diagnostic (XT & portable only)
  1899.  
  1900.  
  1901.     AH = 13h
  1902.  
  1903.  
  1904.     on return:
  1905.     AH = status  (see ~INT 13,STATUS~)
  1906.     CF = 0 if successful
  1907.        = 1 if error
  1908. :int 13,14
  1909. ^INT 13,14 - Controller Internal Diagnostic (XT & newer)
  1910.  
  1911.  
  1912.     AH = 14h
  1913.  
  1914.  
  1915.     on return:
  1916.     AH = status  (see ~INT 13,STATUS~)
  1917.     CF = 0 if successful
  1918.        = 1 if error
  1919.  
  1920.  
  1921.     - many good programming references indicate this function is only
  1922.       available on the AT, PS/2 and later systems, but all hard disk
  1923.       systems since the XT have this function available
  1924.     - not valid on PS/2 model 30
  1925. :int 13,15
  1926. ^INT 13,15 - Read DASD Type (XT BIOS from 1/10/86 & newer)
  1927.  
  1928.     AH = 15h
  1929.     DL = drive number (0=A:, 1=2nd floppy, 80h=drive 0, 81h=drive 1)
  1930.  
  1931.  
  1932.     on return:
  1933.     AH = 00 drive not present
  1934.        = 01 diskette, no change detection present
  1935.        = 02 diskette, change detection present
  1936.        = 03 fixed disk present
  1937.     CX:DX = number of fixed disk sectors; if 3 is returned in AH
  1938.     CF = 0 if successful
  1939.        = 1 if error
  1940.  
  1941.  
  1942.     - XT's must have a BIOS date 1/10/86 or newer
  1943.     - used to determine if ~INT 13,16~ can detect disk change
  1944.  
  1945.     - see    ~INT 13,STATUS~
  1946. :int 13,16
  1947. ^INT 13,16 - Change of Disk Status (XT BIOS from 1/10/86 & newer)
  1948.  
  1949.  
  1950.     AH = 16h
  1951.     DL = drive number (0=A:, 1=2nd floppy, 80h=drive 0, 81h=drive 1)
  1952.  
  1953.  
  1954.     on return:
  1955.     AH = 00 no disk change
  1956.        = 01 disk changed
  1957.     CF = set if disk has been removed or an error occurred
  1958.  
  1959.  
  1960.     - used to detect if a disk change has occurred
  1961.     - see    ~INT 13,STATUS~    ~INT 13,15~
  1962.  
  1963. :int 13,17
  1964. ^INT 13,17 - Set DASD Type for Format (XT BIOS from 1/10/86 & newer)
  1965.  
  1966.  
  1967.     AH = 17h
  1968.     AL = 00 no disk
  1969.        = 01  320k/360k diskette in 320k/360k drive
  1970.        = 02  320k/360k diskette in 1.2Mb drive
  1971.        = 03  1.2Mb diskette in 1.2Mb drive
  1972.        = 04  720k diskette in 720k drive  (BIOS 6/10/85 & newer)
  1973.          720K diskette in 1.44Mb drive (PS/2)
  1974.          1.44Mb diskette in 1.44Mb drive (PS/2)
  1975.     DL = drive number (0=A:, 1=2nd floppy, 80h=drive 0, 81h=drive 1)
  1976.  
  1977.  
  1978.     returns nothing
  1979.  
  1980.  
  1981.     - only the disk number is checked for validity
  1982.     - tells BIOS format routine about the disk type
  1983.  
  1984. :int 13,18
  1985. ^INT 13,18 - Set Media Type for Format (BIOS date specific)
  1986.  
  1987.  
  1988.     AH = 18h
  1989.     CH = lower 8 bits of number of tracks  (0-1023 dec., see below)
  1990.     CL = sectors per track (1-17 dec., see below)
  1991.     DL = drive number (0=A:, 1=2nd floppy, 80h=drive 0, 81h=drive 1)
  1992.  
  1993.  
  1994.     on return:
  1995.     ES:DI = pointer to 11-byte ~Disk Base Table~ (DBT)
  1996.     AH = 00h if requested combination supported
  1997.        = 01h if function not available
  1998.        = 0Ch if not supported or drive type unknown
  1999.        = 80h if there is no media in the drive
  2000.     CF = 0 if successful
  2001.        = 1 if error
  2002.  
  2003.  
  2004.     - valid only for XT BIOS dated after 1/10/86, AT after 11/15/86,
  2005.       XT 286 and the PS/2 line
  2006.     - only disk number is checked for validity
  2007.     - track number is a 10 bit value taken from the 2 high order
  2008.       bits of CL and the 8 bits in CH (low order 8 bits of track):
  2009.  
  2010.       │F│E│D│C│B│A│9│8│7│6│5│4│3│2│1│0│  CX
  2011.        │ │ │ │ │ │ │ │ │ │ └─┴─┴─┴─┴─┴────    sectors per track count
  2012.        │ │ │ │ │ │ │ │ └─┴────────────  high order 2 bits track/cyl count
  2013.        └─┴─┴─┴─┴─┴─┴─┴────────────    low order 8 bits of track/cyl count
  2014.  
  2015.     - see    ~INT 13,STATUS~   and   ~INT 1E~
  2016.  
  2017. :int 13,19
  2018. ^INT 13,19 - Park Fixed Disk Heads (AT & newer)
  2019.  
  2020.  
  2021.     AH = 19h
  2022.     DL = drive number (0=A:, 1=2nd floppy, 80h=drive 0, 81h=drive 1)
  2023.  
  2024.  
  2025.     on return:
  2026.     AH = status  (see ~INT 13,STATUS~)
  2027.     CF = 0 if successful
  2028.        = 1 if error
  2029.  
  2030.  
  2031.     - available only on AT, XT 283 and PS/2 machines
  2032. :int 13,1a
  2033. ^INT 13,1A - Format Unit (PS/2 model 50+)
  2034.  
  2035.     AH = 1Ah
  2036.     AL = defect table count
  2037.     DL = drive number (0=A:, 1=2nd floppy, 80h=drive 0, 81h=drive 1)
  2038.     ES:BX = far pointer to defect table
  2039.     CL = modifier bits
  2040.  
  2041.         │7│6│5│4│3│2│1│0│  Format Unit Modifier Bits
  2042.          │ │ │ │ │ │ │ └──── 1=ignore primary defect map, 0=use map
  2043.          │ │ │ │ │ │ └───── 1=ignore secondary defect map, 0=use map
  2044.          │ │ │ │ │ └────── 1=update secondary defect map, 0=don't
  2045.          │ │ │ │ └─────── 1=do extended surface analysis, 0=don't
  2046.          │ │ │ └──────── 1=periodic interrupt status on, 0=off
  2047.          └─┴─┴───────── reserved
  2048.  
  2049.     returns nothing
  2050.  
  2051.     - only the disk number is checked for validity
  2052.     - see    ~INT 13,STATUS~
  2053. :int 14:BIOS serial services:BIOS communications
  2054. ^INT 14 - BIOS Asynchronous Communications Services
  2055.  
  2056. %    For more information, see the following topics:
  2057.  
  2058.     ~INT 14,0~  Initialize serial port parameters
  2059.     ~INT 14,1~  Send character in AL
  2060.     ~INT 14,2~  Receive character in AL
  2061.     ~INT 14,3~  Get Serial port status
  2062.     ~INT 14,4~  Extended initialize  (PS/2)
  2063.     ~INT 14,5~  Extended communication port control (PS/2)
  2064.  
  2065.  
  2066.     - all functions have:
  2067.       AH = function number
  2068.       AL = character to send or receive
  2069.       DX = zero based RS232 card number
  2070.     - all registers are preserved except AX
  2071.     - these functions use hardware flow control
  2072.     - used by DOS MODE to redirect LPTx output to a serial device
  2073.     - see individual functions for more data
  2074.  
  2075.  
  2076. ^BIOS Asynchronous Communications Services (Status)
  2077.  
  2078.         │7│6│5│4│3│2│1│0│  AL  modem status
  2079.          │ │ │ │ │ │ │ └──── clear to send status changed
  2080.          │ │ │ │ │ │ └───── data set ready status changed
  2081.          │ │ │ │ │ └────── trailing edge ring indicator
  2082.          │ │ │ │ └─────── receive line signal changed
  2083.          │ │ │ └──────── clear to send
  2084.          │ │ └───────── data set ready
  2085.          │ └────────── ring indicator
  2086.          └─────────── receive line signal detected
  2087.  
  2088.         │7│6│5│4│3│2│1│0│  AH  port status
  2089.          │ │ │ │ │ │ │ └──── data ready
  2090.          │ │ │ │ │ │ └───── overrun error
  2091.          │ │ │ │ │ └────── parity error
  2092.          │ │ │ │ └─────── framing error
  2093.          │ │ │ └──────── break detect
  2094.          │ │ └───────── transmit holding register empty
  2095.          │ └────────── transmit shift register empty
  2096.          └─────────── time out (N/A for functions 1 and 2)
  2097.  
  2098. :int 14,0
  2099. ^INT 14,0 - Initialize Communications Port Parameters
  2100.  
  2101.     AH = 00
  2102.     AL = parms for initialization (see tables below)
  2103.     DX = zero based serial port number (0-1) (0-3 for AT)
  2104.  
  2105.     │7│6│5│4│3│2│1│0│  AL               Parity (bits 4 & 3)
  2106.      │ │ │ │ │ │ └─┴──── word length bits           00 = none
  2107.      │ │ │ │ │ └─────── stop bits flag           01 = odd
  2108.      │ │ │ └─┴──────── parity bits               10 = none
  2109.      └─┴─┴─────────── baud rate bits           11 = even
  2110.  
  2111. %    Word length (bits 1 & 0)        Stop bit count (bit 2)
  2112.  
  2113.        10 = 7 bits                  0 = 1 stop bit
  2114.        11 = 8 bits                  1 = 2 stop bits
  2115.  
  2116. %    Baud rate (bits 7, 6 & 5)
  2117.  
  2118.     000 = 110 baud        100 = 1200 baud
  2119.     001 = 150 baud        101 = 2400 baud
  2120.     010 = 300 baud        110 = 4800 baud
  2121.     011 = 600 baud        111 = 9600 baud (4800 on PCjr)
  2122.  
  2123.  
  2124.     on return:
  2125.     AH = port status
  2126.     AL = modem status
  2127.  
  2128.  
  2129.     - for status bits see ~INT 14,STATUS~
  2130.  
  2131. :int 14,1
  2132. ^INT 14,1 - Send Character to Communications Port
  2133.  
  2134.  
  2135.     AH = 01
  2136.     AL = character to send
  2137.     DX = zero based serial port number (0-1) (0-3 for AT)
  2138.  
  2139.  
  2140.     on return:
  2141.     AH = port status  (see ~INT 14,STATUS~)
  2142.          bit 7=0 indicates success
  2143.          bit 7=1 indicates error, bits 0-6 indicate cause
  2144.  
  2145.  
  2146.     - ~INT 14,3~ should be used to determine the actual cause
  2147.       of the error since the time-out bit of the status register
  2148.       is always set during an error on this call
  2149.     - uses hardware flow control
  2150. :int 14,2
  2151. ^INT 14,2 - Receive Character from Communications Port
  2152.  
  2153.     AH = 02
  2154.     DX = zero based serial port number (0-1) (0-3 for AT)
  2155.  
  2156.  
  2157.     on return:
  2158.     AH = port status  (see ~INT 14,STATUS~)
  2159.          bit 7 = 0 if successful
  2160.          bit 7 = 1 if call failed
  2161.     AL = character received if call was success
  2162.  
  2163.  
  2164.     - ~INT 14,3~ should be used to determine the actual cause of
  2165.       the error since the time-out bit of the status register is
  2166.       always set during an error on this call
  2167.     - uses hardware flow control
  2168. :int 14,3:int 14,status
  2169. ^INT 14,3 - Get Serial Port Status
  2170.  
  2171.  
  2172.     AH = 03
  2173.     DX = zero based serial port number (0-1) (0-3 for AT)
  2174.  
  2175.  
  2176.     on return:
  2177.     AH = port status
  2178.     AL = modem status
  2179.  
  2180.         │7│6│5│4│3│2│1│0│  AH  port status
  2181.          │ │ │ │ │ │ │ └──── data ready
  2182.          │ │ │ │ │ │ └───── overrun error
  2183.          │ │ │ │ │ └────── parity error
  2184.          │ │ │ │ └─────── framing error
  2185.          │ │ │ └──────── break detect
  2186.          │ │ └───────── transmit holding register empty (THRE)
  2187.          │ └────────── transmit shift register empty (TSRE)
  2188.          └─────────── time out (N/A for ~INT 14,1~ and ~INT 14,2~)
  2189.  
  2190.         │7│6│5│4│3│2│1│0│  AL  modem status
  2191.          │ │ │ │ │ │ │ └──── clear to send status changed
  2192.          │ │ │ │ │ │ └───── data set ready status changed
  2193.          │ │ │ │ │ └────── trailing edge ring indicator
  2194.          │ │ │ │ └─────── receive line signal changed
  2195.          │ │ │ └──────── clear to send
  2196.          │ │ └───────── data set ready
  2197.          │ └────────── ring indicator
  2198.          └─────────── receive line signal detected
  2199.  
  2200.     - the status check performs a poll of the port and does not
  2201.       perform character I/O
  2202.     - the earliest PC BIOS implementations incorrectly reported timeout
  2203.       (normally AH bit 7) as TSRE and Break Detect (bits 6 and 4)
  2204. :int 14,4
  2205. ^INT 14,4 - Serial Port Extended Initialization (PS/2 & later systems)
  2206.  
  2207.     AH = 04
  2208.     AL = break setting
  2209.     BH = parity setting
  2210.     BL = stop bit setting
  2211.     CH = word length setting
  2212.     CL = baud rate setting
  2213.     DX = zero based serial port number (0-3)
  2214.  
  2215. %             --- Break Setting ---
  2216.                   1 = break
  2217.                   0 = no break
  2218.  
  2219. %    ----- Parity Setting -----      --- Stop Bit Setting ---
  2220.  
  2221.        0 = no parity           0 = one stop bit
  2222.        1 = odd parity           1 = 2 stop bits
  2223.        2 = even parity               1½ if register CH=0
  2224.        3 = stick parity odd            (5 bit word length)
  2225.        4 = stick parity even
  2226.  
  2227. %    -- Word Length Setting --    ---- Baud rate Setting ----
  2228.  
  2229.            0 = 5 bits          0 = 110    5 = 2400
  2230.            1 = 6 bits          1 = 150    6 = 4800
  2231.            2 = 7 bits          2 = 300    7 = 9600
  2232.            3 = 8 bits          3 = 600    8 = 19200
  2233.                       4 = 1200
  2234.  
  2235.     on return:
  2236.     AH = port status
  2237.     AL = modem status
  2238.  
  2239.  
  2240.     - for status bits see ~INT 14,STATUS~
  2241.  
  2242. :int 14,5
  2243. ^INT 14,5 - Extended Communication Port Control (PS/2 & later systems)
  2244.  
  2245.     AH = 05
  2246.     AL = read or write modem control register
  2247.        = 00 read modem control register
  2248.        = 01 write modem control register
  2249.     DX = zero based serial port number (0-1) (0-3 for AT)
  2250.  
  2251.     BL = modem control register
  2252.  
  2253.         │7│6│5│4│3│2│1│0│    BL
  2254.          │ │ │ │ │ │ │ └──── 1 = activate data terminal ready
  2255.          │ │ │ │ │ │ └───── 1 = activate request to send
  2256.          │ │ │ │ │ └────── OUT1
  2257.          │ │ │ │ └─────── OUT2
  2258.          │ │ │ └──────── 0 = normal, 1 = loopback test
  2259.          └─┴─┴───────── reserved, forced to zero
  2260.  
  2261.     on return:
  2262.     AH = port status
  2263.     AL = modem status
  2264.     BL = ~UART~ modem control register
  2265.  
  2266.     - for status bits see ~INT 14,STATUS~
  2267.  
  2268. :int 15:BIOS system services:system interrupts
  2269. ^INT 15 - System BIOS Services
  2270.  
  2271. ^For more information see the following topics:
  2272.  
  2273.      ~INT 15,0~  Turn cassette motor on (PC,PCjr only)
  2274.      ~INT 15,1~  Turn cassette motor off (PC,PCjr only)
  2275.      ~INT 15,2~  Read blocks from cassette (PC,PCjr only)
  2276.      ~INT 15,3~  Write blocks to cassette (PC,PCjr only)
  2277.      ~INT 15,F~  PS/2 format periodic interrupt (PS/2 only)
  2278.     ~INT 15,20~  PRINT.COM Critical region flag (undocumented DOS 3.x+)
  2279.     ~INT 15,21~  PS/2 power on self test (PS/2 except 30)
  2280.     ~INT 15,40~  Read / modify profiles (convertible only)
  2281.     ~INT 15,41~  Wait on external event (convertible only)
  2282.     ~INT 15,42~  Request system power off (convertible only)
  2283.     ~INT 15,43~  Read system status (convertible only)
  2284.     ~INT 15,44~  (De)activate internal modem power (convertible)
  2285.     ~INT 15,4F~  Keyboard intercept  (BIOS date specific)
  2286.     ~INT 15,80~  Device open
  2287.     ~INT 15,81~  Device close
  2288.     ~INT 15,82~  Program termination
  2289.     ~INT 15,83~  Event wait
  2290.     ~INT 15,84~  Joy-Stick support
  2291.     ~INT 15,85~  System request key pressed
  2292.     ~INT 15,86~  Elapsed time wait (AT and after)
  2293.     ~INT 15,87~  Move block to/from extended memory
  2294.     ~INT 15,88~  Extended memory size determination
  2295.     ~INT 15,89~  Switch processor to protected mode
  2296.     ~INT 15,90~  Device busy
  2297.     ~INT 15,91~  Interrupt complete
  2298.     ~INT 15,C0~  Return system configuration parameters (PS/2 only)
  2299.     ~INT 15,C1~  Return extended BIOS data address (PS/2 only)
  2300.     ~INT 15,C2~  Pointing device BIOS interface (PS/2 only)
  2301.     ~INT 15,C3~  Enable/Disable watchdog timer
  2302.     ~INT 15,C4~  Programmable option select
  2303.  
  2304.  
  2305.     - CF is set and AX is left unchanged if a function requested in AH
  2306.       isn't supported
  2307.     - some Tandy BIOS's fail to restore interrupts on return from INT 15
  2308.  
  2309. :int 15,0
  2310. ^INT 15,0 - Turn Cassette Motor On (PC,PCjr only)
  2311.  
  2312.  
  2313.     AH = 00
  2314.  
  2315.  
  2316.     - all programs using the cassette must actually turn on
  2317.       the device before use
  2318.     - there is a noticeable delay between turn-on and device ready
  2319.     - a noticeable clicking noise can be heard by switching the
  2320.       cassette on and off
  2321.  
  2322.     - see ~INT 15,1~
  2323.  
  2324. :int 15,1
  2325. ^INT 15,1 - Turn Cassette Motor Off (PC,PCjr only)
  2326.  
  2327.  
  2328.     AH = 01
  2329.  
  2330.  
  2331.     - all programs using the cassette should turn off
  2332.       the device after use
  2333.     - a noticeable clicking noise can be heard by switching the
  2334.       cassette on and off
  2335.  
  2336.     - see  ~INT 15,0~
  2337.  
  2338. :int 15,2
  2339. ^INT 15,2 - Read Blocks from Cassette (PC,PCjr only)
  2340.  
  2341.     AH = 02
  2342.     CX = count of bytes to read
  2343.     ES:BX = pointer to data buffer
  2344.  
  2345.  
  2346.     on return:
  2347.  
  2348.     AH = error code if CF=1
  2349.        = 1    if CRC error
  2350.        = 2    data transition lost, (bit signal scrambled)
  2351.        = 3    no data found on tape
  2352.  
  2353.     DX = count of bytes actually read
  2354.     ES:BX = pointer to byte following last byte read
  2355.  
  2356.  
  2357.     - data is transferred in 256 byte blocks, though only the
  2358.       number of bytes requested are actually stored
  2359.  
  2360. :int 15,3
  2361. ^INT 15,3 - Write Blocks to Cassette (PC,PCjr only)
  2362.  
  2363.  
  2364.     AH = 03
  2365.     CX = count of bytes to write
  2366.     ES:BX = pointer to data buffer
  2367.  
  2368.  
  2369.     on return:
  2370.  
  2371.     CX = zero
  2372.     ES:BX = pointer to byte following last byte written
  2373.  
  2374.  
  2375.     - data is actually written in 256 byte blocks
  2376.     - if CX is less than 256, then the block is padded
  2377.     - no error detection/correction is available for writing
  2378.  
  2379. :int 15,f
  2380. ^INT 15,F - Format Periodic Interrupt (PS/2 only)
  2381.  
  2382.     AH = 0F
  2383.     AL = phase code
  2384.        = 00  reserved
  2385.        = 01  surface analysis
  2386.        = 02  formatting
  2387.  
  2388.     on return:
  2389.     CF = 0 continue formatting/scanning
  2390.        = 1 end of format/scanning
  2391.  
  2392.     - after formatting/scanning each cylinder the formatting
  2393.       routine calls this interrupt
  2394.     - may be used by a program to gain control after formatting
  2395.       a cylinder
  2396.     - if invoked from a non-PS/2 CF=1 and AH contains the following
  2397.       AH = 80h  for PC and PCjr
  2398.          = 86h  on most other machines
  2399. :int 15,20
  2400. ^INT 15,20 - PRINT.COM Critical Region Flag (undocumented DOS 3.x+)
  2401.  
  2402.     AH = 20h
  2403.     AL = 00  disable user critical region flag
  2404.        = 01  enable user critical region flag
  2405.     ES:BX = pointer to user critical region flag byte (AH = 1)
  2406.  
  2407.  
  2408.     returns nothing
  2409.  
  2410.  
  2411.     - provides PRINT.COM with the address of a byte to increment on
  2412.       entry to DOS functions
  2413.     - see ~bibliography~ reference for "Undocumented DOS"
  2414. :int 15,21
  2415. ^INT 15,21 - Power On Self Test (POST) Error Log  (PS/2 except 30)
  2416.  
  2417.     AH = 21h
  2418.     AL = 00 read POST error log
  2419.        = 01 write error code to POST error log
  2420.     BH = Device code  (if write)
  2421.     BL = Device error  (if write)
  2422.  
  2423.     on return
  2424.     CF = 0 if successful
  2425.        = 1 if in error (AH contains code)
  2426.  
  2427. %    if reading POST error log:
  2428.        AH = 00h if successful
  2429.           = 80h (PCjr and PC)     = 86h for all other machines
  2430.        BX = number of POST error codes stored
  2431.        ES:DI pointer to POST error log
  2432.  
  2433. %    if writing POST error log:
  2434.        AH = 00h if successful     = 01 POST error log full
  2435.           = 80h (PCjr and PC)     = 86h for all other machines
  2436. :int 15,40
  2437. ^INT 15,40 - Read / Modify Profiles (convertible only)
  2438.  
  2439.  
  2440.     AH = 40h
  2441.  
  2442.     AL = 00 - return system profile in CX,BX
  2443.          01 - modify system profile
  2444.          CX,BX = profile info
  2445.  
  2446.  
  2447.     AL = 02 - return internal modem profile in BX
  2448.  
  2449.  
  2450.     AL = 03 - modify internal modem profile
  2451.          BX = profile info
  2452.  
  2453. :int 15,41
  2454. ^INT 15,41 - Wait on External Event (convertible only)
  2455.  
  2456.     AH = 41h
  2457.     AL = condition type:
  2458.  
  2459.         │7│6│5│4│3│2│1│0│  AL
  2460.          │ │ │ │ │ └─┴─┴──── conditions (codes) to wait for
  2461.          │ │ │ │ └───────── reserved
  2462.          │ │ │ └────────── 1=port address/0=user byte
  2463.          └─┴─┴─────────── reserved
  2464.  
  2465. %    Condition codes:
  2466.  
  2467.          0 = any external event
  2468.          1 = compare and return if equal
  2469.          2 = compare and return if not equal
  2470.          3 = test and return if not zero
  2471.          4 = test and return if zero
  2472.  
  2473.     BH = condition compare or mask value
  2474.     BL = time-out value times 55 ms, 0 if no time limit
  2475.     DX = I/O port address (if AL bit 4 = 1)
  2476.     ES:DI = pointer to user byte (if AL bit 4 = 0)
  2477.  
  2478. :int 15,42
  2479. ^INT 15,42 - Request System Power Off (convertible only)
  2480.  
  2481.  
  2482.     AH = 42h
  2483.  
  2484.     AL = 00 to use system profile
  2485.        = 01 to force suspend regardless of profile
  2486.  
  2487. :int 15,43
  2488. ^INT 15,43 - Read System Status (convertible only)
  2489.  
  2490.  
  2491.     AH = 43h
  2492.  
  2493.  
  2494.     on return
  2495.     AL = STATUS:
  2496.  
  2497.         │7│6│5│4│3│2│1│0│  AL
  2498.          │ │ │ │ │ │ │ └──── LCD detached
  2499.          │ │ │ │ │ │ └───── reserved
  2500.          │ │ │ │ │ └────── RS232/parallel powered on
  2501.          │ │ │ │ └─────── internal modem powered on
  2502.          │ │ │ └──────── power activated by alarm
  2503.          │ │ └───────── standby power lost
  2504.          │ └────────── external power in use
  2505.          └─────────── battery low
  2506.  
  2507. :int 15,44
  2508. ^INT 15,44 - (De)activate Internal Modem Power (convertible)
  2509.  
  2510.  
  2511.     AH = 44h
  2512.  
  2513.     AL = 00 to power off
  2514.        = 01 to power on
  2515.  
  2516. :int 15,4f
  2517. ^INT 15,4F - Keyboard Intercept  (BIOS date specific)
  2518.  
  2519.     AH = 4F
  2520.     AL = scan code
  2521.     CF = set to 1 (via STC instruction)
  2522.  
  2523.     on return
  2524.  
  2525.     AH = 80h, CF set  (PC, PCjr)
  2526.        = 86h, CF set  (XT BIOS 11/8/82, AT BIOS 1/10/84)
  2527.     AL = CF set, new scan code
  2528.        = CF clear, original scancode
  2529.  
  2530.  
  2531.     - available with XT BIOS after 11/8/82, AT BIOS after 1/10/84
  2532.     - called by ~INT 9~, makes allowance for keyboard translation
  2533.     - normally returns the scan code in AL, with CF set
  2534.     - if function returns with CF clear, INT 9 ignores keystroke
  2535.     - do not rely on this function being called for each INT 9 since
  2536.       any user INT 9 handler can exit prematurely and circumvent
  2537.       this function
  2538. :int 15,80
  2539. ^INT 15,80 - Device Open
  2540.  
  2541.  
  2542.     AH = 80h
  2543.     BX = device id
  2544.     CX = process id
  2545.  
  2546.  
  2547.     on return:
  2548.     CF = 0 if successful
  2549.        = 1 if error
  2550.     AH = 80h for PC & PCjr
  2551.        = 86h for XT (BIOS after 11/8/82)
  2552.  
  2553.  
  2554.     - available on the AT, XT 286, PS/2 and XT with BIOS after 11/8/82
  2555.     - designed for use in simple multitasking
  2556.  
  2557. :int 15,81
  2558. ^INT 15,81 - Device Close
  2559.  
  2560.  
  2561.     AH = 81h
  2562.     BX = device id
  2563.     CX = process id
  2564.  
  2565.  
  2566.     on return:
  2567.     CF = 0 if successful
  2568.        = 1 if error
  2569.     AH = 80h for PC & PCjr
  2570.        = 86h for XT (BIOS after 11/8/82)
  2571.  
  2572.  
  2573.     - available on the AT, XT 286, PS/2 and XT with BIOS after 11/8/82
  2574.     - designed for use in simple multitasking
  2575.  
  2576. :int 15,82
  2577. ^INT 15,82 - Program Termination
  2578.  
  2579.  
  2580.     AH = 82h
  2581.     BX = device id
  2582.  
  2583.  
  2584.     on return:
  2585.     CF = 0 if successful
  2586.        = 1 if error
  2587.     AH = 80h for PC & PCjr
  2588.        = 86h for XT (BIOS after 11/8/82)
  2589.  
  2590.  
  2591.     - available on the AT, XT 286, PS/2 and XT with BIOS after 11/8/82
  2592.     - designed for use in simple multitasking
  2593.  
  2594. :int 15,83
  2595. ^INT 15,83 - Event Wait
  2596.  
  2597.  
  2598.     AH = 83h
  2599.     AL = 0    set interval
  2600.        = 1    cancel interval (PS/2)
  2601.     CX,DX = number of microseconds to wait (976 µs resolution)
  2602.     ES:BX = pointer to memory flag (bit 7 is set
  2603.         when interval expires)
  2604.             (granularity is 976 microseconds)
  2605.  
  2606.  
  2607.     on return:
  2608.     CF = 1 if function already busy
  2609.     AH = 80h for PC
  2610.        = 86h for XT & AT
  2611.  
  2612.  
  2613.     - available on the AT (BIOS after 1/10/84) and PS/2's except 30
  2614.     - designed for use in simple multitasking
  2615.  
  2616. :int 15,84
  2617. ^INT 15,84 - Joy-Stick Support
  2618.  
  2619.  
  2620.     AH = 84h
  2621.     DX = 0 to read the current switch settings
  2622.        = 1 to read the ~joystick~ position (resistive inputs)
  2623.  
  2624.  
  2625.     on return (DX=0, read switch setting):
  2626.     CF = 0 if successful
  2627.        = 1 if error
  2628.     AH = 80h error code if CF set on PC
  2629.        = 86h error code if CF set on XT before 11/8/82
  2630.     AL = switch settings in bits 7-4 (if read switch function)
  2631.  
  2632.     on return (DX=1, read joystick position):
  2633.     AX = A(X)
  2634.     BX = A(Y)
  2635.     CX = B(X)
  2636.     DX = B(Y)
  2637.  
  2638. :int 15,85
  2639. ^INT 15,85 - System Request Key Pressed
  2640.  
  2641.  
  2642.     AH = 85h
  2643.     AL = 00 key pressed
  2644.        = 01 key released
  2645.  
  2646.  
  2647.     on return:
  2648.     CF = 0 if successful
  2649.        = 1 if error
  2650.     AH = 80h for PC or PCjr
  2651.        = 86h for XT (BIOS after 11/8/82)
  2652.  
  2653.  
  2654.     - called by BIOS when the System Request key is pressed/released
  2655.     - available on machines with newer BIOS and keyboards
  2656.  
  2657. :int 15,86
  2658. ^INT 15,86 - Elapsed Time Wait (AT and PS/2)
  2659.  
  2660.  
  2661.     AH = 86h
  2662.     CX,DX = number of microseconds to wait (976 µs resolution)
  2663.  
  2664.  
  2665.     on return:
  2666.     CF = set if error (PC,PCjr,XT)
  2667.        = set if wait in progress
  2668.        = clear if successful wait
  2669.     AH = 80h for PC and PCjr
  2670.        = 86h for XT
  2671.  
  2672.  
  2673.     - AT and PS/2 only for system timing
  2674.     - not designed for user application usage
  2675.  
  2676. :int 15,87
  2677. ^INT 15,87 - Move Block to/from Extended Memory
  2678.  
  2679.     AH = 87h
  2680.     CX = word count of block to be moved
  2681.     ES:SI = pointer to Global Descriptor Table (~GDT~)
  2682.  
  2683.  
  2684.     on return:
  2685.     CF = 0    if successful (AH contains return code)
  2686.        = 1    if error detected
  2687.     AH = 0    operation successful (ZF also set)
  2688.        = 1    RAM parity error  (if CF set)
  2689.        = 2    other exception (if CF set)
  2690.        = 3    gate address on line 20h failed (if CF set)
  2691.        = 80h on PC and PCjr (if CF set)
  2692.        = 86h on XT and newer 808x machines (if CF set)
  2693.  
  2694.     - transfers data blocks to and from extended memory on 80286
  2695.       and 80386 machines by switching from real to protected mode
  2696.       for the duration of the transfer
  2697.     - all real mode interrupts are disabled
  2698.     - processor shuts down during the switch from protected mode
  2699.       to real mode on 286 processors
  2700. :int 15,88
  2701. ^INT 15,88 - Extended Memory Size Determination
  2702.  
  2703.  
  2704.     AH = 88h
  2705.  
  2706.  
  2707.     on return:
  2708.     CF = 80h for PC, PCjr
  2709.        = 86h for XT and Model 30
  2710.        = other machines, set for error, clear for success
  2711.     AX = number of contiguous 1k blocks of memory starting
  2712.          at address 1024k (100000h)
  2713.  
  2714.  
  2715.     - works only on 80286 and 80386 machines
  2716.     - retrieves bytes 30 and 31 from the ~CMOS~ RAM (this data is set
  2717.       by the boot memory scan
  2718. :int 15,89
  2719. ^INT 15,89 - Switch Processor to Protected Mode
  2720.  
  2721.     AH = 89h
  2722.     BH = IRQ8 interrupt vector offset
  2723.     BL = IRQ0 interrupt vector offset
  2724.     CX = offset into protected mode CS to jump
  2725.     ES:SI = pointer to Global Descriptor Table (~GDT~)
  2726.  
  2727.  
  2728.     on return:
  2729.     CF = 0 if successful
  2730.        = 1 if error
  2731.  
  2732.     - switches 286 and 386 machines into protected mode to take
  2733.       advantage of advanced feature and extended memory
  2734.     - Global descriptor table must be setup before interrupt
  2735.     - normal BIOS functions are not available after the switch
  2736. :int 15,90
  2737. ^INT 15,90 - Device Busy
  2738.  
  2739.     AH = 90h
  2740.     AL = type code:
  2741.        = 00  disk
  2742.        = 01  diskette
  2743.        = 02  keyboard
  2744.        = 03  pointing device
  2745.        = 80  network (ES:BX = NCB)
  2746.        = FC  fixed disk reset (PS/2)
  2747.        = FD  diskette motor start
  2748.        = FE  printer
  2749.     ES:BX = pointer to network control block if waiting for network
  2750.  
  2751.     on return:
  2752.     CF = 0 if wait not satisfied
  2753.        = 1 if wait time satisfied
  2754.     AH = when CF set, 80h for PC & PCjr, 86h for XT (BIOS 11/8/82)
  2755.  
  2756.     - tells the OS a a program is about to wait for a device
  2757.     - used for multitasking OS development
  2758. :int 15,91
  2759. ^INT 15,91 - Interrupt Complete
  2760.  
  2761.     AH = 91h
  2762.  
  2763.     on return:
  2764.     CF = 0 if successful
  2765.        = 1 if error
  2766.     AH = when CF set, 80h for PC & PCjr, 86h for XT (BIOS 11/8/82)
  2767.     AL = type code:
  2768.        = 00  disk
  2769.        = 01  diskette
  2770.        = 02  keyboard
  2771.        = 03  pointing device
  2772.        = 80  network (ES:BX = NCB)
  2773.        = FC  fixed disk reset (PS/2)
  2774.        = FD  diskette motor start
  2775.        = FE  printer
  2776.  
  2777.     - should not be used by applications software
  2778.     - used by the BIOS to indicate device interrupt is complete
  2779.     - used for multitasking OS development
  2780. :int 15,c0
  2781. ^INT 15,C0 - Return System Configuration Parameters (PS/2 only)
  2782.  
  2783.     AH = C0
  2784.  
  2785.     on return:
  2786.     CF = 0 if successful
  2787.        = 1 if error
  2788.     AH = when CF set, 80h for PC & PCjr, 86h for XT
  2789.          (BIOS after 11/8/82) and AT (BIOS after 1/10/84)
  2790.  
  2791.     ES:BX = pointer to system descriptor table in ROM of the format:
  2792.  
  2793. %    Offset Size         Description
  2794.  
  2795.       00   word   length of descriptor (8 minimum)
  2796.       02   byte   model byte (same as F000:FFFE, not reliable)
  2797.       03   byte   secondary model byte
  2798.       04   byte   BIOS revision level (zero based)
  2799.       05   byte   feature information, see below
  2800.       06   dword  reserved
  2801.  
  2802.  
  2803. %    Feature Information
  2804.  
  2805.     │7│6│5│4│3│2│1│0│  Feature Byte
  2806.      │ │ │ │ │ │ │ └──── reserved
  2807.      │ │ │ │ │ │ └───── 0=PC bus, 1=Micro Channel
  2808.      │ │ │ │ │ └────── Extended BIOS Data Area (~EBDA~)allocated
  2809.      │ │ │ │ └─────── wait for external event supported
  2810.      │ │ │ └──────── ~INT 15,4F~ used (kbd intercept)
  2811.      │ │ └───────── ~RTC~ present
  2812.      │ └────────── 2nd ~8259~ present
  2813.      └─────────── DMA channel 3 used by fixed disk BIOS
  2814.  
  2815.     - see    ~MACHINE ID~
  2816.  
  2817. :int 15,c1
  2818. ^INT 15,C1 - Return Extended BIOS Data Area Segment (PS/2 only)
  2819.  
  2820.  
  2821.     AH = C1
  2822.  
  2823.  
  2824.     on return:
  2825.     CF = 0 if successful
  2826.        = 1 if error
  2827.     AH = when CF set, 80h for PC & PCjr, 86h for XT (BIOS 11/8/82)
  2828.     ES = ~EBDA~ segment address if PS/2
  2829.  
  2830.  
  2831.     - the EBDA is used internally by the PS/2 BIOS routines
  2832.     - the EBDA is allocated at the top of user memory by the ~POST~
  2833.       routine
  2834.  
  2835. :int 15,c2
  2836. ^INT 15,C2 - Pointing Device BIOS Interface  (PS/2 only)
  2837.  
  2838.     AH = C2
  2839.     AL = 0    enable/disable pointing device (BH contains flag)
  2840.        = 1    reset pointing device
  2841.        = 2    set sample rate
  2842.        = 3    set resolution
  2843.        = 4    read device type
  2844.        = 5    pointing device initialization
  2845.        = 6    extended commands
  2846.        = 7    pointing device far call initialization
  2847.     BH = 0 indicates enable for AL = 0
  2848.        = 1 indicates disable for AL = 0
  2849.  
  2850.  
  2851.     on return:
  2852.     CF = 0 if successful
  2853.        = 1 if error
  2854.     AH = when CF set, 80h for PC & PCjr, 86h for XT, AT
  2855.        = 01  invalid function call
  2856.        = 02  invalid input
  2857.        = 03  interface error
  2858.        = 04  resend
  2859.        = 05  no far call installed
  2860.  
  2861. :int 15,c3
  2862. ^INT 15,C3 - Enable/Disable Watchdog Timer  (PS/2)
  2863.  
  2864.     AH = C3
  2865.     AL = 0    disable watchdog time-out
  2866.        = 1    enable watchdog time-out
  2867.     BX = watchdog timer count (1-255)
  2868.  
  2869.     on return:
  2870.     CF = 0 if successful
  2871.        = 1 if error
  2872.     AH = when CF set, 80h for PC & PCjr, 86h for XT, AT & Model 30
  2873.  
  2874.  
  2875.     - the watchdog timer is available only on PS/2 with 80286 and
  2876.       80386 processors.
  2877.     - the ~timer~ uses channel timer channel 3 and IRQ0.  Activated
  2878.       when IRQ0 is active for more than one channel 0 timer cycle,
  2879.       which causes the timer to be decremented.   When the watch-
  2880.       dog timer reaches 0, and NMI is generated.
  2881. :int 15,c4
  2882. ^INT 15,C4 - Programmable Option Select  (PS/2)
  2883.  
  2884.     AH = C4
  2885.     AL = 0    get Programmable Option Select adapter register address
  2886.        = 1    enable slot for setup
  2887.        = 2    adapter enable
  2888.  
  2889.  
  2890.     on return:
  2891.     CF = 0 if successful
  2892.        = 1 if error
  2893.     AH = when CF set, 80h for PC & PCjr, 86h for XT, AT & 30
  2894.     BL = slot number (function AL=1)
  2895.     DL = POS adapter register address (function AL=0)
  2896.  
  2897.  
  2898.     - allows access to PS/2 Programmable Option Select registers
  2899.     - available on 80286 and 80386 PS/2's
  2900.  
  2901. :int 16:BIOS keyboard services
  2902. ^INT 16 - Keyboard BIOS Services
  2903.  
  2904.  
  2905. ^For more information, see the following topics:
  2906.  
  2907.     ~INT 16,0~   Wait for keystroke and read
  2908.     ~INT 16,1~   Get keystroke status
  2909.     ~INT 16,2~   Get shift status
  2910.     ~INT 16,3~   Set keyboard typematic rate (AT+)
  2911.     ~INT 16,4~   Keyboard click adjustment (AT+)
  2912.     ~INT 16,5~   Keyboard buffer write  (AT,PS/2 enhanced keyboards)
  2913.     ~INT 16,10~  Wait for keystroke and read  (AT,PS/2 enhanced keyboards)
  2914.     ~INT 16,11~  Get keystroke status  (AT,PS/2 enhanced keyboards)
  2915.     ~INT 16,12~  Get shift status  (AT,PS/2 enhanced keyboards)
  2916.  
  2917.  
  2918.     - with IBM BIOS's, INT 16 functions do not restore the flags to
  2919.       the pre-interrupt state to allow returning of information via
  2920.       the flags register
  2921.     - functions 3 through 12h are not available on all AT machines
  2922.       unless the extended keyboard BIOS is present.  See ~DETECT~ for
  2923.       information on detecting the extended keyboard BIOS
  2924.     - all registers are preserved except AX and FLAGS
  2925.     - see    ~SCAN CODES~
  2926. :int 16,0
  2927. ^INT 16,0 - Wait for Keypress and Read Character
  2928.  
  2929.  
  2930.     AH = 00
  2931.  
  2932.  
  2933.     on return:
  2934.     AH = keyboard scan code
  2935.     AL = ASCII character or zero if special function key
  2936.  
  2937.  
  2938.     - halts program until key with a scancode is pressed
  2939.     - see  ~SCAN CODES~
  2940.  
  2941. :int 16,1
  2942. ^INT 16,1 - Get Keyboard Status
  2943.  
  2944.  
  2945.     AH = 01
  2946.  
  2947.  
  2948.     on return:
  2949.     ZF = 0 if a key pressed (even Ctrl-Break)
  2950.     AX = 0 if no scan code is available
  2951.     AH = ~scan code~
  2952.     AL = ASCII character or zero if special function key
  2953.  
  2954.  
  2955.     - data code is not removed from buffer
  2956.     - ~Ctrl-Break~ places a zero word in the keyboard buffer but does
  2957.       register a keypress.
  2958. :int 16,2
  2959. ^INT 16,2 - Read Keyboard Flags
  2960.  
  2961.     AH = 02
  2962.  
  2963.  
  2964.     on return:
  2965.     AL = BIOS keyboard flags (located in ~BIOS Data Area~ 40:17)
  2966.  
  2967.         │7│6│5│4│3│2│1│0│  AL or BIOS Data Area 40:17
  2968.          │ │ │ │ │ │ │ └──── right shift key depressed
  2969.          │ │ │ │ │ │ └───── left shift key depressed
  2970.          │ │ │ │ │ └────── CTRL key depressed
  2971.          │ │ │ │ └─────── ALT key depressed
  2972.          │ │ │ └──────── scroll-lock is active
  2973.          │ │ └───────── num-lock is active
  2974.          │ └────────── caps-lock is active
  2975.          └─────────── insert is active
  2976. :int 16,3
  2977. ^INT 16,3 - Set Keyboard Typematic Rate  (AT+)
  2978.  
  2979.     AH = 03
  2980.     AL = 00  set typematic rate to default
  2981.          01  increase initial delay
  2982.          02  slow typematic rate by 1/2
  2983.          04  turn off typematic chars
  2984.          05  set typematic rate/delay
  2985.  
  2986.     BH = repeat delay (AL=5)
  2987.          0 = 250ms       2 = 750ms
  2988.          1 = 500ms       3 = 1000ms
  2989.     BL = typematic rate, one of the following  (AL=5)
  2990.  
  2991.          00 - 30.0        01 - 26.7       02 - 24.0      03 - 21.8
  2992.          04 - 20.0        05 - 18.5       06 - 17.1      07 - 16.0
  2993.          08 - 15.0        09 - 13.3       0A - 12.0      0B - 10.9
  2994.          0C - 10.0        0D - 9.2       0E - 8.6      0F - 8.0
  2995.          10 - 7.5        11 - 6.7       12 - 6.0      13 - 5.5
  2996.          14 - 5.0        15 - 4.6       16 - 4.3      17 - 4.0
  2997.          18 - 3.7        19 - 3.3       1A - 3.0      1B - 2.7
  2998.          1C - 2.5        1D - 2.3       1E - 2.1      1F - 2.0
  2999.  
  3000.     returns nothing
  3001.  
  3002.     - if the typematic rate is not within range,no action is taken
  3003.     - available on AT and PS/2 machines with extended keyboard support
  3004.     - see ~DETECT~ for information on detecting the extended keyboard BIOS
  3005.     - see    ~KEYBOARD COMMANDS~
  3006. :int 16,4
  3007. ^INT 16,4 - Keyboard Click Adjustment (AT+)
  3008.  
  3009.  
  3010.     AH = 04
  3011.     AL = 1 for click on
  3012.        = 0 for click off
  3013.  
  3014.  
  3015.     - available only on AT and later machines that support the extended
  3016.       keyboard BIOS
  3017.     - see ~DETECT~ for information on detecting the extended keyboard BIOS
  3018.  
  3019. :int 16,5
  3020. ^INT 16,5 - Keyboard Buffer Write  (AT+)
  3021.  
  3022.  
  3023.     AH = 05
  3024.     CH = ~scan code~
  3025.     CL = ASCII character
  3026.  
  3027.  
  3028.     on return:
  3029.     AL = 00 if success
  3030.          01 if buffer full
  3031.  
  3032.  
  3033.     - available on AT and PS/2 machines with extended keyboard support
  3034.     - stores normal keystroke into keyboard buffer
  3035.     - will not store attribute keys like Shift, Alt, Ctrl, etc...
  3036.     - see ~DETECT~ for information on detecting the extended keyboard BIOS
  3037.  
  3038. :int 16,10
  3039. ^INT 16,10 - Extended Wait for Keypress and Read Character  (AT+)
  3040.  
  3041.  
  3042.     AH = 10h
  3043.  
  3044.  
  3045.     on return:
  3046.     AH = ~scan code~
  3047.     AL = ASCII character or zero if special function key
  3048.  
  3049.  
  3050.     - available on AT and PS/2 machines with extended keyboard support
  3051.     - similar to ~INT 16,0~
  3052.     - see ~DETECT~ for information on detecting the extended keyboard BIOS
  3053.  
  3054. :int 16,11
  3055. ^INT 16,11 - Extended Get Keyboard Status  (AT+)
  3056.  
  3057.  
  3058.     AH = 11h
  3059.  
  3060.  
  3061.     on return:
  3062.     ZF = 0 if key pressed (data waiting)
  3063.     AX = 0 if no scan code is available
  3064.     AH = ~scan code~
  3065.     AL = ASCII character or zero if special function key
  3066.  
  3067.  
  3068.     - available on AT and PS/2 machines with extended keyboard support
  3069.     - see ~DETECT~ for information on detecting the extended keyboard BIOS
  3070.     - data is not removed from buffer
  3071.     - similar to ~INT 16,1~
  3072.  
  3073. :int 16,12
  3074. ^INT 16,12 - Extended Get Keyboard Status  (AT+)
  3075.  
  3076.     AH = 12h
  3077.  
  3078.     on return:
  3079.     AH = BIOS keyboard flags (~BIOS Data Area~ location 40:18)
  3080.  
  3081.         │7│6│5│4│3│2│1│0│  AH
  3082.          │ │ │ │ │ │ │ └──── left CTRL key depressed
  3083.          │ │ │ │ │ │ └───── left ALT key depressed
  3084.          │ │ │ │ │ └────── right CTRL key pressed
  3085.          │ │ │ │ └─────── right ALT key depressed
  3086.          │ │ │ └──────── scroll-lock depressed
  3087.          │ │ └───────── num-lock key depressed
  3088.          │ └────────── caps-lock key depressed
  3089.          └─────────── system request key depressed
  3090.  
  3091.     AL = BIOS keyboard flags (BIOS Data Area location 40:17)
  3092.  
  3093.         │7│6│5│4│3│2│1│0│  AL
  3094.          │ │ │ │ │ │ │ └──── right shift key depressed
  3095.          │ │ │ │ │ │ └───── left shift key depressed
  3096.          │ │ │ │ │ └────── CTRL key depressed
  3097.          │ │ │ │ └─────── ALT key depressed
  3098.          │ │ │ └──────── scroll-lock is active
  3099.          │ │ └───────── num-lock is active
  3100.          │ └────────── caps-lock is active
  3101.          └─────────── insert is active
  3102.  
  3103.  
  3104.     - available on AT and PS/2 machines with extended keyboard support
  3105.     - see ~DETECT~ for information on detecting the extended keyboard BIOS
  3106.     - similar to ~INT 16,2~
  3107.  
  3108.     - see    ~KB FLAGS~
  3109.  
  3110. :int 17:BIOS printer services:int 17,status:printer status
  3111. ^INT 17 - Printer BIOS Services
  3112.  
  3113. %    For more information, see the following topics:
  3114.  
  3115.     ~INT 17,0~   Print character
  3116.     ~INT 17,1~   Initialize printer port
  3117.     ~INT 17,2~   Read printer port status
  3118.  
  3119.     Status flags returned in register AH
  3120.  
  3121.     │7│6│5│4│3│2│1│0│  AH (status)
  3122.      │ │ │ │ │ │ │ └────  time-out
  3123.      │ │ │ │ │ └─┴─────  unused
  3124.      │ │ │ │ └────────  1 = I/O error  (~parallel~ pin 15)
  3125.      │ │ │ └─────────  1 = printer selected/on-line  (parallel pin 13)
  3126.      │ │ └──────────  1 = out of paper  (parallel pin 12)
  3127.      │ └───────────  1 = printer acknowledgment  (parallel pin 10)
  3128.      └────────────    1 = printer not busy  (parallel pin 11)
  3129.  
  3130.     - on the AT, XT 286, and PS/2 when the BIOS determines the printer
  3131.       is busy,  ~INT 15,90~  is executed
  3132.     - all printers do not return reliable status information;  bit 3 and
  3133.       bit 7 are usually reliable.
  3134.     - all registers are preserved except AH
  3135. :int 17,0
  3136. ^INT 17,0 - Print Character
  3137.  
  3138.  
  3139.     AH = 00
  3140.     AL = character to print
  3141.     DX = printer to be used (0-2)
  3142.  
  3143.  
  3144.     on return:
  3145.     AH = printer status, see ~INT 17,STATUS~
  3146.  
  3147.  
  3148.     - writes character and returns status
  3149. :int 17,1
  3150. ^INT 17,1 - Initialize Printer Port
  3151.  
  3152.  
  3153.     AH = 01
  3154.     DX = printer port to initialize (0-2)
  3155.  
  3156.  
  3157.     on return:
  3158.     AH = status, see ~INT 17,STATUS~
  3159.  
  3160.  
  3161.     - initializes printer port and returns status
  3162.     - outputs characters 0x08 and 0x0C to printer port which
  3163.       reset ~Epson~ and IBM printers, but may produce undesirable
  3164.       effects on other printers
  3165.  
  3166. :int 17,2
  3167. ^INT 17,2 - Read Printer Port Status
  3168.  
  3169.     AH = 02
  3170.     DX = printer port to be used (0-2)
  3171.  
  3172.  
  3173.     on return:
  3174.     AH = status:
  3175.  
  3176.         │7│6│5│4│3│2│1│0│  Printer status bits
  3177.          │ │ │ │ │ │ │ └──── time out
  3178.          │ │ │ │ │ └─┴───── unused
  3179.          │ │ │ │ └──────── I/O error
  3180.          │ │ │ └───────── selected
  3181.          │ │ └────────── out of paper
  3182.          │ └─────────── acknowledge
  3183.          └──────────── not busy
  3184.  
  3185.  
  3186.     - returns status of specified printer port
  3187. :int 19
  3188. ^INT 19 - Bootstrap Loader
  3189.  
  3190.  
  3191.     DL = physical drive where boot sector is located
  3192.  
  3193.  
  3194.     no output
  3195.  
  3196.  
  3197.     - track 0, sector 1 is loaded into address 0:7C00
  3198.       and control is transferred there
  3199.     - not a preferred method for rebooting by applications.  A
  3200.       better method is to set the word at location 40:72 to 1234h
  3201.       and jump to location FFFF:0 in ROM
  3202.     - memory is not cleared when rebooted through this interrupt
  3203.  
  3204.     - see    ~WARM BOOT~
  3205.  
  3206. :int 1a:BIOS clock services
  3207. ^INT 1A - System and Real Time Clock BIOS Services
  3208.  
  3209.  
  3210. %    For more informations, see the following topics:
  3211.  
  3212.     ~INT 1A,0~   Read system clock counter
  3213.     ~INT 1A,1~   Set system clock counter
  3214.     ~INT 1A,2~   Read real time clock time (AT,PS/2)
  3215.     ~INT 1A,3~   Set real time clock time (AT,PS/2)
  3216.     ~INT 1A,4~   Read real time clock date (AT,PS/2)
  3217.     ~INT 1A,5~   Set real time clock date (AT,PS/2)
  3218.     ~INT 1A,6~   Set real time clock alarm (AT,PS/2)
  3219.     ~INT 1A,7~   Reset real time clock alarm (PS/2)
  3220.     ~INT 1A,8~   Set RTC activated power on mode (convertible,PS/2)
  3221.     ~INT 1A,9~   Read RTC alarm time and status (convertible,PS/2)
  3222.     ~INT 1A,A~   Read system day counter (PS/2)
  3223.     ~INT 1A,B~   Set system day counter (PS/2)
  3224.     ~INT 1A,80~  Set up sound multiplexer (PCjr only)
  3225.  
  3226.     - function is specified in register AH
  3227.     - see    ~RTC~
  3228. :int 1a,0
  3229. ^INT 1A,0 - Read System Clock Counter
  3230.  
  3231.  
  3232.     AH = 00
  3233.  
  3234.  
  3235.     on return:
  3236.     AL = midnight flag, 1 if 24 hours passed since reset
  3237.     CX = high order word of tick count
  3238.     DX = low order word of tick count
  3239.  
  3240.  
  3241.     - incremented approximately 18.206 times per second
  3242.     - at midnight CX:DX is zero
  3243.     - this interrupt can cause the loss of the date rollover flag
  3244.       at ~BIOS Data Area~ location 40:70
  3245.     - beware of problems on AT&T WGS systems, where this interrupt
  3246.       sometimes returns invalid information.
  3247.  
  3248. :int 1a,1
  3249. ^INT 1A,1 - Set System Clock Counter
  3250.  
  3251.  
  3252.     AH = 01
  3253.     CX = high order word of tick count
  3254.     DX = low order word of tick count
  3255.  
  3256.  
  3257.     returns nothing
  3258.  
  3259.  
  3260.     - CX:DX should be set to the number of seconds past midnight
  3261.       multiplied by approximately 18.206
  3262.  
  3263. :int 1a,2
  3264. ^INT 1A,2 - Read Time From Real Time Clock  (XT 286,AT,PS/2)
  3265.  
  3266.  
  3267.     AH = 02
  3268.  
  3269.  
  3270.     on return:
  3271.     CF = 0 if successful
  3272.        = 1 if error, ~RTC~ not operating
  3273.     CH = hours in BCD
  3274.     CL = minutes in BCD
  3275.     DH = seconds in BCD
  3276.     DL = 1 if daylight savings time option
  3277.  
  3278.  
  3279.     - on AT with BIOS before 6/10/85, DL is not returned
  3280. :int 1a,3
  3281. ^INT 1A,3 - Set Time on Real Time Clock  (XT 286,AT,PS/2)
  3282.  
  3283.  
  3284.     AH = 03
  3285.     CH = hours in BCD
  3286.     CL = minutes in BCD
  3287.     DH = seconds in BCD
  3288.     DL = 1 if daylight savings time option
  3289.        = 0 if standard time
  3290.  
  3291.  
  3292.     returns nothing
  3293.  
  3294.  
  3295.     - clock values must be in BCD
  3296.     - see    ~RTC~
  3297. :int 1a,4
  3298. ^INT 1A,4 - Read Real Time Clock Date  (XT 286,AT,PS/2)
  3299.  
  3300.  
  3301.     AH = 04
  3302.  
  3303.  
  3304.     on return:
  3305.     CH = century in BCD (decimal 19 or 20)
  3306.     CL = year in BCD
  3307.     DH = month in BCD
  3308.     DL = day in BCD
  3309.     CF = 0 if successful
  3310.        = 1 if error or clock not operating
  3311.  
  3312.     - calling this interrupt will update the DOS maintained date and
  3313.       reset the ~BIOS Data Area~ date rollover flag at 40:70
  3314.     - see    ~RTC~
  3315. :int 1a,5
  3316. ^INT 1A,5 - Set Real Time Clock Date  (XT 286,AT,PS/2)
  3317.  
  3318.  
  3319.     AH = 05
  3320.     CH = century in BCD (decimal 19 or 20)
  3321.     CL = year in BCD
  3322.     DH = month in BCD
  3323.     DL = day in BCD
  3324.  
  3325.  
  3326.     returns nothing
  3327.  
  3328.  
  3329.     - all values must be in BCD
  3330.     - see    ~RTC~
  3331. :int 1a,6
  3332. ^INT 1A,6 - Set Real Time Clock Alarm  (XT 286,AT,PS/2)
  3333.  
  3334.  
  3335.     AH = 06
  3336.     CH = hours in BCD
  3337.     CL = minutes in BCD
  3338.     DH = seconds in BCD
  3339.  
  3340.  
  3341.     on return:
  3342.     CF = 1 if alarm already set or clock inoperable
  3343.  
  3344.  
  3345.     - alarm setting is not relative like some sources claim, but the
  3346.       actually clock time the interrupt should occur
  3347.     - settings values must be in BCD
  3348.     - when the alarm time is reached ~INT 4A~ is executed
  3349.     - INT 4A vector should be replaced with address of the alarm
  3350.       handling interrupt routine before setting the alarm
  3351.     - ~INT 1A,7~ should be called to disable the ~RTC~ alarm
  3352. :int 1a,7
  3353. ^INT 1A,7 - Disable Real Time Clock Alarm  (XT,AT,PS/2)
  3354.  
  3355.  
  3356.     AH = 07
  3357.  
  3358.  
  3359.     returns nothing
  3360.  
  3361.  
  3362.     - should be called previous to setting or resetting the
  3363.       ~RTC~ alarm with ~INT 1A,6~
  3364. :int 1a,8
  3365. ^INT 1A,8 - Set RTC Activated Power On Mode (convertible)
  3366.  
  3367.  
  3368.     AH = 08
  3369.     CH = hours in BCD
  3370.     CL = minutes in BCD
  3371.     DH = seconds in BCD
  3372.  
  3373.  
  3374.     - see    ~RTC~
  3375. :int 1a,9
  3376. ^INT 1A,9 - Read RTC Alarm Time and Status (convertible,PS/2)
  3377.  
  3378.  
  3379.     AH = 09
  3380.  
  3381.  
  3382.     on return:
  3383.     CH = hours in BCD
  3384.     CL = minutes in BCD
  3385.     DH = seconds in BCD
  3386.     DL = alarm status:
  3387.        = 00 if alarm not enabled (AIE=0)
  3388.        = 01 if alarm enabled but will not power up system (AIE=1)
  3389.        = 02 if alarm will power up system (AIE=1)
  3390.  
  3391.  
  3392.     - see    ~RTC~
  3393. :int 1a,a
  3394. ^INT 1A,A - Read System Day Counter (PS/2)
  3395.  
  3396.  
  3397.     AH = 0Ah
  3398.  
  3399.  
  3400.     on return:
  3401.     CX = count of days since 1-1-1980
  3402.  
  3403. :int 1a,b
  3404. ^INT 1A,B - Set System Day Counter (PS/2)
  3405.  
  3406.  
  3407.     AH = 0Bh
  3408.     CX = count of days since 1-1-1980
  3409.  
  3410. :int 1a,80
  3411. ^INT 1A,80 - Setup Sound Multiplexer  (PCjr only)
  3412.  
  3413.  
  3414.     AL = 00 - source is ~8253~ channel 2
  3415.        = 01 - source is cassette input
  3416.        = 02 - source is I/O channel "AUDIO IN"
  3417.        = 03 - source is sound generator chip
  3418.  
  3419. :int 1b:Ctrl-Break:BIOS break interrupt
  3420. ^INT 1B - BIOS Ctrl-Break Handler Address
  3421.  
  3422.  
  3423.     - holds address of the BIOS Ctrl-Break interrupt handler
  3424.     - called by ~INT 9~ after Ctrl-Break key is pressed; INT 9 sets the
  3425.       BIOS keyboard head and tail pointers to the buffer start and
  3426.       places a zero word in the buffer
  3427.     - the BIOS initially sets this value to point to a simple ~IRET~ but
  3428.       DOS re-vectors this to its own code, usually 2 lines of code that
  3429.       sets an internal flag (to 3) and then returns via IRET.
  3430.     - DOS checks this flag on entry to many of its subfunctions.  If the
  3431.       flag is set, it invokes ~INT 23~.
  3432.     - pointing this address to a null function with and IRET disables
  3433.       Ctrl-Break aborts
  3434.     - if the INT 1B code chooses to retain control of the system, it
  3435.       must issue an EOI for any interrupt pending on the ~8259~ and reset
  3436.       all I/O devices
  3437.     - should be terminated via an IRET
  3438.     - should not be called directly by user application
  3439. :int 1c:user timer routine
  3440. ^INT 1C - System Timer Tick (User Routine)
  3441.  
  3442.  
  3443.     - called by ~INT 8~, approximately 18.206 times per second
  3444.       (unless the program modifies the ~8253~ PIT
  3445.     - this is a user routine which the BIOS defaults to a simple ~IRET~
  3446.     - this interrupt vector can be used for TSR popup utilities,
  3447.       animated graphics updates and event polling
  3448.     - since many TSR's don't maintain the integrity of the interrupt
  3449.       call chain, relying on this for TSR popup isn't recommended
  3450. :int 1d
  3451. ^INT 1D - Video Initialization Parameter Table Vector
  3452.  
  3453.  
  3454.     - not a true interrupt, but a far pointer to a video
  3455.       initialization parameter table for video controllers
  3456.  
  3457. :int 1e
  3458. ^INT 1E - Disk Initialization Parameter Table Vector
  3459.  
  3460.     - not an interrupt, but a far pointer to the diskette base table
  3461.     - this table contains initialization parameters for the disk
  3462.       controller used during formatting, reading, and writing to a disk
  3463.  
  3464. %    Disk Initialization Parameter Table Vector Definition:
  3465.  
  3466. %    Offset       Description
  3467.  
  3468.       00  │7│6│5│4│3│2│1│0│  Disk Controller Mode byte 1
  3469.            │ │ │ │ └─┴─┴─┴────  head step rate in milliseconds (0-F)
  3470.            └─┴─┴─┴───────────  head unload time in milliseconds (0-F)
  3471.  
  3472.       01  │7│6│5│4│3│2│1│0│  Disk Controller Mode byte 2
  3473.            │ │ │ │ │ │ │ └──── DMA flag (0 = use DMA)
  3474.            └─┴─┴─┴─┴─┴─┴───── (head load time/2)-1 in milliseconds
  3475.  
  3476.       02  clock ticks until motor off
  3477.       03  FM or MFM Mode:  Log2 (Bytes per Sector/128)
  3478.           FM=Frequency Modulation used on single-density disks
  3479.           MFM=Modified Frequency Modulation used on double-sided disks
  3480.       04  last sector on track
  3481.       05  gap length in bytes:
  3482.  
  3483.              Bytes Per     Sectors     Write    Format
  3484.           MFM     Sector    Per Track     Gap    Gap
  3485.            1    256        18          0Ah    0Ch
  3486.            1    256        16          20h    32h
  3487.            2    512         8          2Ah    50h
  3488.            2    512         9          1Bh    6Ch
  3489.            3       1024         4          80h    F0h
  3490.            4       2048         2          C8h    FFh
  3491.            5       4096         1          C8h    FFh
  3492.  
  3493.       06  disk data length
  3494.           80h for 128 bytes/sector
  3495.           FFh otherwise
  3496.       07  gap length when formatting
  3497.       08  data pattern used during formatting
  3498.       09  floppy head bounce delay (in milliseconds)
  3499.       0A  floppy motor start delay (in 0.125 second intervals)
  3500.       0B  floppy motor stop delay (in 0.25 second intervals)
  3501.  
  3502.     - see ~INT 13,18~
  3503.  
  3504. :int 1f
  3505. ^INT 1F - Graphics Display Character Bit Map Table
  3506.  
  3507.  
  3508.     - not a true interrupt, but a far pointer to a table of
  3509.       character bit maps for the graphics mode representation of
  3510.       ASCII characters 128 through 255
  3511.     - can be used to change character fonts in CGA graphics mode
  3512.  
  3513. :DOS interrupts
  3514. ^DOS Interrupt Summary
  3515.  
  3516.  
  3517. %    See the following topics for more information:
  3518.  
  3519.     ~INT 20~  Program terminate
  3520.     ~INT 21~  DOS Function Dispatcher
  3521.     ~INT 22~  Program Terminate
  3522.     ~INT 23~  Ctl-break exit address
  3523.     ~INT 24~  Critical error handler address
  3524.     ~INT 25~  Absolute disk read
  3525.     ~INT 26~  Absolute disk write
  3526.     ~INT 27~  Terminate but stay resident
  3527.     ~INT 28~  DOS idle loop/scheduler (undocumented)
  3528.     ~INT 29~  Fast character output (undocumented)
  3529.     ~INT 2E~  Execute command using base level COMMAND.COM (undoc.)
  3530.     ~INT 2F~  Multiplex interrupt (DOS 3.x+)
  3531.  
  3532. :int 20
  3533. ^INT 20 - Program Terminate
  3534.  
  3535.  
  3536.     CS = address of ~PSP~
  3537.  
  3538.  
  3539.     returns nothing
  3540.  
  3541.  
  3542.     - INT 20 restores the terminate, ~Ctrl-Break~, and critical error
  3543.       exit addresses from values in the PSP, flushes all buffers, frees
  3544.       memory and returns to DOS via the termination handler address
  3545.     - does not close ~FCB~s
  3546.     - this function is no longer recommended, but can be used by
  3547.       version of DOS before 2.0, see  ~INT 21,4C~  and  ~INT 21,0~
  3548.  
  3549. :int 21:DOS services:DOS functions
  3550. ^INT 21 - DOS Function Dispatcher
  3551.  
  3552. ^For more information, see the following topics:
  3553.  
  3554.     ~INT 21,0~  Program terminate
  3555.     ~INT 21,1~  Keyboard input with echo
  3556.     ~INT 21,2~  Display output
  3557.     ~INT 21,3~  Wait for auxiliary device input
  3558.     ~INT 21,4~  Auxiliary output
  3559.     ~INT 21,5~  Printer output
  3560.     ~INT 21,6~  Direct console I/O
  3561.     ~INT 21,7~  Wait for direct console input without echo
  3562.     ~INT 21,8~  Wait for console input without echo
  3563.     ~INT 21,9~  Print string
  3564.     ~INT 21,A~  Buffered keyboard input
  3565.     ~INT 21,B~  Check standard input status
  3566.     ~INT 21,C~  Clear keyboard buffer, invoke keyboard function
  3567.     ~INT 21,D~  Disk reset
  3568.     ~INT 21,E~  Select disk
  3569.     ~INT 21,F~  Open file using ~FCB~
  3570.     ~INT 21,10~  Close file using FCB
  3571.     ~INT 21,11~  Search for first entry using FCB
  3572.     ~INT 21,12~  Search for next entry using FCB
  3573.     ~INT 21,13~  Delete file using FCB
  3574.     ~INT 21,14~  Sequential read using FCB
  3575.     ~INT 21,15~  Sequential write using FCB
  3576.     ~INT 21,16~  Create a file using FCB
  3577.     ~INT 21,17~  Rename file using FCB
  3578.     ~INT 21,18~  DOS dummy function (CP/M) (not used/listed)
  3579.     ~INT 21,19~  Get current default drive
  3580.     ~INT 21,1A~  Set disk transfer address
  3581.     ~INT 21,1B~  Get allocation table information
  3582.     ~INT 21,1C~  Get allocation table info for specific device
  3583.     ~INT 21,1D~  DOS dummy function (CP/M) (not used/listed)
  3584.     ~INT 21,1E~  DOS dummy function (CP/M) (not used/listed)
  3585.     ~INT 21,1F~  Get pointer to default drive parameter table (undocumented)
  3586.     ~INT 21,20~  DOS dummy function (CP/M) (not used/listed)
  3587.     ~INT 21,21~  Random read using ~FCB~
  3588.     ~INT 21,22~  Random write using FCB
  3589.     ~INT 21,23~  Get file size using FCB
  3590.     ~INT 21,24~  Set relative record field for FCB
  3591.     ~INT 21,25~  Set interrupt vector
  3592.     ~INT 21,26~  Create new program segment
  3593.     ~INT 21,27~  Random block read using FCB
  3594.     ~INT 21,28~  Random block write using FCB
  3595.     ~INT 21,29~  Parse filename for FCB
  3596.     ~INT 21,2A~  Get date
  3597.     ~INT 21,2B~  Set date
  3598.     ~INT 21,2C~  Get time
  3599.     ~INT 21,2D~  Set time
  3600.     ~INT 21,2E~  Set/reset verify switch
  3601.     ~INT 21,2F~  Get disk transfer address
  3602.     ~INT 21,30~  Get DOS version number
  3603.     ~INT 21,31~  Terminate process and remain resident
  3604.     ~INT 21,32~  Get pointer to drive parameter table (undocumented)
  3605.     ~INT 21,33~  Get/set ~Ctrl-Break~ check state & get boot drive
  3606.     ~INT 21,34~  Get address to DOS critical flag (undocumented)
  3607.     ~INT 21,35~  Get vector
  3608.     ~INT 21,36~  Get disk free space
  3609.     ~INT 21,37~  Get/set switch character (undocumented)
  3610.     ~INT 21,38~  Get/set country dependent information
  3611.     ~INT 21,39~  Create subdirectory (mkdir)
  3612.     ~INT 21,3A~  Remove subdirectory (rmdir)
  3613.     ~INT 21,3B~  Change current subdirectory (chdir)
  3614.     ~INT 21,3C~  Create file using handle
  3615.     ~INT 21,3D~  Open file using handle
  3616.     ~INT 21,3E~  Close file using handle
  3617.     ~INT 21,3F~  Read file or device using handle
  3618.     ~INT 21,40~  Write file or device using handle
  3619.     ~INT 21,41~  Delete file
  3620.     ~INT 21,42~  Move file pointer using handle
  3621.     ~INT 21,43~  Change file mode
  3622.     ~INT 21,44~  I/O control for devices (~IOCTL~)
  3623.     ~INT 21,45~  Duplicate file handle
  3624.     ~INT 21,46~  Force duplicate file handle
  3625.     ~INT 21,47~  Get current directory
  3626.     ~INT 21,48~  Allocate memory blocks
  3627.     ~INT 21,49~  Free allocated memory blocks
  3628.     ~INT 21,4A~  Modify allocated memory blocks
  3629.     ~INT 21,4B~  EXEC load and execute program (func 1 undocumented)
  3630.     ~INT 21,4C~  Terminate process with return code
  3631.     ~INT 21,4D~  Get return code of a sub-process
  3632.     ~INT 21,4E~  Find first matching file
  3633.     ~INT 21,4F~  Find next matching file
  3634.     ~INT 21,50~  Set current process id (undocumented)
  3635.     ~INT 21,51~  Get current process id (undocumented)
  3636.     ~INT 21,52~  Get pointer to DOS "INVARS" (undocumented)
  3637.     ~INT 21,53~  Generate drive parameter table (undocumented)
  3638.     ~INT 21,54~  Get verify setting
  3639.     ~INT 21,55~  Create ~PSP~ (undocumented)
  3640.     ~INT 21,56~  Rename file
  3641.     ~INT 21,57~  Get/set file date and time using handle
  3642.     ~INT 21,58~  Get/set memory allocation strategy (3.x+, undocumented)
  3643.     ~INT 21,59~  Get extended error information (3.x+)
  3644.     ~INT 21,5A~  Create temporary file (3.x+)
  3645.     ~INT 21,5B~  Create new file (3.x+)
  3646.     ~INT 21,5C~  Lock/unlock file access (3.x+)
  3647.     ~INT 21,5D~  Critical error information (undocumented 3.x+)
  3648.     ~INT 21,5E~  Network services (3.1+)
  3649.     ~INT 21,5F~  Network redirection (3.1+)
  3650.     ~INT 21,60~  Get fully qualified file name (undocumented 3.x+)
  3651.     ~INT 21,62~  Get address of program segment prefix (3.x+)
  3652.     ~INT 21,63~  Get system lead byte table (MSDOS 2.25 only)
  3653.     ~INT 21,64~  Set device driver look ahead  (undocumented 3.3+)
  3654.     ~INT 21,65~  Get extended country information (3.3+)
  3655.     ~INT 21,66~  Get/set global code page (3.3+)
  3656.     ~INT 21,67~  Set handle count (3.3+)
  3657.     ~INT 21,68~  Flush buffer (3.3+)
  3658.     ~INT 21,69~  Get/set disk serial number (undocumented DOS 4.0+)
  3659.     ~INT 21,6A~  DOS reserved (DOS 4.0+)
  3660.     ~INT 21,6B~  DOS reserved
  3661.     ~INT 21,6C~  Extended open/create (4.x+)
  3662.     ~INT 21,F8~  Set OEM INT 21 handler (functions F9-FF) (undocumented)
  3663.  
  3664.  
  3665.     - int 21 functions are called with the function number in AH
  3666.     - register AX may be altered, its contents are not guaranteed
  3667.     - if an error occurs, CF is set to 1 and AX contains a simple
  3668.       error code;    ~INT 21,59~ can be used to determine cause.
  3669.     - most INT 21 functions do not restore the flags to pre-interrupt
  3670.       state to allow returning of information via the flags register
  3671.  
  3672. :int 21,0
  3673. ^INT 21,0 - Program Terminate
  3674.  
  3675.  
  3676.     AH = 00
  3677.     CS = ~PSP~ segment address
  3678.  
  3679.  
  3680.     returns nothing
  3681.  
  3682.  
  3683.     - restores the terminate, ~Ctrl-Break~, and critical error
  3684.       exit addresses, flushes all buffers, frees memory
  3685.       and returns to DOS via the termination handler address
  3686.     - does not close ~FCB~s
  3687.     - this function is no longer recommended, but can be used by
  3688.       version of DOS before 2.0, see  ~INT 21,4C~  and  ~INT 20~
  3689.  
  3690. :int 21,1
  3691. ^INT 21,1 - Keyboard Input with Echo
  3692.  
  3693.  
  3694.     AH = 01
  3695.  
  3696.  
  3697.     on return:
  3698.     AL = character from standard input device
  3699.  
  3700.  
  3701.     - waits for keyboard input from STDIN and echoes to STDOUT
  3702.     - returns 0 for extended keystroke, then function must be
  3703.       called again to return scan code
  3704.     - if ~Ctrl-Break~ is detected, ~INT 23~ is executed
  3705.  
  3706. :int 21,2
  3707. ^INT 21,2 - Display Output
  3708.  
  3709.  
  3710.     AH = 02
  3711.     DL = character to output
  3712.  
  3713.  
  3714.     returns nothing
  3715.  
  3716.  
  3717.     - outputs character to STDOUT
  3718.     - backspace is treated as non-destructive cursor left
  3719.     - if ~Ctrl-Break~ is detected, ~INT 23~ is executed
  3720.  
  3721. :int 21,3
  3722. ^INT 21,3 - Wait for Auxiliary Device Input
  3723.  
  3724.  
  3725.     AH = 03
  3726.  
  3727.  
  3728.     on return:
  3729.     AL = character from the auxiliary device
  3730.  
  3731.  
  3732.     - does not supply error returns
  3733.     - waits for character and reads from STDAUX
  3734.     - default DOS AUX parameters are 2400,N,8,1
  3735.  
  3736. :int 21,4
  3737. ^INT 21,4 - Auxiliary Output
  3738.  
  3739.  
  3740.     AH = 04
  3741.     DL = character to output
  3742.  
  3743.  
  3744.     returns nothing
  3745.  
  3746.  
  3747.     - sends character in DL to STDAUX
  3748.     - does not supply error returns
  3749.     - waits until STDAUX is available
  3750.     - default DOS AUX parameters are 2400,N,8,1
  3751.  
  3752. :int 21,5
  3753. ^INT 21,5 - Printer Output
  3754.  
  3755.  
  3756.     AH = 05
  3757.     DL = character to output
  3758.  
  3759.  
  3760.     returns nothing
  3761.  
  3762.  
  3763.     - sends character in DL to STDPRN
  3764.     - waits until STDPRN device is ready before output
  3765.  
  3766. :int 21,6
  3767. ^INT 21,6 - Direct Console I/O
  3768.  
  3769.     AH = 06
  3770.     DL = (0-FE) character to output
  3771.        = FF if console input request
  3772.  
  3773.     on return:
  3774.     AL = input character if console input request (DL=FF)
  3775.     ZF = 0    if console request character available (in AL)
  3776.        = 1    if no character is ready, and function request
  3777.          was console input
  3778.  
  3779.  
  3780.     - reads from or writes to the console device depending on
  3781.       the value of DL
  3782.     - cannot output character FF  (DL=FF indicates read function)
  3783.     - for console read, no echo is produced
  3784.     - returns 0 for extended keystroke, then function must be
  3785.       called again to return scan code
  3786.     - ignores Ctrl-Break and Ctrl-PrtSc
  3787.  
  3788. :int 21,7
  3789. ^INT 21,7 - Direct Console Input Without Echo
  3790.  
  3791.  
  3792.     AH = 07
  3793.  
  3794.  
  3795.     on return:
  3796.     AL = character from STDIN
  3797.  
  3798.  
  3799.     - waits for keyboard input until keystroke is ready
  3800.     - character is not echoed to STDOUT
  3801.     - returns 0 for extended keystroke, then function must be
  3802.       called again to return scan code
  3803.     - ignores Ctrl-Break and Ctrl-PrtSc
  3804.     - see    ~INT 21,1~
  3805.  
  3806. :int 21,8
  3807. ^INT 21,8 - Console Input Without Echo
  3808.  
  3809.  
  3810.     AH = 08
  3811.  
  3812.  
  3813.     on return:
  3814.     AL = character from STDIN
  3815.  
  3816.  
  3817.     - returns 0 for extended keystroke, then function must be
  3818.       called again to return scan code
  3819.     - waits for character from STDIN and returns data in AL
  3820.     - if ~Ctrl-Break~ is detected, ~INT 23~ is executed
  3821.  
  3822. :int 21,9
  3823. ^INT 21,9 - Print String
  3824.  
  3825.  
  3826.     AH = 09
  3827.     DS:DX = pointer to string ending in "$"
  3828.  
  3829.  
  3830.     returns nothing
  3831.  
  3832.  
  3833.     - outputs character string to STDOUT up to "$"
  3834.     - backspace is treated as non-destructive
  3835.     - if ~Ctrl-Break~ is detected, ~INT 23~ is executed
  3836.  
  3837. :int 21,a
  3838. ^INT 21,A - Buffered Keyboard Input
  3839.  
  3840.     AH = 0A
  3841.     DS:DX = pointer to input buffer of the format:
  3842.  
  3843.     │ max │ count │  BUFFER (N bytes)
  3844.        │      │         └────── input buffer
  3845.        │      └──────────── number of characters returned (byte)
  3846.        └────────────── maximum number of characters to read (byte)
  3847.  
  3848.  
  3849.     returns nothing
  3850.  
  3851.     - since strings can be pre-loaded, it is recommended that the
  3852.       default string be terminated with a CR
  3853.     - N bytes of data are read from STDIN into buffer+2
  3854.     - max buffer size is 255, minimum buffer size is 1 byte
  3855.     - chars up to and including a CR are placed into the buffer
  3856.       beginning at byte 2;    Byte 1 returns the number of chars
  3857.       placed into the buffer  (extended codes take 2 characters)
  3858.     - DOS editing keys are active during this call
  3859.     - ~INT 23~ is called if Ctrl-Break or Ctrl-C detected
  3860.  
  3861. :int 21,b
  3862. ^INT 21,B - Check Standard Input Status
  3863.  
  3864.  
  3865.     AH = 0B
  3866.  
  3867.  
  3868.     on return:
  3869.     AL = 00 if no character available
  3870.        = FF if character available
  3871.  
  3872.  
  3873.     - checks STDIN for available characters
  3874.     - character is not returned
  3875.     - if Ctrl-Break is detected ~INT 23~ is executed
  3876.  
  3877. :int 21,c
  3878. ^INT 21,C - Clear Keyboard Buffer and Invoke Keyboard Function
  3879.  
  3880.  
  3881.     AH = 0C
  3882.     AL = 01, 06, 07, 08 or 0A   (INT 21 input functions)
  3883.  
  3884.  
  3885.     on return:
  3886.     see return values from INT 21,AL where AL is 1, 6, 7, 8 or A
  3887.  
  3888.  
  3889.     - main function is to clear the input buffer and call INT 21h with
  3890.       the specified function (in AL)
  3891.     - see ~INT 21,1~,  ~INT 21,6~,  ~INT 21,7~,  ~INT 21,8~ & ~INT 21,A~
  3892.  
  3893. :int 21,d
  3894. ^INT 21,D - Disk Reset
  3895.  
  3896.  
  3897.     AH = 0D
  3898.  
  3899.  
  3900.     returns nothing
  3901.  
  3902.  
  3903.     - all file buffers are flushed to disk
  3904.     - does NOT update directory entry
  3905.  
  3906. :int 21,e
  3907. ^INT 21,E - Select Disk
  3908.  
  3909.  
  3910.     AH = 0E
  3911.     DL = zero based, drive number (0-25, A: - Z:)
  3912.  
  3913.  
  3914.     on return:
  3915.     AL = one based, total number of logical drives including
  3916.          hardfiles (1-26)
  3917.  
  3918.  
  3919.     - for DOS 3.x+, this function returns the number of logical
  3920.       drives or the value of LASTDRIVE (default of 5) in the
  3921.       CONFIG.SYS file
  3922.  
  3923. :int 21,f
  3924. ^INT 21,F - Open a File Using FCB
  3925.  
  3926.     AH = 0F
  3927.     DS:DX = pointer to unopened ~FCB~
  3928.  
  3929.  
  3930.     on return:
  3931.     AL = 00 if file opened
  3932.        = FF if unable to open
  3933.  
  3934.  
  3935.     - opens an existing file using a previously setup FCB
  3936.     - the FCB fields drive identifier, filename and extension
  3937.       must be filled in before call
  3938.     - sets default FCB fields; current block number is set to 0;
  3939.       record size is set to 80h; file size, date and time are set
  3940.       to the values from the directory
  3941.     - does not create file, see  ~INT 21,16~
  3942.     - DOS 2.x allows opening of subdirectories, DOS 3.x does not
  3943. :int 21,10
  3944. ^INT 21,10 - Close a File Using FCB
  3945.  
  3946.  
  3947.     AH = 10h
  3948.     DS:DX = pointer to opened ~FCB~
  3949.  
  3950.  
  3951.     on return:
  3952.     AL = 00  if file closed
  3953.        = FF  if file not closed
  3954.  
  3955.  
  3956.     - closes a previously opened file opened with an FCB
  3957.     - FCB must be setup with drive id, filename, and extension
  3958.       before call
  3959.  
  3960. :int 21,11
  3961. ^INT 21,11 - Search for First Entry Using FCB
  3962.  
  3963.     AH = 11h
  3964.     DS:DX = pointer to unopened ~FCB~
  3965.  
  3966.     on return:
  3967.     AL = 00 if matching file found
  3968.        = FF if file not found
  3969.  
  3970.     - searches for first occurrence of filename specified in FCB
  3971.     - FCB must have drive id, filename, and extension before call
  3972.     - extended FCB can be used to specify a search criteria based
  3973.       on attributes; hidden, system, label, and directory attributes
  3974.       can be used to narrow the search  (see ~FILE ATTRIBUTES~)
  3975.     - after successful call DTA holds an unopened ~FCB~/~XFCB~ for
  3976.       the requested file.    Using any of the other FCB functions
  3977.       destroys this ~DTA~ copy of the FCB/XFCB
  3978.     - searching can be continued with the FCB find-next function
  3979.     - "?" wildcard supported after DOS 2.1, "*" supported in DOS 3.x
  3980.     - DOS 2.x can't find . and .. entries, DOS 3.x can (unless in root)
  3981.     - see    ~INT 21,12~
  3982.  
  3983. :int 21,12
  3984. ^INT 21,12 - Search for Next Entry Using FCB
  3985.  
  3986.     AH = 12h
  3987.     DS:DX = pointer to unopened ~FCB~ returned from
  3988.         ~INT 21,11~  or  ~INT 21,12~
  3989.  
  3990.  
  3991.     on return:
  3992.     AL = 00 if file found
  3993.        = FF if file not found
  3994.  
  3995.  
  3996.     - finds next matching file after calls to ~INT 21,11~ and
  3997.       ~INT 21,12~
  3998.     - FCB should be the same across calls to INT 21,11 and 12
  3999.     - after successful call ~DTA~ holds an unopened ~FCB~/~XFCB~ for
  4000.       the requested file.    Using any of the other FCB functions
  4001.       destroys this DTA copy of the FCB/XFCB
  4002. :int 21,13
  4003. ^INT 21,13 - Delete File Using FCB
  4004.  
  4005.  
  4006.     AH = 13h
  4007.     DS:DX = pointer to an unopened ~FCB~
  4008.  
  4009.  
  4010.     on return:
  4011.     AL = 00 if file deleted
  4012.        = FF if file not found
  4013.  
  4014.  
  4015.     - deletes unopened file with normal attributes
  4016.     - FCB must contain drive id, filename, and extension before call
  4017.     - "?" wildcard supported after DOS 2.1, "*" supported by DOS 3.x+
  4018.     - DOS 2.x allowed deletion of a subdirectory if ~XFCB~ was provided,
  4019.       even if files existed, causing lost clusters.  DOS 3.x does not
  4020. :int 21,14
  4021. ^INT 21,14 - Sequential Read Using FCB
  4022.  
  4023.     AH = 14h
  4024.     DS:DX = pointer to an opened ~FCB~
  4025.  
  4026.  
  4027.     on return:
  4028.     AL = 00 if successful read
  4029.        = 01 if end of file (no data read)
  4030.        = 02 if ~DTA~ is too small
  4031.        = 03 if end of file or partial record read
  4032.  
  4033.  
  4034.     - reads a record from file pointed to by FCB at the location
  4035.       specified in current block and current record number
  4036.     - data record is read into the DTA
  4037.     - FCB record number is updated
  4038. :int 21,15
  4039. ^INT 21,15 - Sequential Write Using FCB
  4040.  
  4041.  
  4042.     AH = 15h
  4043.     DS:DX = pointer to an opened ~FCB~
  4044.  
  4045.  
  4046.     on return:
  4047.     AL = 00 if write was successful
  4048.        = 01 if diskette is full or read only
  4049.        = 02 if ~DTA~ is too small
  4050.  
  4051.  
  4052.     - writes a record from the DTA to the current record position
  4053.       in file specified by the opened FCB
  4054.     - record size and output location are maintained in the FCB
  4055. :int 21,16
  4056. ^INT 21,16 - Create a File Using FCB
  4057.  
  4058.  
  4059.     AH = 16h
  4060.     DS:DX = pointer to an unopened ~FCB~
  4061.  
  4062.  
  4063.     on return:
  4064.     AL = 00 if file created
  4065.        = FF if file creation failed
  4066.  
  4067.  
  4068.     - creates file using FCB and leaves open for later output
  4069.     - FCB must be setup with drive id, filename, and extension
  4070.       before call
  4071.     - an extended FCB can be used to also set ~file attributes~
  4072. :int 21,17
  4073. ^INT 21,17 - Rename a File Using FCB
  4074.  
  4075.     AH = 17h
  4076.     DS:DX = pointer to a modified ~FCB~ of the format:
  4077.  
  4078.       Offset     Description
  4079.         00       drive designator
  4080.         01       original file name
  4081.         09       original file extension
  4082.         11       new file name
  4083.         19       new extension
  4084.  
  4085.  
  4086.     on return:
  4087.     AL = 00 if file renamed
  4088.        = FF if file not renamed
  4089.  
  4090.  
  4091.     - allows renaming of files with normal attributes
  4092.     - "?" wildcard supported after DOS 2.1, "*" supported by
  4093.       DOS 3.x+
  4094. :int 21,19
  4095. ^INT 21,19 - Get Current Default Drive
  4096.  
  4097.  
  4098.     AH = 19h
  4099.  
  4100.  
  4101.     on return:
  4102.     AL = current default drive (0=A,1=B,etc)
  4103.  
  4104.  
  4105.     - determines the current default drive
  4106.  
  4107. :int 21,1a
  4108. ^INT 21,1A - Set Disk Transfer Address (DTA)
  4109.  
  4110.  
  4111.     AH = 1A
  4112.     DS:DX = pointer to disk transfer address (~DTA~)
  4113.  
  4114.  
  4115.     returns nothing
  4116.  
  4117.  
  4118.     - specifies the disk transfer address to DOS
  4119.     - DTA cannot overlap 64K segment boundary
  4120.     - offset 80h in the ~PSP~ is a 128 byte default DTA supplied
  4121.       by DOS upon program load
  4122.     - use of the DTA provided by DOS will result in the loss
  4123.       of the program command tail which also occupies the 128
  4124.       bytes starting at offset 80h of the PSP
  4125.     - see    ~INT 21,2F~
  4126. :int 21,1b
  4127. ^INT 21,1B - Get Allocation Table Information
  4128.  
  4129.  
  4130.     AH = 1B
  4131.  
  4132.  
  4133.     on return:
  4134.     AL = sectors per cluster
  4135.     CX = bytes per sector
  4136.     DX = clusters on disk
  4137.     DS:BX = pointer to ~Media Descriptor Byte~ found in ~FAT~
  4138.  
  4139.  
  4140.     - retrieves information on capacity and format of default drive
  4141.     - DS:BX can be used to determine if drive is RAMDISK or removable
  4142.     - see  ~INT 21,1C~
  4143.  
  4144. :int 21,1c
  4145. ^INT 21,1C - Get Allocation Table Info for Specified Drive
  4146.  
  4147.  
  4148.     AH = 1C
  4149.     DL = drive number (0 for default, 1 = A:, Z: = 26)
  4150.  
  4151.  
  4152.     on return:
  4153.     AL = sectors per cluster
  4154.     CX = bytes per sector
  4155.     DX = clusters on disk
  4156.     DS:BX = pointer to ~Media Descriptor Byte~ found in ~FAT~
  4157.  
  4158.  
  4159.     - retrieves information on capacity and format of specified drive
  4160.     - DS:BX can be used to determine if drive is RAMDISK or removable
  4161.     - see  ~INT 21,1B~
  4162.  
  4163. :int 21,1f
  4164. ^INT 21,1F - Get Pointer to Current Drive Parameter Table
  4165. ^(Undocumented)
  4166.  
  4167.  
  4168.     AH = 1F
  4169.     DL = drive number (0=default, 1=A, ...)
  4170.  
  4171.  
  4172.     on return:
  4173.     AL = 00  DS:BX is pointer to drive parameter table  (~DPT~)
  4174.          FF  drive does not exist
  4175.     DS:BX = pointer to drive parameter table (DPT) if AL=0
  4176.  
  4177.  
  4178.     - the format of the DPT varies between DOS versions
  4179.     - calls ~INT 21,32~ with DL=00 for DOS version 2.x+
  4180. :int 21,21
  4181. ^INT 21,21 - Random Read Using FCB
  4182.  
  4183.  
  4184.     AH = 21h
  4185.     DS:DX = pointer to an opened ~FCB~
  4186.  
  4187.  
  4188.     on return:
  4189.     AL = 00 if read successful
  4190.        = 01 if EOF (no data read)
  4191.        = 02 if ~DTA~ is too small
  4192.        = 03 if EOF (partial record read)
  4193.  
  4194.  
  4195.     - reads random records from a file opened with an FCB
  4196.       to the DTA
  4197.     - FCB must be setup with drive id, filename, extension,
  4198.       record position and record length before call
  4199.     - current record position field in FCB is not updated
  4200.  
  4201. :int 21,22
  4202. ^INT 21,22 - Random Write Using FCB
  4203.  
  4204.  
  4205.     AH = 22h
  4206.     DS:DX = far pointer to an opened ~FCB~
  4207.  
  4208.  
  4209.     on return:
  4210.     AL = 00 if write successful
  4211.        = 01 if diskette full or read only
  4212.        = 02 if ~DTA~ is too small
  4213.  
  4214.  
  4215.     - write records to random location in file opened with FCB
  4216.     - FCB must be setup with drive id, filename, extension,
  4217.       record position and record length before call
  4218.     - current record position field in FCB is not updated
  4219.  
  4220. :int 21,23
  4221. ^INT 21,23 - Get File Size Using FCB
  4222.  
  4223.  
  4224.     AH = 23h
  4225.     DS:DX = pointer to an unopened ~FCB~
  4226.  
  4227.  
  4228.     on return:
  4229.     AL = 00 if successful
  4230.        = FF if file not found
  4231.  
  4232.  
  4233.     - determines the number of records in a file
  4234.     - FCB must be setup with drive id, complete filename and
  4235.       extension plus record length before call
  4236.     - updates random record position in FCB located at DS:DX
  4237.       with file record count
  4238.  
  4239. :int 21,24
  4240. ^INT 21,24 - Set Relative Record Field in FCB
  4241.  
  4242.  
  4243.     AH = 24h
  4244.     DS:DX = pointer to an opened ~FCB~
  4245.  
  4246.  
  4247.     returns nothing
  4248.  
  4249.  
  4250.     - modifies opened FCB for random operation
  4251.     - sets FCB random record field to current sequential block
  4252.       and record fields
  4253.  
  4254. :int 21,25
  4255. ^INT 21,25 - Set Interrupt Vector
  4256.  
  4257.  
  4258.     AH = 25h
  4259.     AL = interrupt number
  4260.     DS:DX = pointer to interrupt handler
  4261.  
  4262.  
  4263.     returns nothing
  4264.  
  4265.  
  4266.     - provides a safe method for changing interrupt vectors
  4267.  
  4268.  
  4269.     - see    ~INT 21,35~
  4270.  
  4271. :int 21,26
  4272. ^INT 21,26 - Create New Program Segment Prefix
  4273.  
  4274.  
  4275.     AH = 26h
  4276.     DX = segment address of new ~PSP~
  4277.  
  4278.  
  4279.     returns nothing
  4280.  
  4281.  
  4282.     - allocates memory for a PSP and copies current PSP there
  4283.     - used before DOS 2.x to spawn a child process
  4284.     - the application is responsible for allocating any memory
  4285.       necessary for the child process
  4286.     - ~INT 21,4B~ (EXEC) is now the recommended method for starting
  4287.       a child process, so this function should be avoided
  4288.  
  4289.  
  4290.     - see also ~INT 21,55~
  4291.  
  4292. :int 21,27
  4293. ^INT 21,27 - Random Block Read Using FCB
  4294.  
  4295.  
  4296.     AH = 27h
  4297.     CX = number of records to read
  4298.     DS:DX = pointer to an opened ~FCB~
  4299.  
  4300.  
  4301.     on return:
  4302.     AL = 00 if read was successful
  4303.        = 01 if EOF (no data read)
  4304.        = 02 if ~DTA~ is too small
  4305.        = 03 if EOF (partial record read)
  4306.     CX = actual number of records read
  4307.  
  4308.  
  4309.     - allows random access and sequential reading of a group
  4310.       of records from a file opened with an FCB into the DTA
  4311.     - FCB must be setup with drive id, filename, extension
  4312.       record length and random record number before call
  4313.  
  4314. :int 21,28
  4315. ^INT 21,28 - Random Block Write Using FCB
  4316.  
  4317.  
  4318.     AH = 28h
  4319.     CX = number of records to write
  4320.     DS:DX = pointer to an opened ~FCB~
  4321.  
  4322.  
  4323.     on return:
  4324.     AL = 00 if write successful
  4325.        = 01 if diskette full or read only
  4326.        = 02 if ~DTA~ is too small
  4327.     CX = number of records written
  4328.  
  4329.  
  4330.     - allows random access and sequential writing of a group
  4331.       of records from a file opened with an FCB into the DTA
  4332.     - FCB must be setup with random record number and record size
  4333.     - updates random record number, current block and current
  4334.       record fields
  4335.  
  4336. :int 21,29
  4337. ^INT 21,29 - Parse a Filename for FCB
  4338.  
  4339.     AH = 29h
  4340.     AL = bit pattern to control parsing (see bit meanings below)
  4341.     DS:SI = pointer to a filespec to parse
  4342.     ES:DI = pointer to a buffer for unopened ~FCB~
  4343.  
  4344.  
  4345.     Bit patterns for parsing control found in AL:
  4346.  
  4347.     │7│6│5│4│3│2│1│0│  AL
  4348.      │ │ │ │ │ │ │ └──── 1 = ignore leading separators
  4349.      │ │ │ │ │ │ │         0 = don't ignore leading separators
  4350.      │ │ │ │ │ │ └───── 1 = modify drive ID if specified
  4351.      │ │ │ │ │ │        0 = modify drive ID regardless
  4352.      │ │ │ │ │ └────── 1 = modify filename if specified
  4353.      │ │ │ │ │       0 = modify filename regardless
  4354.      │ │ │ │ └─────── 1 = modify extension if specified
  4355.      │ │ │ │      0 = modify extension regardless
  4356.      └─┴─┴─┴──────── unused
  4357.  
  4358.     on return:
  4359.     AL = 00 if no wildcard characters present
  4360.        = 01 if wildcards present in string
  4361.        = FF if drive specifier is invalid
  4362.     DS:SI = pointer to the first character after parsed filename
  4363.     ES:DI = pointer to the updated unopened FCB
  4364.  
  4365.  
  4366.     - retrieves filename from the command line string and places
  4367.       the filename components into an unopened FCB for later use
  4368.     - if no filename is found a pointer is returned in ES:DI that
  4369.       has a blank at ES:DI+1
  4370.     - this function can be used to detect the existence of logical DOS
  4371.       drives by creating a dummy filespec with a drive letter and colon
  4372.       prepended.  If the drive is invalid, this function will return FF
  4373.       in AL
  4374. :int 21,2a
  4375. ^INT 21,2A - Get Date
  4376.  
  4377.  
  4378.     AH = 2A
  4379.  
  4380.  
  4381.     on return:
  4382.     AL = day of the week (0=Sunday)
  4383.     CX = year (1980-2099)
  4384.     DH = month (1-12)
  4385.     DL = day (1-31)
  4386.  
  4387.  
  4388.     - retrieves system date based on the DOS maintained clock
  4389.     - updates ~BIOS Data Area~ current date and date rollover flag
  4390.       at location 40:70
  4391.     - see   ~INT 21,2B~   ~INT 21,2C~   ~INT 21,2D~
  4392.  
  4393. :int 21,2b
  4394. ^INT 21,2B - Set Date
  4395.  
  4396.  
  4397.     AH = 2B
  4398.     CX = year (1980-2099)
  4399.     DH = month (1-12)
  4400.     DL = day (1-31)
  4401.  
  4402.  
  4403.     on return:
  4404.     AL = 00 if date change successful
  4405.        = FF if invalid date
  4406.  
  4407.  
  4408.     - sets DOS maintained clock
  4409.     - DOS versions 3.3+ also update the ~CMOS~ date where applicable
  4410.     - see   ~INT 21,2A~   ~INT 21,2C~   ~INT 21,2D~
  4411.  
  4412. :int 21,2c
  4413. ^INT 21,2C - Get Time
  4414.  
  4415.  
  4416.     AH = 2C
  4417.  
  4418.  
  4419.     on return:
  4420.     CH = hour (0-23)
  4421.     CL = minutes (0-59)
  4422.     DH = seconds (0-59)
  4423.     DL = hundredths (0-99)
  4424.  
  4425.  
  4426.     - retrieves DOS maintained clock time
  4427.     - see   ~INT 21,2A~   ~INT 21,2B~   ~INT 21,2D~
  4428. :int 21,2d
  4429. ^INT 21,2D - Set Time
  4430.  
  4431.  
  4432.     AH = 2D
  4433.     CH = hour (0-23)
  4434.     CL = minutes (0-59)
  4435.     DH = seconds (0-59)
  4436.     DL = hundredths (0-99)
  4437.  
  4438.  
  4439.     on return:
  4440.     AL = 00 if time change successful
  4441.        = FF if time invalid
  4442.  
  4443.  
  4444.     - changes DOS maintained clock
  4445.     - DOS version 3.3+ also update CMOS clock where applicable
  4446.     - see   ~INT 21,2A~   ~INT 21,2B~   ~INT 21,2C~
  4447.  
  4448. :int 21,2e
  4449. ^INT 21,2E - Set/Reset Verify Switch
  4450.  
  4451.  
  4452.     AH = 2E
  4453.     AL = 00 to set off
  4454.        = 01 to set verify on
  4455.     DH = 00 for DOS versions before 3.0
  4456.  
  4457.  
  4458.     returns nothing
  4459.  
  4460.  
  4461.     - with the verify setting on, disk I/O is more secure but
  4462.       takes longer to complete
  4463.  
  4464.  
  4465.     - see    ~INT 21,54~
  4466.  
  4467. :int 21,2f
  4468. ^INT 21,2F - Get Disk Transfer Address (DTA)
  4469.  
  4470.  
  4471.     AH = 2F
  4472.  
  4473.  
  4474.     on return:
  4475.     ES:BX = pointer to current ~DTA~
  4476.  
  4477.  
  4478.     - returns the DTA address
  4479.     - the default DTA is a 128 byte block at address 80h in the
  4480.       Program Segment Prefix (~PSP~).  This area also contains the
  4481.       command tail at program startup it must be saved or the DTA
  4482.       must be relocated before use to preserve the command tail
  4483.  
  4484.     - see    ~INT 21,1A~
  4485.  
  4486. :int 21,30
  4487. ^INT 21,30 - Get DOS Version Number
  4488.  
  4489.  
  4490.     AH = 30h
  4491.  
  4492.  
  4493.     on return:
  4494.     AL = major version number (2-5)
  4495.     AH = minor version number (in hundredths decimal)
  4496.     BH = FF  indicates MS-DOS, only if OEM vendor chooses to identify
  4497.        = 00  indicates PC-DOS
  4498.     BL:CX = 24 bit OEM serial number if BH is FF
  4499.  
  4500.  
  4501.     - for an example DOS version 2.1 returns AL=2 and AH=10
  4502.     - DOS versions prior to DOS 2.0 return zero in AH and AL
  4503.     - DOS version 4.0 and 4.1 usually return the same value of 4.00
  4504.     - the OEM serial number is a rarity, though some older OEM DOS
  4505.       versions implemented this feature
  4506.     - the OS/2 compatibility box returns 10.10 for OS/2 1.1, 10.20
  4507.       for OS/2 1.2, etc...
  4508.     - when testing for version, a specific test can often cause your
  4509.       code to not work in following versions of DOS.  It is often better
  4510.       to test for a version number greater or equal to the minimum rather
  4511.       than a specific version number where possible
  4512.     - see ~DOS Versions~
  4513. :int 21,31
  4514. ^INT 21,31 - Terminate Process and Remain Resident
  4515.  
  4516.  
  4517.     AH = 31h
  4518.     AL = exit code (returned to batch files)
  4519.     DX = memory size in paragraphs to reserve
  4520.  
  4521.  
  4522.     returns nothing
  4523.  
  4524.  
  4525.     - preferred method for Terminate and Stay Resident programs
  4526.     - terminates process without releasing allocated memory and
  4527.       without closing open files
  4528.     - attempts allocation of memory specified in DX from memory
  4529.       allocated by DOS at startup.     ~INT 21,48~ memory allocation
  4530.       is not affected
  4531.  
  4532.     - see    ~INT 27~
  4533.  
  4534. :int 21,32
  4535. ^INT 21,32 - Get Pointer to Drive Parameter Table (Undocumented)
  4536.  
  4537.     AH = 32h
  4538.     DL = drive (0=default, 1=A:, 2=B:, 3=C:, ...)
  4539.  
  4540.  
  4541.     on return:
  4542.     AL =  FF if the drive number in DL was invalid
  4543.     DS:BX = address of drive parameter table (~DPT~)
  4544.  
  4545.  
  4546.     - available since DOS 2.0
  4547.     - used by DOS commands CHKDSK and RECOVER
  4548.     - forces a media check, which clears byte DS:[BX+17h] or DS:[BX+18h]
  4549.       in the Drive Parameter Table
  4550.     - actually accesses the disk, causing a critical error if a disk
  4551.       error occurs
  4552.     - can be used to determine if a drive is SUBST'ed by comparing
  4553.       DS:[BX+1] and DS:[BX] for a match.  If not equal, then the
  4554.       drive is possibly SUBST'ed (though not guaranteed, this may also
  4555.       indicate a Bernoulli box)
  4556.     - can be used to determine if a drive is a RAM disk; if the disk is
  4557.       NOT removable and (DS:[BX+1] == 0), then the disk is a RAM disk
  4558.       (see ~IOCTL,0~ bit number 0Bh to determine if the disk is removable)
  4559. :int 21,33
  4560. ^INT 21,33 - Get/Set System Values (Ctl-Break/Boot Drive)
  4561.  
  4562.  
  4563.     AH = 33h
  4564.     AL = 00 to get Ctrl-Break checking flag
  4565.        = 01 to set Ctrl-Break checking flag
  4566.        = 02 to set extended Ctrl-Break checking
  4567.        = 05 get boot drive (DOS 4.x)
  4568.     DL = 00 to set Ctrl-Break checking off
  4569.        = 01 to set Ctrl-Break checking on
  4570.        = boot drive for subfunction 5;  (1=A:, 2=B:, ...)
  4571.  
  4572.  
  4573.     on return:
  4574.     DL = 00 Ctrl-Break checking OFF (AL=0 or AL=2)
  4575.        = 01 Ctrl-Break checking ON    (AL=0 or AL=2)
  4576.        = boot drive number (1-26, A: - Z:) (function 05)
  4577.  
  4578.  
  4579.     - retrieves DOS Ctrl-Break or extended Ctrl-Break setting which
  4580.       determines if DOS will check for Ctrl-Break during INT 21 calls
  4581. :int 21,34:INDOS
  4582. ^INT 21,34 - Get Address to DOS Critical Flag
  4583. ^INDOS    (Undocumented DOS 2.0+)
  4584.  
  4585.     AH = 34h
  4586.  
  4587.     on return:
  4588.     ES:BX = address of a byte indicating whether a DOS call is
  4589.         in progress.  No DOS calls should be made if set.
  4590.  
  4591.  
  4592.     - AKA the INDOS flag, this critical section flag may be checked from
  4593.       within an interrupt handler before requesting a DOS service. It is
  4594.       a semaphore that is non-zero when DOS is busy, and zero otherwise.
  4595.     - though this flag indicates whether a DOS interrupt is active, it
  4596.       should not be used alone to determine DOS is safe for re-entry;
  4597.       Here's the standard rule for safe DOS entry: if ~INT 28~ is active
  4598.       or this flag and the critical error flag are clear then it is safe
  4599.       to call DOS
  4600.     - this interrupt should be used only during TSR initialization;
  4601.       the returned pointer should be used thereafter
  4602.     - this flag is cleared after a critical error (~INT 24~)
  4603.     - ES:BX-1 points to the critical error flag for DOS 3.x+
  4604.       ES:BX+1 points to the critical error flag for DOS 2.x
  4605.       ES:BX-1AA points to the critical error flag for COMPAQ DOS 3.0
  4606.       ~INT 21,5D~ in DOS 3.x+ can be used to locate the critical
  4607.       error flag
  4608. :int 21,35
  4609. ^INT 21,35 - Get Interrupt Vector
  4610.  
  4611.  
  4612.     AH = 35h
  4613.     AL = interrupt vector number
  4614.  
  4615.  
  4616.     on return:
  4617.     ES:BX = pointer to interrupt handler
  4618.  
  4619.  
  4620.     - standard method for retrieving interrupt vectors
  4621.  
  4622.  
  4623.     - see    ~INT 21,25~
  4624.  
  4625. :int 21,36
  4626. ^INT 21,36 - Get Disk Free Space
  4627.  
  4628.  
  4629.     AH = 36h
  4630.     DL = drive number (0=default, 1=A:)
  4631.  
  4632.  
  4633.     on return:
  4634.     AX = sectors per cluster
  4635.        = FFFF if drive is invalid
  4636.     BX = number of available clusters
  4637.     CX = number of bytes per sector
  4638.     DX = number of clusters per drive
  4639.  
  4640.  
  4641.     - used to determine available space on specified disk
  4642.     - see    ~INT 21,1B~   ~INT 21,1C~
  4643.  
  4644. :int 21,37
  4645. ^INT 21,37 - Get/Set Switch Character (Undocumented, DOS 2.0+)
  4646.  
  4647.  
  4648.     AH = 37h
  4649.     AL = 0    get switch character into DL;  some systems return "-"
  4650.        = 1    set switch character to value in DL
  4651.        = 2    read device prefix flag into DL;  returns DL = 0 indicating
  4652.         devices must be accessed using /DEV/device. A non-zero value
  4653.         indicates devices may be accessed without prefix
  4654.        = 3    set device prefix flag, device names must begin with \DEV\.
  4655.     DL = new switch character (AL=1)
  4656.        = 00  \DEV\ must preceed device names (AL=3)
  4657.        = 01  \DEV\ is not neccesary in device names (AL=3)
  4658.  
  4659.     on return:
  4660.     AL = FF  illegal subfunction code specified
  4661.     DL = current switch character (AL=0)
  4662.        = device availability (AL=2, always FF with DOS 4.x+)
  4663.  
  4664.  
  4665.     - subfunctions 0 and 1 were formerly available as a CONFIG.SYS
  4666.       command in DOS versions before 3.x;    also supportedin the OS/2
  4667.       compatibility box
  4668.     - subfunctions 2 and 3 were available in DOS 2.x only;    they have
  4669.       no effect in DOS 4.x+
  4670.     - /DEV/ prefix is valid in DOS 2.x by default, setting the flag makes
  4671.       it mandatory.  DOS internal commands like DIR, TYPE and DEL do not
  4672.       recognize filenames the are identical to device names regardless of
  4673.       the setting of the AVAILDEV flag.
  4674. :int 21,38
  4675. ^INT 21,38 - Get/Set Country Dependent Information
  4676.  
  4677.     AH = 38h
  4678.     AL = 00 to get current country information
  4679.        = 00-FE country codes  (DOS 3.x+)
  4680.        = FF for country codes >= FF, country codes are in BX
  4681.     BX = country code if AL = FF (country code > 255)
  4682.     DX = FFFF to set country information
  4683.     DS:DX = pointer to buffer to contain country data (if get data)
  4684.  
  4685.     on return:
  4686.     AX = error code if CF set
  4687.        = 02 invalid country
  4688.     BX = country code (DOS 3.x+)
  4689.     DS:DX = pointer to returned country data (see ~COUNTRY CODES~)
  4690.  
  4691.  
  4692.     - returns a pointer to country specific data, for DOS 3.x+ this
  4693.       function can be used to also set this information
  4694. :int 21,39
  4695. ^INT 21,39 - Create Subdirectory (mkdir)
  4696.  
  4697.  
  4698.     AH = 39h
  4699.     DS:DX = pointer to ASCIIZ path name
  4700.  
  4701.  
  4702.     on return:
  4703.     CF = 0 if successful
  4704.        = 1 if error
  4705.     AX = error code  (see ~DOS ERROR CODES~)
  4706.  
  4707.  
  4708.     - creates specified subdirectory
  4709.     - returns error if directory already exists, element of the path
  4710.       is not found, directory full or write protected disk
  4711.  
  4712. :int 21,3a
  4713. ^INT 21,3A - Remove Subdirectory (rmdir)
  4714.  
  4715.  
  4716.     AH = 3A
  4717.     DS:DX = pointer to ASCIIZ path name
  4718.  
  4719.  
  4720.     on return:
  4721.     CF = 0 if successful
  4722.        = 1 if error
  4723.     AX = error code  (see ~DOS ERROR CODES~)
  4724.  
  4725.  
  4726.     - allows deletion of a subdirectory as long as it exists, is empty
  4727.       and not the current directory
  4728.  
  4729. :int 21,3b
  4730. ^INT 21,3B - Change Current Directory (chdir)
  4731.  
  4732.  
  4733.     AH = 3B
  4734.     DS:DX = pointer to ASCIIZ path name
  4735.  
  4736.  
  4737.     on return:
  4738.     CF = 0 if successful
  4739.        = 1 if error
  4740.     AX = error code if CF set  (see ~DOS ERROR CODES~)
  4741.  
  4742.  
  4743.     - changes the current directory to the directory specified
  4744.       by pointer DS:DX
  4745.  
  4746. :int 21,3c
  4747. ^INT 21,3C - Create File Using Handle
  4748.  
  4749.  
  4750.     AH = 3C
  4751.     CX = file attribute  (see ~FILE ATTRIBUTES~)
  4752.     DS:DX = pointer to ASCIIZ path name
  4753.  
  4754.  
  4755.     on return:
  4756.     CF = 0 if successful
  4757.        = 1 if error
  4758.     AX = files handle if successful
  4759.        = error code if failure  (see ~DOS ERROR CODES~)
  4760.  
  4761.  
  4762.     - if file already exists, it is truncated to zero bytes on opening
  4763.  
  4764. :int 21,3d
  4765. ^INT 21,3D - Open File Using Handle
  4766.  
  4767.     AH = 3D
  4768.     AL = open access mode
  4769.          00  read only
  4770.          01  write only
  4771.          02  read/write
  4772.     DS:DX = pointer to an ASCIIZ file name
  4773.  
  4774.     on return:
  4775.     AX = file handle if CF not set
  4776.        = error code if CF set  (see ~DOS ERROR CODES~)
  4777.  
  4778.  
  4779. %    Access modes in AL:
  4780.  
  4781.     │7│6│5│4│3│2│1│0│  AL
  4782.      │ │ │ │ │ └─┴─┴──── read/write/update access mode
  4783.      │ │ │ │ └───────── reserved, always 0
  4784.      │ └─┴─┴────────── sharing mode (see below) (DOS 3.1+)
  4785.      └─────────────── 1 = private, 0 = inheritable (DOS 3.1+)
  4786.  
  4787.  
  4788. %    Sharing mode bits (DOS 3.1+):           Access mode bits:
  4789. %    654                       210
  4790.     000  compatibility mode (exclusive)    000  read access
  4791.     001  deny others read/write access     001  write access
  4792.     010  deny others write access           010  read/write access
  4793.     011  deny others read access
  4794.     100  full access permitted to all
  4795.  
  4796.  
  4797.     - will open normal, hidden and system files
  4798.     - file pointer is placed at beginning of file
  4799.  
  4800. :int 21,3e
  4801. ^INT 21,3E - Close File Using Handle
  4802.  
  4803.  
  4804.     AH = 3E
  4805.     BX = file handle to close
  4806.  
  4807.  
  4808.     on return:
  4809.     AX = error code if CF set  (see ~DOS ERROR CODES~)
  4810.  
  4811.  
  4812.     - if file is opened for update, file time and date stamp
  4813.       as well as file size are updated in the directory
  4814.     - handle is freed
  4815.  
  4816. :int 21,3f
  4817. ^INT 21,3F - Read From File or Device Using Handle
  4818.  
  4819.  
  4820.     AH = 3F
  4821.     BX = file handle
  4822.     CX = number of bytes to read
  4823.     DS:DX = pointer to read buffer
  4824.  
  4825.  
  4826.     on return:
  4827.     AX = number of bytes read is CF not set
  4828.        = error code if CF set  (see ~DOS ERROR CODES~)
  4829.  
  4830.  
  4831.     - read specified number of bytes from file into buffer DS:DX
  4832.     - when AX is not equal to CX then a partial read occurred due
  4833.       to end of file
  4834.     - if AX is zero, no data was read, and EOF occurred before read
  4835.  
  4836. :int 21,40
  4837. ^INT 21,40 - Write To File or Device Using Handle
  4838.  
  4839.  
  4840.     AH = 40h
  4841.     BX = file handle
  4842.     CX = number of bytes to write, a zero value truncates/extends
  4843.          the file to the current file position
  4844.     DS:DX = pointer to write buffer
  4845.  
  4846.  
  4847.     on return:
  4848.     AX = number of bytes written if CF not set
  4849.        = error code if CF set  (see ~DOS ERROR CODES~)
  4850.  
  4851.  
  4852.     - if AX is not equal to CX on return, a partial write occurred
  4853.     - this function can be used to truncate a file to the current
  4854.       file position by writing zero bytes
  4855. :int 21,41
  4856. ^INT 21,41 - Delete File
  4857.  
  4858.  
  4859.     AH = 41h
  4860.     DS:DX = pointer to an ASCIIZ filename
  4861.  
  4862.  
  4863.     on return:
  4864.     AX = error code if CF set  (see DOS ERROR CODES)
  4865.  
  4866.  
  4867.     - marks first byte of file directory entry with E5 to indicate
  4868.       the file has been deleted.  The rest of the directory entry
  4869.       stays intact until reused.   ~FAT~ pointers are returned to DOS
  4870.     - documented as not accepting wildcards in filename but actually
  4871.       does in several DOS versions
  4872. :int 21,42
  4873. ^INT 21,42 - Move File Pointer Using Handle
  4874.  
  4875.  
  4876.     AH = 42h
  4877.     AL = origin of move:
  4878.          00 = beginning of file plus offset  (SEEK_SET)
  4879.          01 = current location plus offset    (SEEK_CUR)
  4880.          02 = end of file plus offset  (SEEK_END)
  4881.     BX = file handle
  4882.     CX = high order word of number of bytes to move
  4883.     DX = low order word of number of bytes to move
  4884.  
  4885.  
  4886.     on return:
  4887.     AX = error code if CF set  (see ~DOS ERROR CODES~)
  4888.     DX:AX = new pointer location if CF not set
  4889.  
  4890.  
  4891.     - seeks to specified location in file
  4892. :int 21,43
  4893. ^INT 21,43 - Get/Set File Attributes
  4894.  
  4895.     AH = 43h
  4896.     AL = 00 to get attribute
  4897.        = 01 to set attribute
  4898.     DS:DX = pointer to an ASCIIZ path name
  4899.     CX = attribute to set
  4900.  
  4901.     │5│4│3│2│1│0│  CX  valid file attributes
  4902.      │ │ │ │ │ └──── 1 = read only
  4903.      │ │ │ │ └───── 1 = hidden
  4904.      │ │ │ └────── 1 = system
  4905.      │ └─┴─────── not used for this call
  4906.      └────────── 1 = archive
  4907.  
  4908.  
  4909.     on return:
  4910.     AX = error code if CF set  (see ~DOS ERROR CODES~)
  4911.     CX = the attribute if AL was 00
  4912.  
  4913.     - see    ~DIRECTORY~
  4914.  
  4915. :int 21,44
  4916. ^INT 21,44 - I/O Control for Devices  (IOCTL)
  4917.  
  4918. %    Standard Call Format
  4919.  
  4920.     AH = 44h
  4921.     AL = function value
  4922.     BX = file handle
  4923.     BL = logical device number (0=default, 1=A:, 2=B:, 3=C:, ...)
  4924.     CX = number of bytes to read or write
  4925.     DS:DX = data or buffer
  4926.  
  4927.  
  4928.     on return:
  4929.     AX = error code if CF set
  4930.     AX = # of bytes transferred if CF not set
  4931.  
  4932.  
  4933. %    For more information, see the following topics:
  4934.  
  4935.     ~IOCTL,0~   Get Device Information
  4936.     ~IOCTL,1~   Set Device Information
  4937.     ~IOCTL,2~   Read From Character Device
  4938.     ~IOCTL,3~   Write to Character Device
  4939.     ~IOCTL,4~   Read From Block Device
  4940.     ~IOCTL,5~   Write to Block Device
  4941.     ~IOCTL,6~   Get Input Status
  4942.     ~IOCTL,7~   Get Output Status
  4943.     ~IOCTL,8~   Device Removable Query
  4944.     ~IOCTL,9~   Device Local or Remote Query
  4945.     ~IOCTL,A~   Handle Local or Remote Query
  4946.     ~IOCTL,B~   Set Sharing Retry Count
  4947.     ~IOCTL,C~   Generic I/O for Handles
  4948.     ~IOCTL,D~   Generic I/O for Block Devices (3.2+)
  4949.     ~IOCTL,E~   Get Logical Drive (3.2+)
  4950.     ~IOCTL,F~   Set Logical Drive (3.2+)
  4951.  
  4952.  
  4953.     - see:    ~DEVICE COMMAND CODES~
  4954.         ~DEVICE REQUEST HEADER~
  4955.         ~DEVICE STATUS~
  4956.         ~DEVICE HEADER~
  4957.         ~DEVICE ATTRIBUTES~
  4958.  
  4959. :int 21,44,0:IOCTL,0
  4960. ^INT 21,44,0 / IOCTL,0 - Get Device Information
  4961.  
  4962.     AH = 44h
  4963.     AL = 00
  4964.     BX = handle (must be an opened device)
  4965.  
  4966.  
  4967.     on return
  4968.     AX = error code if CF set  (see ~DOS ERROR CODES~)
  4969.     DX = device information  (see tables below)
  4970.  
  4971.  
  4972.     │F│E│D│C│B│A-8│7│6│5-0│  DX  Block Device Information
  4973.      │ │ │ │ │  │  │ │  └───── drive number (0=A:,1=B:)
  4974.      │ │ │ │ │  │  │ └─────── 0 = file has been written
  4975.      │ │ │ │ │  │  └──────── 0 = disk file; 1 = character device
  4976.      │ │ │ │ │  └────────── reserved, must be zero
  4977.      │ │ │ │ └──────────── 1 = media not removable
  4978.      │ │ │ └───────────── 1 = network device (DOS 3.x+)
  4979.      │ │ └────────────── 1 = reserved
  4980.      │ └─────────────── 1 = don't update file time or date (DOS 4.x+)
  4981.      └──────────────── 1 = file is remote (DOS 3.x+)
  4982.  
  4983.     │F│E│D│C│B│A-8│7│6│5│4│3│2│1│0│  DX  Character Device Information
  4984.      │ │ │ │ │  │  │ │ │ │ │ │ │ └──── 1 = standard input device
  4985.      │ │ │ │ │  │  │ │ │ │ │ │ └──── 1 = standard output device
  4986.      │ │ │ │ │  │  │ │ │ │ │ └──── 1 = NUL device
  4987.      │ │ │ │ │  │  │ │ │ │ └──── 1 = clock device
  4988.      │ │ │ │ │  │  │ │ │ └──── uses DOS ~INT 29~ for fast character output
  4989.      │ │ │ │ │  │  │ │ └──── 1 = binary mode, 0 = translated
  4990.      │ │ │ │ │  │  │ └──── 0 = end of file on input
  4991.      │ │ │ │ │  │  └──── 1 = character device, 0 if disk file
  4992.      │ │ │ │ │  └───── reserved
  4993.      │ │ │ │ └────── 1 = media not removable
  4994.      │ │ │ └────── 1 = network device (DOS 3.x+)
  4995.      │ │ └────── reserved
  4996.      │ └────── 1 = supports IOCTL, via functions 2 & 3
  4997.      └────── reserved
  4998.  
  4999.  
  5000.     - BIT 7 of register DX can be used to detect if STDIN/STDOUT is
  5001.       redirected to/from disk; if a call to this function has DX BIT 7
  5002.       set it's not redirected from/to disk; if it's clear then it is
  5003.       redirected to/from disk
  5004.     - BIT B of register DX can be used to determine if a drive is
  5005.       removable.
  5006.  
  5007. :int 21,44,1:IOCTL,1
  5008. ^INT 21,44,1 / IOCTL,1 - Set Device Information
  5009.  
  5010.     AH = 44h
  5011.     AL = 01
  5012.     BX = handle
  5013.     DH = must be zero
  5014.     DL = device data low order byte  (see below)
  5015.  
  5016.  
  5017.     on return
  5018.     AX = error code if CF set
  5019.     DX = device information  (see below)
  5020.  
  5021.  
  5022.     - applicable to character devices only
  5023.     - allows setting of device data word for character devices
  5024.     - usually used to change from binary to translated I/O
  5025.     - handle in BX must be an opened file or device
  5026.  
  5027.  
  5028. ^Device Data Word
  5029.  
  5030.     │F│E│D│C│B│A│9│8│7│6│5│4│3│2│1│0│  Device Data Word
  5031.      │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ └──── 1 = standard input device
  5032.      │ │ │ │ │ │ │ │ │ │ │ │ │ │ └──── 1 = standard output device
  5033.      │ │ │ │ │ │ │ │ │ │ │ │ │ └──── 1 = NUL device
  5034.      │ │ │ │ │ │ │ │ │ │ │ │ └──── 1 = clock device
  5035.      │ │ │ │ │ │ │ │ │ │ │ └──── reserved
  5036.      │ │ │ │ │ │ │ │ │ │ └──── 1 = binary mode, 0 = translated
  5037.      │ │ │ │ │ │ │ │ │ └──── 0 = end of file on input
  5038.      │ │ │ │ │ │ │ │ └──── 1 = character device
  5039.      └─┴─┴─┴─┴─┴─┴─┴──── reserved, must be zero
  5040.  
  5041.  
  5042. :int 21,44,2:IOCTL,2
  5043. ^INT 21,44,2 / IOCTL,2 - Read From Character Device
  5044.  
  5045.  
  5046.     AH = 44h
  5047.     AL = 02
  5048.     BX = handle
  5049.     CX = number of bytes to read
  5050.     DS:DX = pointer to data buffer
  5051.  
  5052.  
  5053.     on return
  5054.     AX = number of bytes read if CF clear
  5055.        = error code if CF set   (see ~DOS ERROR CODES~)
  5056.  
  5057.  
  5058.     - see bit 14 if IOCTL function 00h to determine if
  5059.       driver can support IOCTL control strings
  5060.  
  5061. :int 21,44,3:IOCTL,3
  5062. ^INT 21,44,3 / IOCTL,3 - Write to Character Device
  5063.  
  5064.  
  5065.     AH = 44h
  5066.     AL = 03
  5067.     BX = handle
  5068.     CX = number of bytes to send
  5069.     DS:DX = pointer to data buffer
  5070.  
  5071.  
  5072.     on return
  5073.     AX = number of bytes written if CF clear
  5074.        = error code if CF set   (see ~DOS ERROR CODES~)
  5075.  
  5076.  
  5077.     - see bit 14 if IOCTL function 00h to determine if
  5078.       driver can support IOCTL control strings
  5079.  
  5080. :int 21,44,4:IOCTL,4
  5081. ^INT 21,44,4 / IOCTL,4 - Read from Block Device
  5082.  
  5083.  
  5084.     AH = 44h
  5085.     AL = 04
  5086.     BL = drive number (0=default, 1=A:, 2=B:, 3=C:, ...)
  5087.     CX = number of bytes to read
  5088.     DS:DX = pointer to data buffer
  5089.  
  5090.  
  5091.     on return
  5092.     AX = number of bytes read if CF clear
  5093.        = error code if CF set  (see ~DOS ERROR CODES~)
  5094.  
  5095.  
  5096.     - block drivers are not required to support this function
  5097.     - returns AX = 01 (invalid function code) if not supported
  5098.  
  5099. :int 21,44,5:IOCTL,5
  5100. ^INT 21,44,5 / IOCTL,5 - Write to Block Device
  5101.  
  5102.  
  5103.     AH = 44h
  5104.     AL = 05
  5105.     BL = drive number (0=default, 1=A:, 2=B:, 3=C:, ...)
  5106.     CX = number of bytes to send
  5107.     DS:DX = pointer to data buffer
  5108.  
  5109.  
  5110.     on return
  5111.     AX = number of bytes written if CF clear
  5112.        = error code if CF set  (see ~DOS ERROR CODES~)
  5113.  
  5114.  
  5115.     - block devices are not required to support this function
  5116.     - returns AX = 01 (invalid function code) if not supported
  5117.  
  5118. :int 21,44,6:IOCTL,6
  5119. ^INT 21,44,6 / IOCTL,6 - Get Input Status
  5120.  
  5121.  
  5122.     AH = 44h
  5123.     AL = 06
  5124.     BX = handle
  5125.  
  5126.  
  5127.     on return
  5128.     CF = 0 if successful
  5129.        = 1 if error
  5130.     AX = error code if CF set  (see ~DOS ERROR CODES~)
  5131.     AL = 00  if EOF (files), or not ready (char devices)
  5132.        = FF  if not EOF (files), or ready (char devices)
  5133.  
  5134.  
  5135.     - used to determine if a file or device is ready for input
  5136.     - can be used to determine EOF unless EOF caused by ~INT 21,42~
  5137.  
  5138. :int 21,44,7:IOCTL,7
  5139. ^INT 21,44,7 / IOCTL,7 - Get Output Status
  5140.  
  5141.  
  5142.     AH = 44h
  5143.     AL = 07
  5144.     BX = handle
  5145.  
  5146.  
  5147.     on return
  5148.     CF = 0 if successful
  5149.        = 1 if error
  5150.     AX = error code if CF set  (see ~DOS ERROR CODES~)
  5151.     AL = 00  if ready (files), or not ready (char devices)
  5152.        = FF  ready (files or char device)
  5153.  
  5154.  
  5155.     - indicates if a device or file is ready for output
  5156.     - files always return ready, character devices don't
  5157.  
  5158. :int 21,44,8:IOCTL,8
  5159. ^INT 21,44,8 / IOCTL,8 - Device Removable Query
  5160.  
  5161.     AH = 44h
  5162.     AL = 08
  5163.     BL = drive number (0=default, 1=A:, 2=B:, 3=C:, ...)
  5164.  
  5165.  
  5166.     on return
  5167.     CF = 0 if successful
  5168.        = 1 if error
  5169.     AX = 00  removable media
  5170.        = 01  non-removable media
  5171.        = error code if CF set  (see ~DOS ERROR CODES~)
  5172.  
  5173.  
  5174.     - used to determine if a device supports removable media
  5175.     - RAM disks are not considered removable media
  5176.     - device drivers compatible with DOS 2.0 do not always respond
  5177.       correctly to this query
  5178.     - implemented from DOS 3.0;  for earlier DOS versions drive A: and
  5179.       B: are removable media since DRIVER.SYS/SUBST are DOS 3.0+ only
  5180. :int 21,44,9:IOCTL,9
  5181. ^INT 21,44,9 / IOCTL,9 - Device Local or Remote Query
  5182.  
  5183.  
  5184.     AH = 44h
  5185.     AL = 09
  5186.     BL = drive number (0=default, 1=A:, 2=B:, 3=C:, ...)
  5187.  
  5188.  
  5189.     on return
  5190.     AX = error code if CF set  (see ~DOS ERROR CODES~)
  5191.     DX = device attribute word
  5192.          bit 12 = 1 if drive is remote
  5193.          bit 12 = 0 if drive is local
  5194.  
  5195.  
  5196.     - used to determine if block device is local or remote
  5197.     - returns invalid function if networking not started
  5198.     - implemented from DOS 3.1
  5199.  
  5200. :int 21,44,a:IOCTL,a
  5201. ^INT 21,44,A / IOCTL,A - Handle Local or Remote Query
  5202.  
  5203.  
  5204.     AH = 44h
  5205.     AL = 0A
  5206.     BX = handle
  5207.  
  5208.  
  5209.     on return
  5210.     AX = error code if CF set  (see ~DOS ERROR CODES~)
  5211.     DX = device attribute word
  5212.          bit 15 = 1 if drive is remote
  5213.          bit 15 = 0 if drive is local
  5214.  
  5215.  
  5216.     - used to determine if block device is local or remote
  5217.     - returns invalid function if networking not started
  5218.     - implemented from DOS 3.1
  5219.  
  5220. :int 21,44,b:IOCTL,b
  5221. ^INT 21,44,B / IOCTL,B - Set Sharing Retry Count
  5222.  
  5223.  
  5224.     AH = 44h
  5225.     AL = 0B
  5226.     CX = pause between retries  (default 1)
  5227.     DX = number of retries    (default 3)
  5228.  
  5229.  
  5230.     on return
  5231.     AX = error code if CF set  (see ~DOS ERROR CODES~)
  5232.  
  5233.  
  5234.     - retry parameters are associated with file locking
  5235.     - differences in CPU and clock speeds affect length of pauses
  5236.     - requires SHARE be loaded or invalid function is returned
  5237.     - implemented from DOS 3.0
  5238.  
  5239. :int 21,44,c:IOCTL,c
  5240. ^INT 21,44,C / IOCTL,C - Generic I/O for Handles
  5241.  
  5242.     AH = 44h
  5243.     AL = 0C
  5244.     BX = handle
  5245.     CH = device type
  5246.        = 00  unknown device type  (DOS 3.3+)
  5247.        = 01  COMx  (DOS 3.3+)
  5248.        = 03  CON  (DOS 3.3+)
  5249.        = 05  LPTx  (DOS 3.3+),  printer  (DOS 3.2)
  5250.     CL = minor function code (when CH = 3 or CH = 5)
  5251.        = 45  set iteration count  (DOS 3.2 only)
  5252.  
  5253.        = 4A  select code page (DOS 3.3+); parameter format:
  5254.            00  word  length of data
  5255.            02  word  code page ID
  5256.            04 nwords character set data array (see offset 00)
  5257.  
  5258.        = 4C  code page prepare start  (DOS 3.3+); parameter format:
  5259.            00  word  flags
  5260.            02  word  length of remainder of parameter block
  5261.            04  word  number of code pages following
  5262.            06 nwords code page 1,...,N
  5263.  
  5264.        = 4D  code page prepare end    (DOS 3.3+); parameter format:
  5265.            00  word  length of data
  5266.            02  word  code page ID
  5267.  
  5268.        = 5F  set display info  (DOS 4.x, when CH=3); parameter format:
  5269.            00  byte  level  (0 for DOS 4.0)
  5270.            01  byte  reserved
  5271.            02  word  length of following data
  5272.            04  word  control flags
  5273.                  bit 0 set for blink, clear for intensity
  5274.                  bits 1 to 15 reserved
  5275.            06  byte  mode type (1=text, 2=graphics)
  5276.            07  byte  reserved
  5277.            08  word  colors;  0=monochrome, n=bits per pixel
  5278.            0A  word  pixel columns
  5279.            0C  word  pixel rows
  5280.            0E  word  character columns
  5281.            10  word  character rows
  5282.  
  5283.        = 65  get iteration count  (DOS 3.2 only)
  5284.  
  5285.        = 6A  query selected code page  (DOS 3.3+); parameter format:
  5286.            00  word  length of data
  5287.            02  word  code page ID
  5288.            04 nwords character set data array  (see offset 00)
  5289.  
  5290.        = 6B  query prepare list  (DOS 3.3+); Parameter format:
  5291.            00  word  length of following data
  5292.            02  word  number of hardware code pages
  5293.            04 nwords hardware code page array
  5294.            xx  word  number of prepared code pages
  5295.            xx nwords prepared code page array
  5296.  
  5297.        = 7F  get display info  (DOS 4.x, CH = 3)
  5298.            00  byte  level  (0 for DOS 4.0)
  5299.            01  byte  reserved
  5300.            02  word  length of following data
  5301.            04  word  control flags
  5302.                    bit 0 set for blink, clear for intensity
  5303.                    bits 1 to 15 reserved
  5304.            06  byte  mode type (1=text, 2=graphics)
  5305.            07  byte  reserved
  5306.            08  word  colors;  0=monochrome, n=bits per pixel
  5307.            0A  word  pixel columns
  5308.            0C  word  pixel rows
  5309.            0E  word  character columns
  5310.            10  word  character rows
  5311.  
  5312.     DS:DX = pointer to iteration count word  (DOS 3.2)
  5313.           = pointer to parameter block  (DOS 3.3)
  5314.  
  5315.  
  5316.     on return
  5317.     AX = error code if CF set  (see ~DOS ERROR CODES~)
  5318.  
  5319.  
  5320.     - iteration count word specifies the number of times to retry
  5321.       an operation before aborting
  5322.     - DOS 3.3 changed this function to handle code page switching
  5323.     - implemented from DOS 3.2
  5324.     - DOS 4.x adds support for double byte characters
  5325.     - see IBM DOS Technical Reference Manual for more details
  5326.  
  5327. :int 21,44,d:IOCTL,d
  5328. ^INT 21,44,D / IOCTL,D - Generic I/O for Block Devices
  5329.  
  5330.     AH = 44h
  5331.     AL = 0D
  5332.     BL = drive number (0=default, 1=A:, 2=B:, 3=C:, ...)
  5333.     CH = device type
  5334.        = 08 for disk drive    (block device)
  5335.     CL = minor function code
  5336.        = 40  set device parameters
  5337.        = 41  write track on logical device
  5338.        = 42  format/verify track on logical drive
  5339.        = 47  set access flag  (DOS 4.x)
  5340.        = 60  get device parameters
  5341.        = 61  read track on logical device
  5342.        = 62  verify track on logical drive
  5343.        = 67  get access flag  (DOS 4.x)
  5344.     DS:DX = pointer to parameter block
  5345.  
  5346.  
  5347.     on return
  5348.     AX = error code if CF set  (see ~DOS ERROR CODES~)
  5349.  
  5350.  
  5351.     - provides device independent primitive control operations
  5352.     - implemented from DOS 3.2
  5353.     - see IBM DOS Technical Reference Manual for more details
  5354.  
  5355. :int 21,44,e:IOCTL,e
  5356. ^INT 21,44,E / IOCTL,E - Get Logical Drive
  5357.  
  5358.  
  5359.     AH = 44h
  5360.     AL = 0E
  5361.     BL = physical drive number (0=default, 1=A:, 2=B:, 3=C:, ...)
  5362.  
  5363.  
  5364.     on return
  5365.     AX = error code if CF set  (see ~DOS ERROR CODES~)
  5366.     AL = logical drive number assigned to physical drive
  5367.        = 0 if drive accessed by only one drive specifier
  5368.        = 1 if drive A:, 2 if drive B:, etc
  5369.  
  5370.  
  5371.     - used to determine the last drive designator used to access
  5372.       a drive if more than one logical drive designation applies
  5373.       to a device
  5374.     - implemented from DOS 3.2
  5375.  
  5376. :int 21,44,f:IOCTL,f
  5377. ^INT 21,44,F / IOCTL,F - Set Logical Drive
  5378.  
  5379.  
  5380.     AH = 44h
  5381.     AL = 0F
  5382.     BL = new drive number (0=default, 1=A:, 2=B:, 3=C:, ...)
  5383.  
  5384.  
  5385.     on return
  5386.     AX = error code if CF set  (see ~DOS ERROR CODES~)
  5387.     AL = logical drive number (should be equal to BL input)
  5388.        = 0 if drive accessed by only one drive specifier
  5389.        = 1 if drive A:, 2 if drive B:, etc
  5390.  
  5391.  
  5392.  
  5393.     - changes the logical drive designator of the physical drive
  5394.       to be accessed next
  5395.     - implemented from DOS 3.2
  5396.  
  5397. :int 21,45
  5398. ^INT 21,45 - Duplicate File Handle
  5399.  
  5400.  
  5401.     AH = 45h
  5402.     BX = file handle
  5403.  
  5404.  
  5405.     on return:
  5406.     AX = new file handle if CF not set
  5407.        = error code if CF set  (see ~DOS ERROR CODES~)
  5408.  
  5409.  
  5410.     - gets another file handle for the same file
  5411.     - both file handles move in unison
  5412.     - often used to flush file data and update a file directory
  5413.       entry without closing the initial file
  5414.  
  5415. :int 21,46
  5416. ^INT 21,46 - Force Duplicate File Handle
  5417.  
  5418.  
  5419.     AH = 46h
  5420.     BX = existing file handle
  5421.     CX = second file handle
  5422.  
  5423.  
  5424.     on return:
  5425.     AX = error code if CF set  (see ~DOS ERROR CODES~)
  5426.  
  5427.  
  5428.     - if file handle in CX is currently open, current file
  5429.       identified by CX is closed and the handle in BX is
  5430.       dupped and placed in CX
  5431.     - after duping file handles move together through file
  5432.     - similar to ~INT 21,45~
  5433.  
  5434. :int 21,47
  5435. ^INT 21,47 - Get Current Directory
  5436.  
  5437.  
  5438.     AH = 47h
  5439.     DL = drive number (0 = default, 1 = A:)
  5440.     DS:SI = pointer to a 64 byte user buffer
  5441.  
  5442.  
  5443.     on return:
  5444.     DS:SI = pointer ASCIIZ directory path string
  5445.     AX = error code if CF set  (see ~DOS ERROR CODES~)
  5446.  
  5447.  
  5448.     - returns the current directory relative to the root directory
  5449.     - the leading slash "\" and drive designator are omitted
  5450.  
  5451. :int 21,48
  5452. ^INT 21,48 - Allocate Memory
  5453.  
  5454.     AH = 48h
  5455.     BX = number of memory paragraphs requested
  5456.  
  5457.  
  5458.     on return:
  5459.     AX = segment address of allocated memory block (MCB + 1para)
  5460.        = error code if CF set  (see ~DOS ERROR CODES~)
  5461.     BX = size in paras of the largest block of memory available
  5462.          if CF set, and AX = 08 (Not Enough Mem)
  5463.     CF = 0 if successful
  5464.        = 1 if error
  5465.  
  5466.  
  5467.     - returns segment address of allocated memory block AX:0000
  5468.     - each allocation requires a 16 byte overhead for the ~MCB~
  5469.     - returns maximum block size available if error
  5470.  
  5471.     - see  ~INT 21,49~,  ~INT 21,4A~
  5472. :int 21,49
  5473. ^INT 21,49 - Free Allocated Memory
  5474.  
  5475.  
  5476.     AH = 49h
  5477.     ES = segment of the block to be returned (~MCB~ + 1para)
  5478.  
  5479.  
  5480.     on return:
  5481.     AX = error code if CF set  (see ~DOS ERROR CODES~)
  5482.  
  5483.  
  5484.     - releases memory and MCB allocated by ~INT 21,48~
  5485.     - may cause unpredictable results is memory wasn't allocated using
  5486.       INT 21,48 or if memory wasn't allocated by the current process
  5487.     - checks for valid MCB id, but does NOT check for process ownership
  5488.     - care must be taken when freeing the memory of another process, to
  5489.       assure the segment isn't in use by a TSR or ISR
  5490.     - this function is unreliable in a TSR once resident, since
  5491.       COMMAND.COM and many other .COM files take all available memory
  5492.       when they load
  5493.     - see  INT 21,4A
  5494. :int 21,4a
  5495. ^INT 21,4A - Modify Allocated Memory Block  (SETBLOCK)
  5496.  
  5497.  
  5498.     AH = 4A
  5499.     BX = new requested block size in paragraphs
  5500.     ES = segment of the block (~MCB~ + 1 para)
  5501.  
  5502.  
  5503.     on return:
  5504.     AX = error code if CF set  (see ~DOS ERROR CODES~)
  5505.     BX = maximum block size possible, if CF set and AX = 8
  5506.  
  5507.  
  5508.     - modifies memory blocks allocated by  ~INT 21,48~
  5509.     - can be used by programs to shrink or increase the size
  5510.       of allocated memory
  5511.     - PC-DOS version 2.1 and DOS 3.x will actually allocate the largest
  5512.       available block if CF is set.  BX will equal the size allocated.
  5513.     - see also  ~INT 21,49~
  5514. :int 21,4b:exec function
  5515. ^INT 21,4B - EXEC/Load and Execute Program
  5516.  
  5517.     AH = 4B
  5518.     AL = 00  to load and execute program
  5519.        = 01  (Undocumented)  create program segment prefix and load
  5520.          program, but don't execute.  The CS:IP and SS:SP of the
  5521.          program is placed in parameter block.    Used by debuggers
  5522.        = 03  load program only
  5523.        = 04  called by MSC spawn() when P_NOWAIT is specified
  5524.     DS:DX = pointer to an ASCIIZ filename
  5525.     ES:BX = pointer to a parameter block
  5526.  
  5527.  
  5528.     on return:
  5529.     AX = error code if CF set  (see ~DOS ERROR CODES~)
  5530.     ES:BX = when AL=1, pointer to parameter block similar to:
  5531.  
  5532. %    Offset Size           Description
  5533.  
  5534.       00   word   when AL=1, segment of env. or zero if using parents env.
  5535.            word   when AL=3, segment of load point for overlay
  5536.       02   dword  when AL=1, pointer to cmd line at PSP 80h
  5537.            word   when AL=3, relocation factor for EXE overlay
  5538.       06   dword  pointer to default ~FCB~ passed at ~PSP~ 5Ch
  5539.       0A   dword  pointer to default FCB passes at PSP 6Ch
  5540.       0E   dword  value of program SS:SP
  5541.       12   dword  value of program CS:IP
  5542.  
  5543.  
  5544.     - allows execution of an external program as well as overlay
  5545.       management from within an application
  5546.     - all registers except CS and IP are destroyed
  5547.     - SS and SP should be preserved in code segment before call
  5548.       since a bug in DOS version 2.x destroys these
  5549.     - return code can be retrieved if child process exits via ~INT 21,4C~
  5550.     - calling process must assure presence of enough unallocated memory
  5551.     - subfunction 4 returns with an error under DOS 4.x+
  5552.     - calls ~INT 21,55~
  5553.  
  5554.     - see also  ~INT 21,26~
  5555.  
  5556. :int 21,4c
  5557. ^INT 21,4C - Terminate Process With Return Code
  5558.  
  5559.  
  5560.     AH = 4C
  5561.     AL = return code (for batch files)
  5562.  
  5563.  
  5564.     returns nothing
  5565.  
  5566.  
  5567.     - approved method of program termination
  5568.     - restores the terminate, ~Ctrl-Break~, and critical error exit
  5569.       addresses, flushes all buffers, frees memory and returns to
  5570.       DOS via the termination handler address
  5571.     - does not close FCBs
  5572.     - this function is not supported in versions of DOS before 2.x,
  5573.       so use ~INT 21,0~  or     ~INT 20~  to exit.
  5574.  
  5575.  
  5576.     - see also  ~INT 27~   ~INT 21,31~
  5577.  
  5578. :int 21,4d
  5579. ^INT 21,4D - Get Return Code of Sub-process
  5580.  
  5581.  
  5582.     AH = 4D
  5583.  
  5584.  
  5585.     on return:
  5586.     AH = system exit code  (indicates normal termination)
  5587.        = 00 for normal termination
  5588.        = 01 if terminated by ctl-break
  5589.        = 02 if critical device error
  5590.        = 03 if terminated by ~INT 21,31~
  5591.     AL = child exit code
  5592.  
  5593.  
  5594.     - retrieve child process and system exit codes
  5595.     - this function can only be used to retrieve the exit code once
  5596.       multiple attempts to read exit codes will cause errors
  5597.  
  5598. :int 21,4e
  5599. ^INT 21,4E - Find First Matching File
  5600.  
  5601.     AH = 4E
  5602.     CX = attribute used during search  (see ~FILE ATTRIBUTES~)
  5603.     DS:DX = pointer to ASCIIZ filespec, including wildcards
  5604.  
  5605.  
  5606.     on return:
  5607.     AX = error code if CF set  (see ~DOS ERROR CODE~)
  5608.     ~DTA~ = data returned from call in the format:
  5609.  
  5610. %    Offset Size     Description
  5611.  
  5612.       00   byte    attribute of search (undocumented)
  5613.            byte    drive letter used in search (DOS 3.1-4.x, undocumented)
  5614.       01   byte    drive letter used in search (undocumented)
  5615.          11bytes   search name used (DOS 3.1-4.x, undocumented)
  5616.       02 11bytes   search name used (undocumented)
  5617.       0C   byte    attribute of search (DOS 3.1-4.x, undocumented)
  5618.       0D   word    directory entry number (0 based, undocumented)
  5619.       0F   word    starting cluster number of current directory; zero
  5620.                for root directory  (DOS 3.2+, undocumented)
  5621.            dword   pointer to DTA (DOS 2.x-3.1, undocumented)
  5622.       11   word    reserved
  5623.       13   word    starting cluster number of current directory; zero
  5624.                for root directory  (DOS 2.x+, undocumented)
  5625.       15   byte    attribute of matching file
  5626.       16   word    file time  (see ~FILE ATTRIBUTES~)
  5627.       18   word    file date  (see FILE ATTRIBUTES)
  5628.       1A   word    file size
  5629.       1E 13bytes   ASCIIZ filename and extension in the form NAME.EXT
  5630.                with blanks stripped
  5631.  
  5632.     - returns information on first file matching specifications
  5633.     - use ~INT 21,4F~ to retrieve following file matches
  5634.     - DOS 2.x cannot find . and .. entries, while DOS 3.x can unless
  5635.       they represent the root directory
  5636.     - character devices return a zero for size, time and date in DOS 2.x,
  5637.       while DOS 3.0 returns a 40h attribute and current time and date.
  5638.     - multiple calls to this function with a character device will
  5639.       result in unpredictable results
  5640.     - normal files are always included along with files that match the
  5641.       requested attributes except when the LABEL attribute is requested.
  5642.       DOS 2.x returns all normal files when label is specified but 3.x
  5643.       doesn't.  It's up to the programmer to determine which actually
  5644.       match the requested attributes.
  5645.     - bit 8 of CX (file attributes) indicates Novell Netware shareable
  5646.     - see    INT 21,1A
  5647.  
  5648. :int 21,4f
  5649. ^INT 21,4F - Find Next Matching File
  5650.  
  5651.  
  5652.     AH = 4F
  5653.     DS:DX = unchanged from previous function 4E
  5654.  
  5655.  
  5656.     on return:
  5657.     AX = error code if CF set  (see ~DOS ERROR CODES~)
  5658.  
  5659.  
  5660.     - ~INT 21,4E~ should be called to find the first file and this
  5661.       function should be called to find all other matching files
  5662.     - normal files are always included along with files that match
  5663.       the requested attributes except when the LABEL attribute is
  5664.       requested.  It's up to the programmer to determine which
  5665.       actually match the requested attributes.
  5666.     - see  ~INT 21,1A~  ~DTA~  ~FILE ATTRIBUTES~
  5667.  
  5668. :int 21,50
  5669. ^INT 21,50 - Set Current Process ID  (Undocumented DOS 2.x)
  5670.  
  5671.  
  5672.     AH = 50h
  5673.     BX = process ID number (process ~PSP~ segment address)
  5674.  
  5675.  
  5676.     returns nothing
  5677.  
  5678.  
  5679.     - the process ID number is actually the segment address of a
  5680.       program's PSP.  This is useful for TSR's to access their own
  5681.       file handle table inside their PSP.
  5682.     - this function cannot be called while in an ~INT 28~ handler in
  5683.       DOS 2.x unless the critical error flag is set or stack corruption
  5684.       will occur
  5685.     - safe in DOS 3.x INT 28 handlers since they use a different stack
  5686.       by default
  5687.     - available in OS/2 compatibility box
  5688.     - see  ~INT 21,51~   ~INT 21,62~
  5689.  
  5690. :int 21,51
  5691. ^INT 21,51 - Get Current Process ID  (Undocumented DOS 2.x)
  5692.  
  5693.     AH = 51h
  5694.  
  5695.     on return:
  5696.     BX = process ID
  5697.  
  5698.  
  5699.     - The process ID  number is actually the segment address of program's
  5700.       PSP.     This in conjunction with ~INT 21,50~ is useful for TSR's to
  5701.       access their own file handle table in their respective ~PSP~.
  5702.     - this function cannot be called while in an ~INT 28~ handler in
  5703.       DOS 2.x unless the critical error flag is set or stack corruption
  5704.       will occur
  5705.     - ~INT 21,62~ is highly recommended for DOS 3.x due to a possible bug
  5706.       when activated from a TSR.  DOS may switch to the wrong internal
  5707.       stack which may cause a problems with TSR's if called during an
  5708.       INT 28.
  5709.     - see INT 21,62 (Get PSP segment) for DOS 3.x applications
  5710. :int 21,52:INVARS
  5711. ^INT 21,52 - Get Pointer to DOS "INVARS"  (Undocumented)
  5712.  
  5713.     AH = 52h
  5714.  
  5715.     on return:
  5716.     ES:BX = pointer to DOS "invars", a table of pointers used by DOS.
  5717.         Known "invars" fields follow (varies with DOS version):
  5718.  
  5719. %    Offset Size         Description
  5720.  
  5721.      -12   word   sharing retry count (DOS 3.1-3.3)
  5722.      -10   word   sharing retry delay  (DOS 3.1-3.3)
  5723.       -8   dword  pointer to current disk buffer (DOS 3.x)
  5724.       -4   word   pointer in DOS code segment of unread CON input;
  5725.               0 indicates no unread input (DOS 3.x)
  5726.       -2   word   segment of first Memory Control Block (~MCB~)
  5727.       00   dword  pointer to first ~DRIVE PARAMETER TABLE~ (A:) in chain
  5728.       04   dword  pointer to DOS ~System File Table~ (SFT)
  5729.       08   dword  pointer to $CLOCK device driver
  5730.       0C   dword  pointer to CON device driver
  5731.       10   byte   number of logical drives in system
  5732.       11   word   maximum bytes/block of any block device
  5733.       13   dword  pointer to DOS cache buffer header
  5734.       17 18bytes  NUL device header, first 4 bytes of device header
  5735.               point to the next device in device chain
  5736.  
  5737.  
  5738. ^DOS 3.0 Specific Information
  5739.  
  5740. %    Offset Size        Description
  5741.  
  5742.       10   byte   number of block devices
  5743.       11   word   max sector size used by DOS prior to loading block
  5744.               device drivers;  limits allowable device sector size
  5745.       13   dword  pointer to DOS cache buffer header
  5746.       17   dword  pointer to drive information table
  5747.       1B   byte   value of LASTDRIVE command in CONFIG.SYS
  5748.       1C   dword  pointer to STRING= workspace area
  5749.       20   word   size of STRING area (CONFIG.SYS value of STRING=x)
  5750.       22   dword  ~FCB~ file table pointer
  5751.       26   word   number of protected FCBs
  5752.       28  18bytes NUL device header, first 4 bytes of device header
  5753.               point to the next device in device chain
  5754.  
  5755.  
  5756. ^DOS 3.1-3.3  Specific Information
  5757.  
  5758. %    Offset Size         Description
  5759.  
  5760.       10   word   max sector size used by DOS prior to loading block
  5761.               device drivers;  limits allowable device sector size
  5762.       12   dword  pointer to DOS cache buffer header
  5763.       16   dword  pointer to drive information table
  5764.       1A   dword  ~FCB~ file table pointer
  5765.       1E   word   number of protected FCBs
  5766.       20   byte   number of block devices
  5767.       21   byte   value of LASTDRIVE command in CONFIG.SYS
  5768.       22  18bytes NUL device header, first 4 bytes of device header
  5769.               point to the next device in device chain
  5770.       34   byte   number of JOIN'ed drives
  5771.  
  5772.  
  5773. ^DOS 4.x  Specific Information
  5774.  
  5775. %    Offset Size        Description
  5776.  
  5777.       10   word   max sector size used by DOS prior to loading block
  5778.               device drivers;  limits allowable device sector size
  5779.       12   dword  pointer to DOS cache buffer header
  5780.       16   dword  pointer to drive information table
  5781.       1A   dword  FCB file table pointer
  5782.       1E   word   number of protected FCBs
  5783.       20   byte   number of block devices
  5784.       21   byte   value of LASTDRIVE command in CONFIG.SYS (default 5)
  5785.       22  18bytes NUL device header, first 4 bytes of device header
  5786.               point to the next device in device chain
  5787.       34   byte   number of joined drives
  5788.       35   word   pointer within IBMDOS code segment to list of special
  5789.               program names
  5790.       37   dword  pointer to resident IFS utility function
  5791.       3B   dword  pointer to chain of installable file system drivers
  5792.       3F   word   the x in BUFFERS x,y (rounded up to multiple of 30
  5793.               if EMS is used)
  5794.       41   word   the y in BUFFERS x,y
  5795.       43   byte   boot drive (1=A:)
  5796.       44   byte   ???
  5797.       45   byte   extended memory size in K bytes
  5798.  
  5799.  
  5800.     - see ~Bibliography~ references for Bernd Schemmer & "Undocumented DOS"
  5801.     - see   ~INDOS~  ~INT 21,5D~
  5802. :int 21,53
  5803. ^INT 21,53 - Generate Drive Parameter Table  (Undocumented)
  5804.  
  5805.  
  5806.     AH = 53h
  5807.     DS:SI = address of BIOS Parameter Block (~BPB~)
  5808.     ES:BP = pointer to buffer to hold first Drive Parameter Table (~DPT~)
  5809.  
  5810.  
  5811.     returns:
  5812.     ES:BP = pointer to buffer containing the first Drive Parameter Table
  5813.         in chain
  5814.  
  5815.  
  5816.     - available since DOS 2.0+
  5817.     - translates BPB  into a DOS Disk Parameter Table
  5818.     - see  ~INT 21,32~  ~INT 21,52~
  5819. :int 21,54
  5820. ^INT 21,54 - Get Verify Setting
  5821.  
  5822.  
  5823.     AH = 54h
  5824.  
  5825.  
  5826.     on return:
  5827.     AL = 00  verify off
  5828.        = 01  verify on
  5829.  
  5830.  
  5831.     - returns value of disk read after write verification flag
  5832.  
  5833.     - see    ~INT 21,2E~
  5834.  
  5835. :int 21,55
  5836. ^INT 21,55 - Create New PSP  (Undocumented)
  5837.  
  5838.     AH = 55h
  5839.     DX = New PSP segment address
  5840.     SI = memory size value to place in ~PSP~ offset 02h (DOS 3+)
  5841.  
  5842.     returns nothing
  5843.  
  5844.     - the following should be observed when using this function
  5845.  
  5846.       o  Allocate memory for the PSP and program code  (~INT 21,48~)
  5847.       o  Duplicate the PSP     (~INT 21,55~)
  5848.       o  Load program code into allocated segment above the new PSP
  5849.       o  Save Current PSP
  5850.       o  Set PSP to the PSP just created  (~INT 21,50~)
  5851.       o  Jump to start of code if .COM otherwise handle relocation,
  5852.          setup stack and registers
  5853.  
  5854.     - similar to ~INT 21,26~ except the PSP is setup by DOS
  5855.     - increments reference count in ~SFT~ for all inherited files
  5856.     - files flagged as not inheritable are marked as closed in the
  5857.       new PSP
  5858.     - invoked by ~INT 21,4B~
  5859.  
  5860.     - see    ~UNDOC~   ~INT 21,4B~   ~INT 21,26~
  5861. :int 21,56
  5862. ^INT 21,56 - Rename File
  5863.  
  5864.  
  5865.     AH = 56h
  5866.     DS:DX = pointer to old ASCIIZ path/filename
  5867.     ES:DI = pointer to new ASCIIZ path/filename
  5868.  
  5869.  
  5870.     on return:
  5871.     AX = error code if CF set  (see ~DOS ERROR CODES~)
  5872.  
  5873.  
  5874.     - supports full pathnames and allows renaming files across
  5875.       directories and in DOS 3.x allows renaming subdirectories
  5876.     - does not support use of wildcards unless invoked from via
  5877.       ~INT 21,5D~ in which case error code 12h is returned
  5878.     - unpredictable result may occur if an opened file is renamed
  5879.     - see ~Bibliography~ reference to "Undocumented DOS"
  5880. :int 21,57
  5881. ^INT 21,57 - Get/Set File Date and Time Using Handle
  5882.  
  5883.     AH = 57h
  5884.     AL = 00  get date and time
  5885.        = 01  set date and time
  5886.        = 02  ??? (DOS 4.0+ undocumented)
  5887.        = 03  ??? (DOS 4.0+ undocumented) 
  5888.        = 04  ??? (DOS 4.0+ undocumented)
  5889.     BX = file handle
  5890.     CX = time to set (if setting)
  5891.     DX = date to set (if setting)
  5892.     ES:DI = pointer to buffer to contain results
  5893.  
  5894.  
  5895.     on return:
  5896.     AX = error code if CF set  (see  ~DOS ERROR CODES~)
  5897.     CX = file time (if reading, see below)
  5898.     DX = file date (if reading, see below)
  5899.  
  5900. %    Time encoding:
  5901.  
  5902.     │F│E│D│C│B│A│9│8│7│6│5│4│3│2│1│0│  Time in CX
  5903.      │ │ │ │ │ │ │ │ │ │ │ └─┴─┴─┴─┴────  two second incr (0-29)
  5904.      │ │ │ │ │ └─┴─┴─┴─┴─┴─────────────  minutes 0-59)
  5905.      └─┴─┴─┴─┴────────────────────────  hours (0-29)
  5906.  
  5907. %    Date Encoding
  5908.  
  5909.     │F│E│D│C│B│A│9│8│7│6│5│4│3│2│1│0│  Date in DX
  5910.      │ │ │ │ │ │ │ │ │ │ │ └─┴─┴─┴─┴────  day (1-31)
  5911.      │ │ │ │ │ │ │ └─┴─┴─┴─────────────  month (1-12)
  5912.      └─┴─┴─┴─┴─┴─┴────────────────────  year - 1980
  5913. :int 21,58
  5914. ^INT 21,58 - Get/Set Memory Allocation Strategy
  5915. ^(Undocumented, DOS 3.x)
  5916.  
  5917.     AH = 58h
  5918.     AL = 00  get strategy code
  5919.        = 01  set strategy code
  5920.     BX = strategy code (when AL = 01)
  5921.  
  5922.     │F-8│7│6│5│4│3│2│1│0│  Time in CX
  5923.       │  │ │ │ │ │ │ └─┴────  strategy bits (see below)
  5924.       │  │ │ └─┴─┴─┴───────  unused
  5925.       │  │ └──────────────  allocate in high-memory only
  5926.       │  └───────────────  allocate in high memory first
  5927.       └─────────────────  unused
  5928.  
  5929. %          Strategy Bits    Description
  5930. %            10
  5931.             00    First Fit
  5932.             01    Best Fit
  5933.             10    Last Fit
  5934.  
  5935.  
  5936.     on return:
  5937.     AX = strategy code if CF clear
  5938.        = error if CF set, see  ~DOS ERROR CODES~
  5939.  
  5940.  
  5941.     - defaults to first fit, first block large enough is chosen in
  5942.       normal DOS memory
  5943.     - in first fit, DOS searches the ~MCB~ chain from low addresses to
  5944.       high for the first block large enough to fill the request.  For
  5945.       best fit, DOS searches all memory blocks for the closest fit.
  5946.       In last fit, DOS starts at high addresses and works downward
  5947.       and uses the high part of the chosen block
  5948.     - in DOS version before DOS 5.0 any strategy value greater than 2
  5949.       defaulted to 2, but the last value set, even if incorrect, is
  5950.       the value returned by the get strategy
  5951. :int 21,59
  5952. ^INT 21,59 - Get Extended Error Information (DOS 3.0+)
  5953.  
  5954.     AH = 59h
  5955.     BX = 00 for versions  3.0, 3.1, 3.2
  5956.  
  5957.  
  5958.     on return:
  5959.     AX = extended error code (see ~DOS ERROR CODES~)
  5960.        = 0 if no error
  5961.     BH = error class
  5962.     BL = suggested action
  5963.     CH = locus
  5964.  
  5965.  
  5966.     - may be called after any  ~INT 21~  function or from
  5967.       ~INT 24~ when an error is returned
  5968.     - must be called immediately after the error occurs
  5969.     - registers CX, DX, DI, SI, BP, DS and ES are destroyed
  5970. :int 21,5a
  5971. ^INT 21,5A - Create Temporary File  (DOS 3.0+)
  5972.  
  5973.  
  5974.     AH = 5A
  5975.     CX = attribute
  5976.     DS:DX = pointer to ASCIIZ path ending in '\'
  5977.  
  5978.  
  5979.     on return:
  5980.     AX = handle if call CF clear
  5981.        = error code if CF set  (see ~DOS ERROR CODES~)
  5982.     DS:DX = pointer to updated ASCIIZ filespec
  5983.  
  5984.  
  5985.     - creates files with random names with any combination of
  5986.       the following attributes: normal, system and hidden
  5987.     - ending backslash is required
  5988.  
  5989. :int 21,5b
  5990. ^INT 21,5B - Create File  (DOS 3.0+)
  5991.  
  5992.  
  5993.     AH = 5B
  5994.     CX = attribute
  5995.     DS:DX = pointer to ASCIIZ path/filename
  5996.  
  5997.  
  5998.     on return:
  5999.     AX = handle if CF not set
  6000.        = error code if CF set  (see ~DOS ERROR CODES~)
  6001.  
  6002.  
  6003.     - standard method of opening files
  6004.     - returns a file handle of a file opened with specified
  6005.       attributes (combinations of normal, system and hidden)
  6006.  
  6007. :int 21,5c
  6008. ^INT 21,5C - Lock/Unlock File Access  (DOS 3.0+)
  6009.  
  6010.     AH = 5C
  6011.     AL = 00  lock file
  6012.        = 01  unlock file
  6013.     BX = file handle
  6014.     CX = most significant word of region offset
  6015.     DX = least significant word of region offset
  6016.     SI = most significant word of region length
  6017.     DI = least significant word of region length
  6018.  
  6019.  
  6020.     on return:
  6021.     AX = error code if CF set  (see ~DOS ERROR CODES~)
  6022.  
  6023.  
  6024.     - used for networking and multi-tasking system to preserve
  6025.       data integrity
  6026.     - duplicated handles inherit access to locked regions
  6027.     - EXEC'd programs do not inherit access to locked regions
  6028. :int 21,5d
  6029. ^INT 21,5D - Critical Error Information  (Undocumented, DOS 3.x+)
  6030.  
  6031. %    See second reference below for more information about this interrupt
  6032. %    information presented here is incomplete
  6033.  
  6034.     AH = 5D
  6035.     AL = 00  server function call  (DOS 3.1+)
  6036.        = 01  commit all files  (DOS 3.1+)
  6037.        = 02  SHARE: close file by name  (DOS 3.1+)
  6038.        = 03  SHARE: close all files for given computer  (DOS 3.1+)
  6039.        = 04  SHARE: close all files for given process  (DOS 3.1+)
  6040.        = 05  SHARE: get open file list entry  (DOS 3.1+)
  6041.        = 06  get address of DOS swappable area into DS:SI  (DOS 3.0+)
  6042.        = 07  get network redirected printer mode  (DOS 3.1+)
  6043.        = 08  set network redirected printer mode  (DOS 3.1+)
  6044.        = 09  flush network redirected printer output  (DOS 3.1+)
  6045.        = 0A  set extended error information  (DOS 3.1+)
  6046.        = 0B  get DOS swappable data areas  (DOS 4.x+)
  6047.     DS:DX = pointer to 18 byte DOS Parameter List (DPL, if AL=00)
  6048.           = pointer to 9 byte data block of the form (AL=0A):
  6049.  
  6050. %          Offset Size    Description
  6051.  
  6052.         00   word   extended error code to set
  6053.         02   dword  pointer to driver address to set
  6054.         06   byte   action code to set
  6055.         07   byte   class code to set
  6056.         08   byte   locus code to set
  6057.  
  6058.     on return:
  6059.     DS:SI = (if AL was 6) address of critical flag of the form:
  6060.  
  6061. %          Offset Size      Description
  6062.  
  6063.         00   word   extended error code
  6064.         02   byte   action code
  6065.         03   byte   class code
  6066.         04   byte   pointer to driver address
  6067.  
  6068.     - function 0 copies 18 bytes from DS:SI to the DOS internal
  6069.       register-save area;  this data will be placed in the registers
  6070.       when DOS returns to the caller thereby circumventing the DOS
  6071.       register save logic
  6072.     - may be used by a TSR to prevent accidental changing of an error
  6073.       code and causing problems in the foreground process
  6074.     - see ~bibliography~ references for "Undocumented DOS" and "DOS
  6075.       Programmers Reference"
  6076.  
  6077.     - see    ~INT 21,59~
  6078. :int 21,5e
  6079. ^INT 21,5E  AL=0  Get Machine Name  (DOS 3.1+)
  6080.  
  6081.     AH = 5E
  6082.     AL = 00 get machine name
  6083.     DS:DX = far pointer to buffer receiving name string
  6084.  
  6085.  
  6086.     on return:
  6087.     AX = error code if CF set, (invalid function)
  6088.     CH = 0    if name not defined
  6089.        > 0    if name defined
  6090.     CL = NETBIOS name number, if CH not 0
  6091.     DS:DX = far pointer to buffer containing string if CH not 0
  6092.  
  6093.  
  6094.     - returns pointer to an ASCIIZ string identifying the
  6095.       computer on a Microsoft network
  6096.     - output string is a 15 bytes long, padded with blanks and
  6097.       null terminated
  6098.     - unpredictable if called without file sharing loaded
  6099.  
  6100.  
  6101. ^INT 21,5E  AL=01  Set Machine Name  (DOS 3.1+)
  6102.  
  6103.     AH = 5E
  6104.     AL = 01 set machine name
  6105.     CH = 00 undefine name
  6106.        = any other value means to define name
  6107.     CL = name number
  6108.     DS:DX = pointer to 15 byte, blank padded ASCIIZ name string
  6109.  
  6110.  
  6111.     on return:
  6112.     AX = error code if CF set, (invalid function)
  6113.  
  6114.  
  6115.     - specifies the network machine name on a Microsoft network
  6116.     - unpredictable if called without file sharing loaded
  6117.  
  6118.  
  6119. ^INT 21,5E  AL=02  Set Printer Setup  (DOS 3.1+)
  6120.  
  6121.  
  6122.     AH = 5E
  6123.     AL = 02 set printer setup
  6124.     BX = redirection list index (see ~INT 21,5F~ AL=2)
  6125.     CX = length of setup string
  6126.     DS:SI = far pointer to printer setup string
  6127.  
  6128.  
  6129.     on return:
  6130.     AX = error code if CF set, (invalid function)
  6131.  
  6132.  
  6133.     - see INT 21,5F subfunction 2 for information on obtaining the
  6134.       redirection list index
  6135.     - fails if file sharing is not loaded
  6136.  
  6137.  
  6138. ^INT 21,5E  AL=03  Get Printer Setup  (DOS 3.1+)
  6139.  
  6140.  
  6141.     AH = 5E
  6142.     AL = 03 get printer setup
  6143.     BX = redirection list index (see ~INT 21,5F~ AL=2)
  6144.     ES:DI = far pointer to buffer to receive setup string
  6145.  
  6146.  
  6147.     on return:
  6148.     AX = error code if CF set
  6149.  
  6150.  
  6151.     - see INT 21,5F subfunction 2 for information on obtaining the
  6152.       redirection list index
  6153.     - fails if file sharing is not loaded
  6154.  
  6155.  
  6156. ^INT 21,5E  AL=04  Set Printer Mode  (DOS 3.1+)
  6157.  
  6158.  
  6159.     AH = 5E
  6160.     AL = 04  set printer setup
  6161.     BX = redirection list index (see INT 21,5F AL=2)
  6162.     DX = printer mode to set (bit zero is set for binary mode and clear
  6163.          for translated/text mode)
  6164.  
  6165.  
  6166.     on return:
  6167.     AX = error code if CF set
  6168.  
  6169.  
  6170.     - see INT 21,5F subfunction 2 for information on obtaining the
  6171.       redirection list index
  6172.     - fails if file sharing is not loaded
  6173.     - issues ~INT 2F,11~  and  ~INT 2F,1F~
  6174.  
  6175.  
  6176. ^INT 21,5E  AL=05  Get Printer Mode  (DOS 3.1+)
  6177.  
  6178.  
  6179.     AH = 5E
  6180.     AL = 05  set printer setup
  6181.     BX = redirection list index (see INT 21,5F AL=2)
  6182.  
  6183.  
  6184.     on return:
  6185.     AX = error code if CF set
  6186.     DX = printer mode where bit zero is set for binary mode and
  6187.          clear for translated mode
  6188.  
  6189.  
  6190.  
  6191.     - see ~INT 21,5F~ subfunction 2 for information on obtaining the
  6192.       redirection list index
  6193.     - fails if file sharing is not loaded
  6194.     - issues  ~INT 2F,11~  and  ~INT 2F,1F~
  6195. :int 21,5f
  6196. ^INT 21,5F  AL=00  Get Redirection Mode  (DOS 3.1+)
  6197.  
  6198.  
  6199.     AH = 5F
  6200.     AL = 00
  6201.     BL = redirection type
  6202.        = 03  printer
  6203.        = 04  disk drive
  6204.  
  6205.  
  6206.     on return:
  6207.     AX = error code if CF is set
  6208.     BH = device redirection state
  6209.        = 00  redirection off
  6210.        = 01  redirection on
  6211.  
  6212.  
  6213.     - determines if disk or printer redirection is enabled
  6214.     - fails if file sharing is not loaded
  6215.  
  6216.  
  6217. ^INT 21,5F  AL=01  Set Redirection Mode  (DOS 3.1+)
  6218.  
  6219.  
  6220.     AH = 5F
  6221.     AL = 01
  6222.     BH = device redirection state
  6223.        = 00  turn redirection off
  6224.        = 01  turn redirection on
  6225.     BL = redirection type
  6226.        = 03  printer
  6227.        = 04  disk drive
  6228.  
  6229.  
  6230.     on return:
  6231.     AX = error code if CF is set
  6232.  
  6233.  
  6234.     - enables or disables disk or printer redirection
  6235.     - local devices are used when redirection is off
  6236.     - fails if file sharing is not loaded
  6237.  
  6238.  
  6239. ^INT 21,5F  AL=02  Get Redirection List Entry  (DOS 3.1+)
  6240.  
  6241.     AH = 5F
  6242.     AL = 02
  6243.     BX = redirection list index
  6244.     DS:SI = far pointer to a 16 byte buffer to hold device name
  6245.     ES:DI = far pointer to a 128 byte buffer to hold network name
  6246.  
  6247.     on return:
  6248.     AX = error code if CF is set
  6249.        = 1    invalid function code
  6250.        = 12 no more files
  6251.     BH = device status flag,
  6252.        bit 0 = 0  device valid
  6253.        bit 0 = 1  device invalid
  6254.     BL = device type
  6255.        = 3    printer
  6256.        = 4    drive
  6257.     CX = stored parameter value
  6258.     DS:SI = far pointer to ASCIIZ local device name
  6259.     ES:DI = far pointer to ASCIIZ network name
  6260.  
  6261.     - value returned in CX is the value previously passed to
  6262.       INT 21,5F with subfunction 3 in register CX
  6263.     - registers DX and BP are destroyed
  6264.     - fails if file sharing is not loaded
  6265.  
  6266.  
  6267. ^INT 21,5F  AL=03  Redirect Device  (DOS 3.1+)
  6268.  
  6269.     AH = 5F
  6270.     AL = 03
  6271.     BL = device type
  6272.        = 3 if printer
  6273.        = 4 if drive
  6274.     CX = parameter to save for caller
  6275.     DS:SI = far pointer to ASCIIZ local device name
  6276.     ES:DI = far pointer to ASCIIZ network name followed
  6277.         by ASCIIZ password
  6278.  
  6279.     on return
  6280.     AX = error code if CF is set
  6281.        = 1    invalid function code or
  6282.         invalid source or destination string format or
  6283.         source device already redirected
  6284.        = 3    path not found
  6285.        = 5    access denied
  6286.        = 8    insufficient memory
  6287.  
  6288.     - parameter passed in CX can later be retrieved by calls
  6289.       to INT 21,5F subfunction 2
  6290.     - local device name in DS:SI can be a drive designator
  6291.       (D:), a printer name (PRN or LPTx), or a null string
  6292.     - when a null string is followed by a password is used, DOS
  6293.       tries granting access to the network directory using the
  6294.       given password
  6295.     - fails if file sharing is not loaded
  6296.  
  6297.  
  6298. ^INT 21,5F  AL=04  Cancel Device Redirection  (DOS 3.1+)
  6299.  
  6300.  
  6301.     AH = 5F
  6302.     AL = 04
  6303.     DS:SI = far pointer to ASCIIZ local device name
  6304.  
  6305.  
  6306.     on return
  6307.     AX = error code if CF set
  6308.        = 01  function code invalid
  6309.          ASCIIZ string is not an existing source device
  6310.        = 0F  redirection paused on server
  6311.  
  6312.  
  6313.     - local device name in DS:SI can be a drive designator
  6314.       (D:), a printer name (PRN or LPTx), or a string beginning
  6315.       with 2 backslashes "\\"
  6316.     - when two backslashes are used for the string the connection
  6317.       between the local machine and network directory terminates
  6318.     - fails if file sharing is not loaded
  6319.  
  6320. ^INT 21,5F  AL=05  Get Redirection List Extended Entry (DOS 4.0+)
  6321.  
  6322.     AH = 5F
  6323.     AL = 05
  6324.     BX = redirection list index
  6325.     DS:SI = pointer to buffer to receive ASCIIZ source device name
  6326.     ES:DI = pointer to buffer to receive ASCIIZ network path
  6327.  
  6328.     on return
  6329.     AX = error code if CF set
  6330.     BH = device status flag (bit 0 clear if valid)
  6331.     BL = device type
  6332.        = 03  printer device
  6333.        = 04  disk device
  6334.     CX = stored user parameter value
  6335.     BP = NETBIOS local session number
  6336.     DS:SI = pointer to buffer containing ASCIIZ source device name
  6337.     ES:DI = pointer to buffer containing ASCIIZ network path
  6338.  
  6339.  
  6340.     - retrieves the status, type, source and target of a given redirection
  6341.     - fails if file sharing is not loaded
  6342.  
  6343.  
  6344. ^INT 21,5F  AL=06  Get Redirection List (DOS 4.0+)
  6345.  
  6346.  
  6347.     AH = 5F
  6348.     AL = 06
  6349.  
  6350.     - no information is currently available for this subfunction
  6351. :int 21,60
  6352. ^INT 21,60 - Get Fully Qualified File Name (Undocumented 3.x+)
  6353.  
  6354.  
  6355.     AH = 60h
  6356.     DS:SI = pointer to ASCIIZ string containing unqualified filename
  6357.     ES:DI = pointer to 128 byte buffer to contain fully qualified filename
  6358.  
  6359.  
  6360.     on return:
  6361.     ES:DI = address of fully qualified filename string
  6362.     AH = error code if CF set
  6363.  
  6364.  
  6365.     - undocumented, available in DOS 3.x+
  6366.     - does not check for file existence, simple provides a fully
  6367.       qualified filename for the given filespec
  6368.     - this function ignores ASSIGN'ed, JOIN'ed, SUBST'ed and network
  6369.       redirections and returns the true path name
  6370.     - returned string is in upper case and has forward slashes replaced
  6371.       by back slashes;  filename always begins with "d:" or "\\" format
  6372.     - AL register is destroyed
  6373.     - supported by OS/2 1.1 compatibility box
  6374. :int 21,62
  6375. ^INT 21,62 - Get PSP address  (DOS 3.x)
  6376.  
  6377.  
  6378.     AH = 62h
  6379.  
  6380.  
  6381.     on return:
  6382.     BX = segment address of current process
  6383.  
  6384.  
  6385.  
  6386.     - this is useful for TSR's to access their own file handles
  6387.     - for DOS 2.x use ~INT 21,51~
  6388.  
  6389.     - see also  ~INT 21,50~
  6390. :int 21,63
  6391. ^INT 21,63 - Get Lead Byte Table  (MSDOS 2.25 only)
  6392.  
  6393. %    See below for information on the Asian INT 21,63 specifications
  6394.  
  6395.     AH = 63h
  6396.     AL = 00  get address of system lead byte table
  6397.        = 01  set or clear interim console flag
  6398.        = 02  get value of interim console flag
  6399.     DL = 00  clear interim console flag (when AL=01)
  6400.        = 01  set interim console flag (when AL=01)
  6401.  
  6402.     on return
  6403.     AX = error code if CF set
  6404.     DS:SI = far pointer to lead byte table (AL=00)
  6405.     DL = value of interim console flag (AL=02)
  6406.  
  6407.     - available only in MSDOS 2.25
  6408.     - provides multiple byte character support
  6409.     - function 00, returns the address of system table containing
  6410.       legal lead byte ranges
  6411.     - function 01 & 02 set and get the interim console flag which
  6412.       determines whether interim bytes are returned on some console
  6413.       functions
  6414.     - all registers except CS:IP and SS:SP may be destroyed
  6415.  
  6416.  
  6417. ^INT 21,63 - Get Lead Byte Table  (Asian DOS 3.2+)
  6418.  
  6419.     AH = 63h
  6420.     AL = 00  get address of Double Byte Character Set (DBCS) lead table
  6421.        = 01  set Hongeul (Korean) input mode
  6422.        = 02  get Hongeul (Korean) input mode
  6423.     DL = new keyboard input mode
  6424.        = 00  return completely formed characters only
  6425.        = 01  return partially formed characters also
  6426.  
  6427.  
  6428.     on return
  6429.     AL = 00 on success
  6430.        = FF if function not supported
  6431.     DS:SI = pointer to DBCS table  (function 00)
  6432.     DL = current keyboard input mode (function 02)
  6433.        = 00  only completely formed characters are accepted
  6434.        = 01  partially formed characters are accepted
  6435.  
  6436.  
  6437.     - available only in Asian MSDOS 3.2+
  6438.     - provides Asian multiple byte character support
  6439.     - all registers except CS:IP and SS:SP may be destroyed
  6440.     - DOS 4.0 returns an empty list
  6441. :int 21,64
  6442. ^INT 21,64 - Set Device Driver Look Ahead  (Undocumented)
  6443.  
  6444.  
  6445.     AH = 64h
  6446.     AL = value for switch
  6447.          00   causes DOS to perform look ahead to the device driver
  6448.           before execution of ~INT 21,1~, ~INT 21,8~ and ~INT 21,A~
  6449.          other - no look ahead is performed
  6450.  
  6451.  
  6452.     returns ???
  6453.  
  6454.  
  6455.     - DOS internal; should not be called by user program
  6456.     - switch defaults to zero
  6457.     - undocumented; since DOS 3.3
  6458.     - some other subfunctions are know to have existed since DOS 3.2 but
  6459.       details on their functionality are incomplete
  6460. :int 21,65
  6461. ^INT 21,65 - Get Extended Country Information (DOS 3.3+)
  6462.  
  6463.     AH = 65h
  6464.     AL = 01  get extended country information
  6465.        = 02  get pointer to character translation table
  6466.        = 04  get pointer to filename character translation table
  6467.        = 05  get pointer to filename terminator table
  6468.        = 06  get pointer to collating sequence
  6469.        = 07  get segment of DCBS vector (DOS 4.x)
  6470.        = 20  country dependant character capitalization (DOS 4+)
  6471.        = 21  country dependant string capitalization (DOS 4+)
  6472.        = 22  country dependant ASCIIZ string capitalization (DOS 4+)
  6473.        = 23  determine if character represents country relative
  6474.          Yes or No response (DOS 4+)
  6475.        = A0  country dependant filename character capitalization (DOS 4+)
  6476.        = A1  country dependant filename string capitalization (DOS 4+)
  6477.        = A2  country dependant ASCIIZ filename capitalization (DOS 4+)
  6478.     BX = code page (-1 = current global code page, AL < 20h)
  6479.     CX = amount of data to return
  6480.        = length of string (AL=21h, A1h)
  6481.     DX = country ID (-1 = current country, AL < 20h)
  6482.     DL = character to capitalize or test (AL=20h, 23h, A0h)
  6483.     DH = second character if double byte character (AL=23h)
  6484.     ES:DI = pointer to output buffer (AL < 20h, see tables below)
  6485.     DS:DX = pointer to string to capitalize (AL=21h, 22h, A1h, A2h)
  6486.  
  6487.  
  6488.     on return
  6489.     AX = error code if CF is set  (see ~DOS ERROR CODES~)
  6490.        = 00  NO response if (AL was 23h)
  6491.        = 01  YES response if (AL was 23h)
  6492.        = 02  not a yes or no response (AL was 23h)
  6493.     CX = amount of data returned
  6494.     DL = capitalize character (AL=20)
  6495.     ES:DI pointer to returned table of the forms:
  6496.  
  6497.  
  6498. %    Offset Size    Table for Function 01
  6499.  
  6500.       00   byte   country id = 01
  6501.       01   word   size (38 or less)
  6502.       03   word   country id
  6503.       05   word   code Page
  6504.       07   word   date Format
  6505.       09  5bytes  currency symbol string (ASCIIZ)
  6506.       0E  2bytes  thousands separator string (ASCIIZ)
  6507.       10  2bytes  decimal separator string (ASCIIZ)
  6508.       12  2bytes  date separator string (ASCIIZ)
  6509.       14  2bytes  time Separator string (ASCIIZ)
  6510.       16   byte   currency symbol location
  6511.       17   byte   currency decimal places
  6512.       18   byte   time format
  6513.       19   dword  extended ASCII map call address
  6514.       1D  2bytes  list separator string (ASCIIZ)
  6515.       1F  10bytes reserved
  6516.  
  6517.  
  6518. %    Offset Size    Table for Function 2
  6519.       00   byte   country Id = 02
  6520.       01   dword  pointer to uppercase table
  6521.  
  6522.  
  6523. %    Offset Size    Table for Function 4
  6524.       00   byte   country Id = 04
  6525.       01   dword  pointer to filename character translation table
  6526.  
  6527.  
  6528. %    Offset Size    Table for Function 5
  6529.       00   byte   country Id = 05
  6530.       01   dword  pointer to filename uppercase table
  6531.  
  6532.  
  6533. %    File Terminator Table for Function 5
  6534.       00   word   table size
  6535.       02  7bytes  unknown
  6536.       09   byte   length of following data
  6537.       0A  nbytes  list of filename termination characters, ex:
  6538.               < > . " / \ [ ] : | + = ; ,
  6539.  
  6540. %    Offset Size    Table for Function 6
  6541.       00   byte   country Id = 06
  6542.       01   dword  pointer to collating table
  6543.  
  6544.  
  6545. %    Offset Size    Table for Function 7
  6546.       00   byte   country Id = 07
  6547.       01   dword  pointer to byte pair table
  6548.  
  6549.  
  6550.     - functions A0, A1, A2 are implemented in DOS 4.x but don't work
  6551. :int 21,66
  6552. ^INT 21,66 - Get/Set Global Code Page  (DOS 3.3+)
  6553.  
  6554.  
  6555.     AH = 66h
  6556.     AL = 01  get global code page
  6557.        = 02  set global code page
  6558.     BX = active code page if setting
  6559.     DX = system code page if setting
  6560.  
  6561.  
  6562.     on return
  6563.     AX = error code if CF set  (see ~DOS ERROR CODES~)
  6564.     BX = active code page  (for AL=1 only)
  6565.     DX = system code page  (for AL=1 only)
  6566.  
  6567.  
  6568.     - moves country data from COUNTRY.SYS to country memory table
  6569.  
  6570. :int 21,67
  6571. ^INT 21,67 - Set Handle Count  (DOS 3.3+)
  6572.  
  6573.     AH = 67h
  6574.     BX = new maximum open handles allowed
  6575.  
  6576.     on return
  6577.     CF = 0 if successful
  6578.        = 1 if error
  6579.     AX = error code if CF is set  (see ~DOS ERROR CODES~)
  6580.  
  6581.  
  6582.     - gives program control of the number of files simultaneously open
  6583.     - if CX is less than the current number of open files the change
  6584.       will take effect when the number of open handles falls below
  6585.       the new limit
  6586.     - this function allows the application to use more than 20 files,
  6587.       up to the FILES=N limit
  6588.     - earlier copies of IBM DOS 3.3 sometimes incorrectly allocates
  6589.       memory (up to 64K) if an even number of handles is requested
  6590.     - only the first 20 files handles are copied to a child process
  6591.       regardless of the max number of files
  6592.     - it is possible to allocate more than 255 file handles but it is
  6593.       difficult to use more than 255
  6594.  
  6595.     - see  ~SFT~   ~FILE HANDLES~
  6596. :int 21,68
  6597. ^INT 21,68 - Flush Buffer Using Handle    (DOS 3.3+)
  6598.  
  6599.  
  6600.     AH = 68h
  6601.     BX = file handle
  6602.  
  6603.  
  6604.     on return
  6605.     AX = error code if CF set  (see ~DOS ERROR CODES~)
  6606.  
  6607.  
  6608.     - flushes DOS buffers to disk, does not update directory entry
  6609.  
  6610. :int 21,69
  6611. ^INT 21,69 - Get/Set Disk Serial Number  (Undocumented DOS 4+)
  6612.  
  6613.     AH = 69h
  6614.     AL = 00 get serial number
  6615.        = 01 set serial number
  6616.     BL = drive (0 = default, 1=A:, 2 = B:, ... )
  6617.     DS:DX = buffer to contain extended BIOS Parameter Block (~BPB~, AL=0)
  6618.           = disk information to set of the form:
  6619.  
  6620. %      Offset  Size        Description
  6621.         00      word      info level (zero)
  6622.         02      dword   disk serial number (binary)
  6623.         06    11bytes   volume label or "NO NAME    " if not present
  6624.         11     8bytes   filesystem type string "FAT12   " or "FAT16    "
  6625.  
  6626.     returns:
  6627.     CF = set on error
  6628.        AX = error code if CF set
  6629.           = 01  network drive not supported
  6630.           = 05  no extended BPB found on disk
  6631.     CF = clear if successful and value in AX is destroyed
  6632.        AL = 00  buffer filled from Extended BPB on disk
  6633.           = 01  disk Extended BPB updated from buffer
  6634.     DS:DX = pointer to returned data, when AL = 0
  6635.  
  6636.  
  6637.     - copies data from Extended BIOS Parameter Block to buffer
  6638.     - no critical error is generated on error
  6639.     - does not work on network drives (returns 01)
  6640.     - returned buffer (after offset 2) is similar to offsets 27 through
  6641.       3D of the Extended BPB found in the boot record
  6642.  
  6643.     - see  ~INT 21,59~
  6644. :int 21,6c
  6645. ^INT 21,6C - Extended Open/Create  (DOS 4.x+)
  6646.  
  6647.     AH = 6C
  6648.     AL = 00
  6649.     BX = open mode (see below)
  6650.     CX = file attribute (see ~FILE ATTRIBUTES~, bits 15-8 are zero)
  6651.     DX = function control indicator (see below)
  6652.     DS:SI = ASCIIZ filespec
  6653.  
  6654.  
  6655.     returns:
  6656.     AX = handle if CF clear
  6657.        = error code if CF set  (see ~DOS ERROR CODES~)
  6658.     CX = 01  file opened
  6659.        = 02  file created and opened
  6660.        = 03  file truncated and opened (replaced)
  6661.     CF = 0 if successful
  6662.        = 1 if error
  6663.  
  6664.  
  6665. %    Open Mode in BX:
  6666.  
  6667.     │F│E│D│C│B│A│9│8│7│6│5│4│3│2│1│0│  BX  (Open Mode)
  6668.      │ │ │ │ │ │ │ │ │ │ │ │ │ └─┴─┴──── read/write access mode
  6669.      │ │ │ │ │ │ │ │ │ │ │ │ └──────── reserve (must be 0)
  6670.      │ │ │ │ │ │ │ │ │ └─┴─┴──────── sharing mode
  6671.      │ │ │ │ │ │ │ │ └──────────── 1 = private, 0 = inheritable
  6672.      │ │ │ └─┴─┴─┴─┴──────────── reserved
  6673.      │ │ └──────────────────── 0 = call INT 24, 1 = ignore INT 24
  6674.      │ └──────────────────── 0 = normal write, 1 = flush each write
  6675.      └──────────────────── reserved
  6676.  
  6677. %    Read/Write Access bits:     Sharing Mode bits:
  6678. %    210                  654
  6679.     000  read access          000  compatibility mode
  6680.     001  write access          001  read/write access
  6681.     010  read/write access          010  write access denied
  6682.                       011  read access denied
  6683.                       100  full access
  6684.  
  6685. %    Function Control Indicator in DX:
  6686.  
  6687.     │F│E│D│C│B│A│9│8│7│6│5│4│3│2│1│0│  DX  (Function Control)
  6688.      │ │ │ │ │ │ │ │ │ │ │ │ └─┴─┴─┴──── file existence behavior
  6689.      │ │ │ │ │ │ │ │ └─┴─┴─┴─────────── creation behavior
  6690.      └─┴─┴─┴─┴─┴─┴─┴────────────────── reserved
  6691.  
  6692. %    File Existence Behavior bits:
  6693. %    3210
  6694.     0000  if file exist, generate error, take no action
  6695.     0001  if file exists, open file
  6696.     0010  if file exists, truncate and open
  6697.  
  6698.  
  6699. %    Creation Behavior bits:
  6700. %    7654
  6701.     0000  if file does not exist, generate error, take no action
  6702.     0001  if file does not exist, create
  6703.  
  6704.  
  6705. :int 21,f8
  6706. ^INT 21,F8 - Set OEM Int 21 Handler (functions F9-FF, Undocumented)
  6707.  
  6708.  
  6709.     AH = F8
  6710.     DS:DX = pointer to OEM handler for INT 21H calls F9 through FF
  6711.           = FFFF:FFFF to reset to original handlers
  6712.  
  6713.  
  6714.     - DOS is set up to allow ONE handler for all 7 function calls.
  6715.       Any call to these handlers will set the CF and AX
  6716.       will contain 1 if they are not initialized.    The handling
  6717.       routine is passed all registers just as the user set them.
  6718.       The handler should exit with an ~IRET~.
  6719. :int 22
  6720. ^INT 22 - Program Terminate
  6721.  
  6722.  
  6723.     no input data
  6724.  
  6725.  
  6726.     - not an interrupt, but a vector to the terminate address
  6727.     - copied to ~PSP~ offset 0Ah during program load
  6728.     - do not execute this interrupt directly
  6729. :int 23:ctrl-c
  6730. ^INT 23 - Control-Break Exit Address
  6731.  
  6732.     no input data
  6733.  
  6734.     - not an interrupt but a pointer to a routine that is called when a
  6735.       DOS function detects a ~Ctrl-Break~ or Ctrl-C has been pressed
  6736.       resulting in a "Break condition"
  6737.     - a Break condition is detected if DOS's internal Break flag is
  6738.       found set by ~INT 1B~ or the next word in the BIOS keyboard buffer
  6739.       is a scan code representing one of the Break key combinations.
  6740.       If a matching scan code is found, the keyboard buffer head pointer
  6741.       is incremented by 2 (which effectively removes the ^C keycode), the
  6742.       ^C is printed and then INT 23 is called.
  6743.     - disabling the abort is easy, but to disable the ^C from appearing
  6744.       you must either not use any of the DOS I/O functions that check
  6745.       for Break or you must trap the Ctrl-C keypress from within INT 9.
  6746.       Another method is to scan the BIOS keyboard buffer and delete any
  6747.       Break key combinations.
  6748.     - Ctrl-Break empties the keyboard buffer by resetting the keyboard
  6749.       head and tail pointers then places a 0000h at the queue head.  It
  6750.       then sets an internal "Break" flag.  DOS subfunctions that check
  6751.       for Break see this and then issue INT 23h.  DOS does not detect
  6752.       INT 1B using the keyboard buffer, but uses its own internal flag.
  6753.     - Alt-Keypad-3 and Ctrl-2 also result in this interrupt
  6754.     - Ctrl-C places 2E03h in the BIOS keyboard buffer while Ctrl-2
  6755.       places 0300h and Alt-Keypad-3 places 0003h;  none of these key
  6756.       combinations empty the keyboard like Ctrl-Break but all result
  6757.       in a ^C being displayed;  note that all three produce scan codes
  6758.       containing '03'
  6759.     - since DOS checks only the first word of the keyboard buffer
  6760.       Ctrl-C, Ctrl-2 and Alt-Keypad-3 are only detected if they are the
  6761.       first word in the buffer while Ctrl-Break is detected via the
  6762.       internal flag and takes effect as soon as it's detected.
  6763.     - do not execute this interrupt directly
  6764.     - see also   ~INT 9~
  6765. :int 24:critical error handler
  6766. ^INT 24 - Critical Error Handler
  6767.  
  6768.     no input data
  6769.  
  6770.     on entry to INT 24:
  6771.     AH = bit 7 of register AH is set to one if other than disk error
  6772.        = bit 7 of register AH is set to zero if disk error
  6773.          AL = failing drive number
  6774.          AH = bits 0-2 indicate affected disk area and read/write status
  6775.  
  6776.           │5│4│3│2│1│0│  AH
  6777.            │ │ │ │ │ └──── read = 0, write = 1
  6778.            │ │ │ └─┴───── 00=DOS, 01=FAT, 10=DIR, 11=data area
  6779.            │ │ └──────── 0=FAIL not allowed, 1=FAIL allowed
  6780.            │ └───────── 0=RETRY not allowed, 1=RETRY allowed
  6781.            └────────── 0=IGNORE not allowed, 1=IGNORE allowed
  6782.  
  6783.     DI = error code in lower byte
  6784.     BP:SI = pointer to device header control block where additional
  6785.         information about the error can be found
  6786.  
  6787.  
  6788.     on exit:
  6789.     AL = action code determining exit behavior
  6790.        = 00  ignore error
  6791.        = 01  retry
  6792.        = 02  terminate through ~INT 23~
  6793.        = 03  fail system call (DOS 3.x+)
  6794.  
  6795.  
  6796. %    Error Codes in low order byte of DI:
  6797.  
  6798.       00  write protect error
  6799.       01  unknown unit
  6800.       02  drive not ready
  6801.       03  unknown command
  6802.       04  data error (bad CRC)
  6803.       05  bad request structure length
  6804.       06  seek error
  6805.       07  unknown media type
  6806.       08  sector not found
  6807.       09  printer out of paper
  6808.       0A  write fault
  6809.       0B  read fault
  6810.       0C  general failure
  6811.  
  6812. %    Users Stack at Entry to Error Handler:
  6813.  
  6814.     (top of stack)
  6815.         IP           DOS code next instruction pointer
  6816.         CS
  6817.         FLAGS      DOS's flags
  6818.         AX -\
  6819.         BX     \
  6820.         CX      \
  6821.         DX       \
  6822.         SI        |- User's registers at entry to INT 21 function
  6823.         DI       /
  6824.         BP      /
  6825.         DS     /
  6826.         ES -/
  6827.         IP           User code next instruction pointer
  6828.         CS
  6829.         FLAGS
  6830.  
  6831.     - on entry registers are setup for a retry operation
  6832.     - user routine must issue an IRET or simulate an IRET
  6833.     - ~INT 21,0~ through ~INT 21,C~ and ~INT 21,59~ can safely be invoked
  6834.       from the handler.  Other calls may destroy DOS's stack
  6835.     - handler must preserve register SS,SP,DS,ES,BX,CX,DX
  6836.     - choosing ignore can show side effects, since it causes DOS
  6837.       to continue as if it the call were successful
  6838.     - if an improper action code is specified in DOS 3.x it is changed:
  6839.       if IGNORE is invalidly specified, action is converted to FAIL
  6840.       if RETRY is invalidly specified, action is converted to FAIL
  6841.       if FAIL is invalidly specified, action is converted to ABORT
  6842.     - IGNORE requests are converted to FAIL for ~FAT~ and ~DIR~ disk
  6843.       errors and network critical errors
  6844.     - if the user routine wishes to handle the error instead of passing
  6845.       it to DOS, it must restore the user program registers from the
  6846.       stack and remove all but the last 3 words from the stack (FLAGS,
  6847.       CS, IP) and issue an ~IRET~
  6848.     - do not execute this interrupt directly
  6849.     - ~INDOS~ flag is cleared on INT 24 (see ~INT 21,34~)
  6850. :int 25
  6851. ^INT 25 - Absolute Disk Read
  6852.  
  6853.     AL = logical drive number (0=A:, 1=B:, 2=C:, ...)
  6854.     CX = number of sectors to read
  6855.        = -1 if DOS 4.x (control block pointer is in DS:BX)
  6856.     DX = starting logical sector number (see below for DOS 4.x+)
  6857.     DS:BX = pointer to data buffer
  6858.           = pointer to control block (DOS 4.x+, see below)
  6859.  
  6860.     on return:
  6861.     AH = error code if CF set:
  6862.          01  bad command
  6863.          02  bad address mark
  6864.          03  write protect
  6865.          04  sector not found
  6866.          08  DMA failure
  6867.          10  data error (bad CRC)
  6868.          20  controller failed
  6869.          40  seek failed
  6870.          80  attachment failed to respond
  6871.     AL = BIOS error code if CF set
  6872.          00  write protect error
  6873.          01  unknown unit
  6874.          02  drive not ready
  6875.          03  unknown command
  6876.          04  data error (bad CRC)
  6877.          05  bad request structure length
  6878.          06  seek error
  6879.          07  unknown media type
  6880.          08  sector not found
  6881.          0A  write fault
  6882.          0B  read fault
  6883.          0C  general failure
  6884.  
  6885. ^Control Block Format (DOS 4.x):
  6886.  
  6887. %    Offset Size       Description
  6888.  
  6889.       00   dword  starting sector
  6890.       04   word   number of sectors to read
  6891.       06   dword  pointer to buffer
  6892.  
  6893.  
  6894.     - reads disk sectors into buffer at DS:BX or DS:[BX+6]
  6895.     - after calling this interrupt the flags register remains on the
  6896.       stack and must be popped manually
  6897.     - sectors are logical sectors starting at the beginning of a
  6898.       logical disk; each DOS partition on a drive unit is considered
  6899.       one logical drive and has its own logical sector numbers with
  6900.       track 0 starting at the first track in the partition
  6901.     - this function uses logical drives, and is susceptible to ASSIGN
  6902.     - physical sector numbers can be converted to and from DOS sector
  6903.       numbers with the following formulas:
  6904.  
  6905.       dos_sector = (sector - 1) + (head * sectors_per_track) +
  6906.                (track * sectors_per_track * num_heads)
  6907.  
  6908.       physical_sector = 1 + (dos_sector  MOD  sectors_per_track)
  6909.       physical_head = (dos_sector / sectors_per_track)  MOD  num_heads
  6910.       physical_track = dos_sector / (sectors_per_track * num_heads)
  6911.  
  6912.     - see    ~INT 13,STATUS~
  6913. :int 26
  6914. ^INT 26 - Absolute Disk Write
  6915.  
  6916.     AL = logical drive number (0=A:, 1=B:, 2=C:, ...)
  6917.     CX = number of sectors to write
  6918.        = -1 if DOS 4.x (control block pointer is in DS:BX)
  6919.     DX = starting logical sector number (see below for DOS 4.x+)
  6920.     DS:BX = pointer to data buffer
  6921.           = pointer to control block (DOS 4.x+, see below)
  6922.  
  6923.     on return:
  6924.     AH = error code if CF set:
  6925.          01  bad command
  6926.          02  bad address mark
  6927.          03  write protect
  6928.          04  sector not found
  6929.          08  DMA failure
  6930.          10  data error (bad CRC)
  6931.          20  controller failed
  6932.          40  seek failed
  6933.          80  attachment failed to respond
  6934.     AL = BIOS error code if CF set
  6935.          00  write protect error
  6936.          01  unknown unit
  6937.          02  drive not ready
  6938.          03  unknown command
  6939.          04  data error (bad CRC)
  6940.          05  bad request structure length
  6941.          06  seek error
  6942.          07  unknown media type
  6943.          08  sector not found
  6944.          0A  write fault
  6945.          0B  read fault
  6946.          0C  general failure
  6947.  
  6948. ^Control Block Format (DOS 4.x):
  6949.  
  6950. %    Offset Size     Description
  6951.  
  6952.       00   dword  starting sector
  6953.       04   word   number of sectors to write
  6954.       06   dword  pointer to buffer
  6955.  
  6956.  
  6957.     - writes disk sectors from buffer at DS:BX or DS:[BX+6]
  6958.     - after calling this interrupt the flags register remains on the
  6959.       stack and must be popped manually
  6960.     - sectors are logical sectors starting at the beginning of a
  6961.       logical disk; each DOS partition on a drive unit is considered
  6962.       one logical drive and has its own logical sector numbers with
  6963.       track 0 starting at the first track in the partition
  6964.     - this function uses logical drives, and is susceptible to ASSIGN
  6965.     - physical sector numbers can be converted to and from DOS sector
  6966.       numbers with the following formulas:
  6967.  
  6968.       dos_sector = (sector - 1) + (head * sectors_per_track) +
  6969.                (track * sectors_per_track * num_heads)
  6970.  
  6971.       physical_sector = 1 + (dos_sector  MOD  sectors_per_track)
  6972.       physical_head = (dos_sector / sectors_per_track)  MOD  num_heads
  6973.       physical_track = dos_sector / (sectors_per_track * num_heads)
  6974.  
  6975.     - see    ~INT 13,STATUS~
  6976. :int 27
  6977. ^INT 27 - Terminate and Stay Resident
  6978.  
  6979.  
  6980.     DX = offset of last byte in program to remain resident plus 1
  6981.     CS = segment of ~PSP~
  6982.  
  6983.  
  6984.     returns nothing
  6985.  
  6986.  
  6987.     - terminates process without closing open files
  6988.     - memory beyond the offset in DX is freed
  6989.  
  6990.  
  6991.     - see    ~INT 21,31~
  6992.  
  6993. :int 28:DOS scheduler
  6994. ^INT 28 - DOS Idle Loop / Scheduler  (Undocumented)
  6995.  
  6996.  
  6997.  
  6998.  
  6999.     - issued by DOS during keyboard poll loop
  7000.     - indicates DOS may be carefully re-entered by TSR
  7001.     - used by TSR programs to popup and make DOS disk I/O calls
  7002.     - supported by OS/2 compatibility box
  7003.     - default behavior is to simply perform an ~IRET~
  7004.     - any DOS functions above 0Ch may be called while in this handler
  7005.     - ~INT 21,3F~ and ~INT 21,40~ may not use a handle that refers to
  7006.       CON while in this handler
  7007.     - see also  ~INDOS~
  7008. :int 29
  7009. ^INT 29 - DOS Fast Character I/O  (Undocumented 2.x+)
  7010.  
  7011.  
  7012.     AL = character to write
  7013.  
  7014.  
  7015.     returns nothing ???
  7016.  
  7017.  
  7018.     - used by DOS device drivers to output data to the screen if
  7019.       bit 4 of the device attribute word is set
  7020.     - similar to ~INT 21,2~ and ~INT 21,9~ but much faster
  7021.     - simply calls the BIOS ~INT 10,E~ in DOS versions 2.x and 3.x
  7022.     - advances the cursor after character output
  7023. :int 2a
  7024. ^INT 2A - DOS Network Critical Section and NETBIOS
  7025.  
  7026. %    For more information see the following topics:
  7027.  
  7028.      ~INT 2A,0~  Network installation query
  7029.      ~INT 2A,1~  Execute NETBIOS request with no error retry
  7030.      INT 2A,2  Set network printer mode (not listed)
  7031.      ~INT 2A,3~  Check if direct I/O allowed
  7032.      ~INT 2A,4~  Execute NETBIOS request
  7033.      ~INT 2A,5~  Get network resource information
  7034.      ~INT 2A,6~  Network print stream control
  7035.     ~INT 2A,80~  Begin DOS critical section
  7036.     ~INT 2A,81~  End DOS critical section
  7037.     ~INT 2A,82~  End DOS critical sections 0 through 7
  7038.     ~INT 2A,84~  Keyboard busy loop
  7039.     ~INT 2A,87~  Critical section
  7040.  
  7041.     - functions requests are supplied in AH
  7042. :int 2a,0
  7043. ^INT 2A,0 - Network Installation Query
  7044.  
  7045.  
  7046.     AH = 00
  7047.     
  7048.  
  7049.     on return:
  7050.     AH = zero if not installed
  7051.        = nonzero if installed
  7052.  
  7053.  
  7054.     - used to detemine if a Microsoft compatible network is present
  7055. :int 2a,1
  7056. ^INT 2A,1 - Execute NETBIOS Request With No Error Retry
  7057.  
  7058.  
  7059.     AH = 01
  7060.     ES:BX = pointer to Network Control Block
  7061.     
  7062.  
  7063.     on return:
  7064.     AL = NETBIOS error code
  7065.     AH = zero if success
  7066.        = nonzero if error
  7067.  
  7068.  
  7069.     - similar to INT 5C
  7070. :int 2a,3
  7071. ^INT 2A,3 - Check if Direct I/O Allowed
  7072.  
  7073.  
  7074.     AH = 03
  7075.     DS:SI = pointer to ASCIIZ disk device name or pathname (including ":")
  7076.     
  7077.     
  7078.     on return:
  7079.     CF = set if disk access is NOT allowed
  7080.        = clear if disk access is allowed
  7081.  
  7082.  
  7083.     - do not use ~INT 13~, ~INT 25~ or ~INT 26~ if this function returns
  7084.       with the CF set
  7085.     - see  ~INT 5F,2~
  7086. :int 2a,4
  7087. ^INT 2A,4 - Execute NETBIOS Request
  7088.  
  7089.  
  7090.     AH = 04
  7091.     AL = 00  allow retry
  7092.        = 01  no retry allowed
  7093.     ES:BX = pointer to Network Control Block (NCB)
  7094.     
  7095.     
  7096.     on return:
  7097.     AX = 00 if successful
  7098.     AH = 01 if error
  7099.     AL = error code if AH = 01
  7100.  
  7101.  
  7102.     - invokes NETBIOS handler and allows retry of operation if specified
  7103. :int 2a,5
  7104. ^INT 2A,5 - Get Network Resource Information
  7105.  
  7106.  
  7107.     AX = 0500
  7108.     
  7109.     
  7110.     on return:
  7111.     AX = destroyed
  7112.     BX = number of available network names
  7113.     CX = number of available NCB commands
  7114.     DX = number of available sessions
  7115.  
  7116.  
  7117.     - returns information on the number of available network resources
  7118. :int 2a,6
  7119. ^INT 2A,6 - Network Print Stream Control
  7120.  
  7121.  
  7122.     AH = 06
  7123.     AL = 01 set concatenation mode where all printer output is placed
  7124.         in one job
  7125.        = 02 set truncation mode where each printer open and printer
  7126.         close starts a new job
  7127.        = 03 flush printer output then start a new print job (similar to
  7128.         pressing Ctrl-Alt-Kp-* )
  7129.     
  7130.     
  7131.     on return:
  7132.     AX = error code if CF set
  7133.  
  7134.  
  7135.     - allows control of network printers
  7136. :int 2a,80
  7137. ^INT 2A,80 - Begin DOS Critical Section
  7138.  
  7139.     AH = 80h
  7140.     AL = critical section identifier (00-0F)
  7141.        = 01  DOS kernel, SHARE.EXE and network data structure integrity
  7142.        = 02  DOS kernel, device driver exclusivity
  7143.        = 05  IFSFUNC (Installable File System, IFS, DOS 4.0+)
  7144.        = 06  IFSFUNC (Installable File System, IFS, DOS 4.0+)
  7145.        = 08  ASSIGN.COM
  7146.     
  7147.     returns nothing
  7148.  
  7149.  
  7150.     - indicates that the region of code being entered should not be
  7151.       interrupted and identifies the critical region
  7152.     - this function is not normally called by user applications but is
  7153.       often hooked to monitor if DOS is in a critical section
  7154.     - this information is necessary to reenter DOS using the swappable
  7155.       data area returned by ~INT 21,5D~ subfunction 0B
  7156.     - see  ~Bibliography~ reference to "Undocumented DOS"
  7157. :int 2a,81
  7158. ^INT 2A,81 - End DOS Critical Section
  7159.  
  7160.     AH = 81h
  7161.     AL = critical section identifier (00-0F)
  7162.        = 01  DOS kernel, SHARE.EXE and network data structure integrity
  7163.        = 02  DOS kernel, device driver exclusivity
  7164.        = 05  IFSFUNC (Installable File System, IFS, DOS 4.0+)
  7165.        = 06  IFSFUNC (Installable File System, IFS, DOS 4.0+)
  7166.        = 08  ASSIGN.COM
  7167.  
  7168.  
  7169.     returns nothing
  7170.  
  7171.  
  7172.     - indicates that a critical code section is being exited
  7173.     - this function is usually hooked rather then called directly from a
  7174.       user application
  7175.     - see  ~Bibliography" reference to "Undocumented DOS"
  7176. :int 2a,82
  7177. ^INT 2A,82 - End DOS Critical Sections 0 thru 7
  7178.  
  7179.  
  7180.     AH = 82h
  7181.  
  7182.  
  7183.     returns nothing
  7184.  
  7185.  
  7186.     - the DOS function dispatcher calls this function during DOS
  7187.       function 00, functions above 0C (excluding function 59h) and
  7188.       during process termination
  7189.     - this function is usually hooked rather then called directly from
  7190.       a user application
  7191.     - see  ~Bibliography~ reference to "Undocumented DOS"
  7192. :int 2a,84
  7193. ^INT 2A,84 - Keyboard Busy Loop
  7194.  
  7195.  
  7196.     AH = 84h
  7197.  
  7198.  
  7199.     returns nothing
  7200.  
  7201.  
  7202.     - allows other processes to continue while waiting for keyboard
  7203.       input, similar to ~INT 28~
  7204.     - see  BIBLIO reference to "Undocumented DOS"
  7205. :int 2a,87
  7206. ^INT 2A,87 - Critical Section
  7207.  
  7208.  
  7209.     AH = 87h
  7210.     AL = 00  start critical section
  7211.        = 01  end critical section
  7212.  
  7213.  
  7214.     returns nothing
  7215.  
  7216.  
  7217.     - specifies the start or end of a critical section
  7218.     - called by PRINT.COM
  7219.     - see  ~Bibliography~ reference to "Undocumented DOS"
  7220. :int 2e
  7221. ^INT 2E - Execute Command Using Base Level Command Interpreter
  7222. ^(Undocumented DOS 2.0+)
  7223.  
  7224.     DS:SI = pointer to command string to be executed
  7225.  
  7226.     returns nothing ???
  7227.  
  7228.     - causes the base level COMMAND.COM to execute a command as if it
  7229.       were typed from the keyboard
  7230.     - the transient portion of COMMAND.COM must be loaded if not resident
  7231.     - first byte of the string contains the string length, inclusive
  7232.     - command string must be terminated with a CR
  7233.     - all registers including SS & SP are destroyed;  SS & SP should be
  7234.       preserved in your own code segment
  7235.     - can be used to modify parents environment with SET command
  7236.     - incompatible under some software multitasking systems
  7237.     - before returning to the parent program this interrupt will
  7238.       attempt to execute the "current" batch file (if the parent or
  7239.       any ancestors were invoked from a batch file.   This can cause
  7240.       remaining lines in a batch file to execute before the parent
  7241.       program finishes and fragment memory
  7242. :int 2f:multiplex interrupt
  7243. ^INT 2F - DOS Multiplex Interrupt
  7244.  
  7245. %    For more information see the following topics:
  7246.  
  7247.                          ┌────── ERROR CODES ────
  7248.     ~INT 2F,0~  Get installed state         │ 01    Invalid function
  7249.     ~INT 2F,1~  Submit file             │ 02    File not found
  7250.     ~INT 2F,2~  Cancel file             │ 03    Path not found
  7251.     ~INT 2F,3~  Cancel all files         │ 04    Too many files
  7252.     ~INT 2F,4~  Pause / return status      │ 05    Access denied
  7253.     ~INT 2F,5~  End of status           │ 08    Queue full
  7254.     ~INT 2F,8~  DRIVER.SYS support         │ 09    Busy
  7255.     ~INT 2F,2E~ Error Translation Tables   │ 0C    Name too long
  7256.                          │ 0F    Invalid drive
  7257.  
  7258.      - function request is specified in AL or AH
  7259.     - see  ~INT 2F,0~  for installation checks
  7260.     - INT 2F uses AL to specify most documented functions but occasionally
  7261.       uses AH also.  This can be quite confusing so INT 2F functions using
  7262.       AH are not currently listed if the conflict but will be added at a
  7263.       later time.
  7264. :int 2f,0
  7265. ^INT 2F,0 - DOS Multiplex Interrupt - Get Installed State
  7266.  
  7267.     AL = 00
  7268.     AH = 00  DOS 2.x PRINT.COM (undocumented, see note below)
  7269.          01  PRINT    (undocumented behavior also, see note below)
  7270.          05  Critical error handler (undocumented DOS 3.0+)
  7271.          06  ASSIGN  (see note)
  7272.          08  DRIVER.SYS (undocumented DOS 3.2+)
  7273.          10  SHARE
  7274.          11  Redirector/IFS is resident
  7275.          12  MultiDOS is resident
  7276.          13  Swap 13h and 19h
  7277.          14  NLSFUNC
  7278.          15  GRAPHICS.COM (see note below)
  7279.          MS CD-ROM extension (MSCDEX) (see note below)
  7280.          16  Windows 386
  7281.          17  DOS shell
  7282.          19  SHELLB.COM (DOS 4.0 only)
  7283.          1A  ANSI.SYS (DOS 4.0+)
  7284.          1B  XMA2EMS.SYS
  7285.          40  OS/2 compatibility box
  7286.          43  Himem XMS driver
  7287.          7A  Novell Netware IPX
  7288.          AD  DISPLAY.SYS internal (DOS 3.3+)
  7289.          AE  DOS installable command extension (DOS 3.3+)
  7290.          B0  GRAFTABL.COM (DOS 3.3+)
  7291.          B4  IBM 3270 emulation
  7292.          B7  APPEND  (DOS 3.3+)
  7293.          B8  LAN existence
  7294.          B9  LAN RECEIVER.COM
  7295.          BF  LAN REDIRIFS.EXE
  7296.          C0-FF reserved for user applications
  7297.  
  7298.  
  7299.     on return:
  7300.     AL = 00  not installed, ok to install
  7301.        = 01  not installed, do NOT install
  7302.        = FF  installed
  7303.  
  7304.  
  7305.     - the installed test for append returns non-zero if installed;
  7306.       zero if not installed
  7307.     - AH = 00 and 01 are used by DOS 2.x PRINT.COM and is not a check
  7308.       for installed state, see BIBLIO reference to "Undocumented DOS"
  7309.     - ASSIGN returns non-zero if installed
  7310.     - installation checks with AH=15 do not follow the standard format;
  7311.     - see  ~Bibliography~ reference to "Undocumented DOS"
  7312. :int 2f,1:DOS multiplex
  7313. ^INT 2F,1 - Multiplex Interrupt - Submit file
  7314.  
  7315.  
  7316.     AL = 01
  7317.     AH = 01  resident portion of PRINT
  7318.          02  resident portion of ASSIGN
  7319.          06  get pointer to ASSIGN drive translation table (undoc DOS 3+)
  7320.          10  resident portion of SHARE
  7321.          B7  resident portion of APPEND
  7322.          C0-FF reserved for user applications
  7323.     DS:DX = pointer to a 5 byte packet containing an priority byte
  7324.         and a DWORD pointer to an ASCIIZ filename
  7325.     DS:DI
  7326.     
  7327.     on return:
  7328.     ES = segment of ASSIGN work area and assignment table (AH=6 only)
  7329.  
  7330. :int 2f,2
  7331. ^INT 2F,2 - Multiplex Interrupt - Cancel file
  7332.  
  7333.  
  7334.     AL = 02
  7335.     AH = 01  resident portion of PRINT
  7336.          02  resident portion of ASSIGN
  7337.          10  resident portion of SHARE
  7338.          B7  resident portion of APPEND
  7339.          C0-FF reserved for user applications
  7340.     DS:DX = pointer to ASCIIZ filename to cancel
  7341.  
  7342.  
  7343.     returns nothing
  7344.  
  7345.  
  7346.     - accepts wildcards
  7347.  
  7348. :int 2f,3
  7349. ^INT 2F,3 - Multiplex Interrupt - Cancel all files
  7350.  
  7351.  
  7352.     AL = 03
  7353.     AH = 01  resident portion of PRINT
  7354.          02  resident portion of ASSIGN
  7355.          10  resident portion of SHARE
  7356.          B7  resident portion of APPEND
  7357.          C0-FF reserved for user applications
  7358.  
  7359.  
  7360.     returns nothing
  7361.  
  7362. :int 2f,4
  7363. ^INT 2F,4 - Multiplex Interrupt - Pause / return status
  7364.  
  7365.  
  7366.     AL = 04
  7367.     AH = 01  resident portion of PRINT
  7368.          02  resident portion of ASSIGN
  7369.          10  resident portion of SHARE
  7370.          B7  resident portion of APPEND
  7371.          C0-FF reserved for user applications
  7372.  
  7373.  
  7374.     on return:
  7375.     DX = error count
  7376.     DS:SI = pointer to queue of files
  7377.  
  7378.  
  7379.     - each file in the queue is represented by 64 byte filename
  7380.     - the file currently being printed is the first entry in the queue
  7381.     - the last entry in the queue is a null string
  7382.  
  7383. :int 2f,5
  7384. ^INT 2F,5 - Multiplex Interrupt - End of Status
  7385.  
  7386.  
  7387.     AL = 05
  7388.     AH = 01  resident portion of PRINT
  7389.          02  resident portion of ASSIGN
  7390.          10  resident portion of SHARE
  7391.          B7  resident portion of APPEND
  7392.          C0-FF reserved for user applications
  7393.  
  7394.  
  7395.     on return:
  7396.     AH = error code  (see ~INT 2F~)
  7397.  
  7398. :int 2f,6
  7399. ^INT 2F,6 - PRINT.COM Check for Error on Output Device (Undocumented)
  7400.  
  7401.  
  7402.     AL = 06
  7403.     AH = 01
  7404.  
  7405.  
  7406.     on return:
  7407.     AX = error code if CF set
  7408.        = 00 on success
  7409.     DS:SI = device driver header if CF set
  7410.  
  7411.  
  7412.     - checks the output device for an error condition
  7413.     - undocumented, available since DOS 3.3+
  7414. :int 2f,8
  7415. ^INT 2F,8 - DRIVER.SYS Support    (Undocumented DOS 3.2+)
  7416.  
  7417.  
  7418.     AH = 08
  7419.     AL = 00  installation check
  7420.        = 01  add new block device
  7421.        = 02  execute device driver request
  7422.        = 03  get drive data table list (DOS 4.0+)
  7423.     DS:DI = pointer to drive data table  (AL=01)
  7424.     ES:BX = pointer to device driver request header (AL=02)
  7425.  
  7426.  
  7427.     on return:
  7428.     AL = 00  not installed, ok to install (AL=00)
  7429.        = 01  not installed, do NOT install (AL=00)
  7430.        = FF  installed (AL=00)
  7431.     ES:BX = updated device request header (AL=02)
  7432.  
  7433.     - function 01 scans DOS's drive data tables and appends the new
  7434.       data table to to the chain.  All tables referencing the same
  7435.       physical drive are updated
  7436.  
  7437. :int 2f,2e
  7438. ^INT 2F,2E - Setup Error Code Translation Tables  (undoc. DOS 4.x+)
  7439.  
  7440.  
  7441.     - discovered in DOS 4.x by Jim Kyle, this function provides more
  7442.       detailed information on the pending critical error.
  7443.  
  7444. :int 2f,80
  7445. ^INT 2F,80 - PRINT.COM Time Slice Allotment  (Undocumented DOS 3.1+)
  7446.  
  7447.     AL = 80h
  7448.     AH = 00
  7449.     
  7450.     
  7451.     returns nothing
  7452.  
  7453.  
  7454.     - DOS PRINT.COM is given a time slice
  7455. :int 33:mouse interrupt:mouse services
  7456. ^INT 33 - Mouse Function Calls
  7457.  
  7458. %    For more information see the following topics:
  7459.  
  7460.     ~INT 33,0~   Mouse Reset/Get Mouse Installed Flag
  7461.     ~INT 33,1~   Show Mouse Cursor
  7462.     ~INT 33,2~   Hide Mouse Cursor
  7463.     ~INT 33,3~   Get Mouse Position and Button Status
  7464.     ~INT 33,4~   Set Mouse Cursor Position
  7465.     ~INT 33,5~   Get Mouse Button Press Information
  7466.     ~INT 33,6~   Get Mouse Button Release Information
  7467.     ~INT 33,7~   Set Mouse Horizontal Min/Max Position
  7468.     ~INT 33,8~   Set Mouse Vertical Min/Max Position
  7469.     ~INT 33,9~   Set Mouse Graphics Cursor
  7470.     ~INT 33,A~   Set Mouse Text Cursor
  7471.     ~INT 33,B~   Read Mouse Motion Counters
  7472.     ~INT 33,C~   Set Mouse User Defined Subroutine and Input Mask
  7473.     ~INT 33,D~   Mouse Light Pen Emulation On
  7474.     ~INT 33,E~   Mouse Light Pen Emulation Off
  7475.     ~INT 33,F~   Set Mouse Mickey Pixel Ratio
  7476.     ~INT 33,10~  Mouse Conditional OFF
  7477.     ~INT 33,13~  Set Mouse Double Speed Threshold
  7478.     ~INT 33,14~  Swap interrupt subroutines
  7479.     ~INT 33,15~  Get mouse driver state and memory requirements
  7480.     ~INT 33,16~  Save mouse driver state
  7481.     ~INT 33,17~  Restore mouse driver state
  7482.     ~INT 33,18~  Set alternate subroutine call mask and address
  7483.     ~INT 33,19~  Get user alternate interrupt address
  7484.     ~INT 33,1A~  Set mouse sensitivity
  7485.     ~INT 33,1B~  Get mouse sensitivity
  7486.     ~INT 33,1C~  Set mouse interrupt rate (InPort only)
  7487.     ~INT 33,1D~  Set mouse CRT page
  7488.     ~INT 33,1E~  Get mouse CRT page
  7489.     ~INT 33,1F~  Disable mouse driver
  7490.     ~INT 33,20~  Enable mouse driver
  7491.     ~INT 33,21~  Reset mouse software
  7492.     ~INT 33,22~  Set language for messages
  7493.     ~INT 33,23~  Get language number
  7494.     ~INT 33,24~  Get driver version, mouse type & ~IRQ~ number
  7495.  
  7496.     - function is specified in AX
  7497.     - a mickey is 1/200 inches
  7498.     - for additional information see your vendor documentation
  7499.     - function number occupies all of AX rather than AH
  7500.  
  7501.  
  7502. ^Mouse functions can be broken down into the following classes:
  7503.  
  7504. %    Mouse Driver Control / Feedback Functions
  7505.     ~INT 33,0~   Mouse Reset/Get Mouse Installed Flag
  7506.     ~INT 33,15~  Get Mouse Driver State and Memory Requirements
  7507.     ~INT 33,16~  Save Mouse Driver State
  7508.     ~INT 33,17~  Restore Mouse Driver State
  7509.     ~INT 33,1C~  Set Mouse Interrupt Rate (InPort only)
  7510.     ~INT 33,1F~  Disable Mouse Driver
  7511.     ~INT 33,20~  Enable Mouse Driver
  7512.     ~INT 33,21~  Reset Mouse Software
  7513.     ~INT 33,24~  Get Driver Version, Mouse Type & IRQ Number
  7514.  
  7515. %    Mouse Cursor Control Functions
  7516.     ~INT 33,1~   Show Mouse Cursor
  7517.     ~INT 33,2~   Hide Mouse Cursor
  7518.     ~INT 33,4~   Set Mouse Cursor Position
  7519.     ~INT 33,7~   Set Mouse Horizontal Min/Max Position
  7520.     ~INT 33,8~   Set Mouse Vertical Min/Max Position
  7521.     ~INT 33,9~   Set Mouse Graphics Cursor
  7522.     ~INT 33,A~   Set Mouse Text Cursor
  7523.     ~INT 33,F~   Set Mouse Mickey Pixel Ratio
  7524.     ~INT 33,10~  Mouse Conditional OFF
  7525.     ~INT 33,13~  Set Mouse Double Speed Threshold
  7526.     ~INT 33,1A~  Set Mouse Sensitivity
  7527.     ~INT 33,1B~  Get Mouse Sensitivity
  7528.  
  7529. %    Mouse Button and Position Feedback Functions
  7530.     ~INT 33,3~   Get Mouse Position and Button Status
  7531.     ~INT 33,5~   Get Mouse Button Press Information
  7532.     ~INT 33,6~   Get Mouse Button Release Information
  7533.     ~INT 33,B~   Read Mouse Motion Counters
  7534.  
  7535. %    Video Control and Feedback Functions
  7536.     ~INT 33,1D~  Set Mouse CRT Page
  7537.     ~INT 33,1E~  Get Mouse CRT Page
  7538.  
  7539. %    Mouse Interrupt Setup Functions
  7540.     ~INT 33,C~   Set Mouse User Defined Subroutine and Input Mask
  7541.     ~INT 33,14~  Swap Interrupt Subroutines
  7542.  
  7543. %    Alternate Mouse Interrupt Setup Functions
  7544.     ~INT 33,18~  Set Alternate Subroutine Call Mask and Address
  7545.     ~INT 33,19~  Get User Alternate Interrupt Address
  7546.  
  7547. %    Light Pen Emulation Functions
  7548.     ~INT 33,D~   Mouse Light Pen Emulation On
  7549.     ~INT 33,E~   Mouse Light Pen Emulation Off
  7550.  
  7551. %    International Language Support Functions
  7552.     ~INT 33,22~  Set Language for Messages
  7553.     ~INT 33,23~  Get Language Number
  7554.  
  7555. :int 33,0
  7556. ^INT 33,0 - Mouse Reset/Get Mouse Installed Flag
  7557.  
  7558.     AX = 00
  7559.  
  7560.  
  7561.     on return:
  7562.     AX = 0000  mouse driver not installed
  7563.          FFFF  mouse driver installed
  7564.     BX = number of buttons
  7565.  
  7566.  
  7567.     - resets mouse to default driver values:
  7568.  
  7569.       .  mouse is positioned to screen center
  7570.       .  mouse cursor is reset and hidden
  7571.       .  no interrupts are enabled (mask = 0)
  7572.       .  double speed threshold set to 64 mickeys per second
  7573.       .  horizontal mickey to pixel ratio (8 to 8)
  7574.       .  vertical mickey to pixel ratio (16 to 8)
  7575.       .  max width and height are set to maximum for video mode
  7576. :int 33,1
  7577. ^INT 33,1 - Show Mouse Cursor
  7578.  
  7579.  
  7580.     AX = 01
  7581.  
  7582.  
  7583.     returns nothing
  7584.  
  7585.  
  7586.     - increments the cursor flag;  the cursor is displayed if flag
  7587.       is zero;  default flag value is -1
  7588.  
  7589. :int 33,2
  7590. ^INT 33,2 - Hide Mouse Cursor
  7591.  
  7592.  
  7593.     AX = 02
  7594.  
  7595.  
  7596.     returns nothing
  7597.  
  7598.  
  7599.     - decrements cursor flag; hides cursor if flag is not zero
  7600.  
  7601. :int 33,3
  7602. ^INT 33,3 - Get Mouse Position and Button Status
  7603.  
  7604.  
  7605.     AX = 03
  7606.  
  7607.  
  7608.     on return:
  7609.     CX = horizontal (X) position  (0..639)
  7610.     DX = vertical (Y) position  (0..199)
  7611.     BX = button status:
  7612.  
  7613.         │F-8│7│6│5│4│3│2│1│0│  Button Status
  7614.           │  │ │ │ │ │ │ │ └──── left button (1 = pressed)
  7615.           │  │ │ │ │ │ │ └───── right button (1 = pressed)
  7616.           └──┴─┴─┴─┴─┴─┴────── unused
  7617.  
  7618.  
  7619.     - values returned in CX, DX are the same regardless of video mode
  7620.  
  7621. :int 33,4
  7622. ^INT 33,4 - Set Mouse Cursor Position
  7623.  
  7624.  
  7625.     AX = 4
  7626.     CX = horizontal position
  7627.     DX = vertical position
  7628.  
  7629.  
  7630.     returns nothing
  7631.  
  7632.  
  7633.     - default cursor position is at the screen center
  7634.     - the position must be within the range of the current video mode
  7635.     - the position may be rounded to fit screen mode resolution
  7636.  
  7637. :int 33,5
  7638. ^INT 33,5 - Get Mouse Button Press Information
  7639.  
  7640.  
  7641.     AX = 5
  7642.     BX = 0    left button
  7643.          1    right button
  7644.  
  7645.  
  7646.     on return:
  7647.     BX = count of button presses (0-32767), set to zero after call
  7648.     CX = horizontal position at last press
  7649.     DX = vertical position at last press
  7650.     AX = status:
  7651.  
  7652.         │F-8│7│6│5│4│3│2│1│0│  Button Status
  7653.           │  │ │ │ │ │ │ │ └──── left button (1 = pressed)
  7654.           │  │ │ │ │ │ │ └───── right button (1 = pressed)
  7655.           └──┴─┴─┴─┴─┴─┴────── unused
  7656.  
  7657. :int 33,6
  7658. ^INT 33,6 - Get Mouse Button Release Information
  7659.  
  7660.  
  7661.     AX = 6
  7662.     BX = 0    left button
  7663.          1    right button
  7664.  
  7665.  
  7666.     on return:
  7667.     BX = count of button releases (0-32767), set to zero after call
  7668.     CX = horizontal position at last release
  7669.     DX = vertical position at last release
  7670.     AX = status
  7671.  
  7672.         │F-8│7│6│5│4│3│2│1│0│  Button status
  7673.           │  │ │ │ │ │ │ │ └──── left button (1 = pressed)
  7674.           │  │ │ │ │ │ │ └───── right button (1 = pressed)
  7675.           └──┴─┴─┴─┴─┴─┴────── unused
  7676.  
  7677. :int 33,7
  7678. ^INT 33,7 - Set Mouse Horizontal Min/Max Position
  7679.  
  7680.  
  7681.     AX = 7
  7682.     CX = minimum horizontal position
  7683.     DX = maximum horizontal position
  7684.  
  7685.  
  7686.     returns nothing
  7687.  
  7688.  
  7689.     - restricts mouse horizontal movement to window
  7690.     - if min value is greater than max value they are swapped
  7691.  
  7692. :int 33,8
  7693. ^INT 33,8 - Set Mouse Vertical Min/Max Position
  7694.  
  7695.  
  7696.     AX = 8
  7697.     CX = minimum vertical position
  7698.     DX = maximum vertical position
  7699.  
  7700.  
  7701.     returns nothing
  7702.  
  7703.  
  7704.     - restricts mouse vertical movement to window
  7705.     - if min value is greater than max value they are swapped
  7706.  
  7707. :int 33,9
  7708. ^INT 33,9 - Set Mouse Graphics Cursor
  7709.  
  7710.  
  7711.     AX = 9
  7712.     BX = horizontal hot spot (-16 to 16)
  7713.     CX = vertical hot spot (-16 to 16)
  7714.     ES:DX = pointer to screen and cursor masks (16 byte bitmap)
  7715.  
  7716.  
  7717.     returns nothing
  7718.  
  7719.  
  7720.     - screen mask is AND'ed to screen Cursor Mask is XOR'ed
  7721.     - bytes 0-7 form the screen mask bitmap
  7722.     - bytes 8-F form the cursor mask bitmap
  7723.  
  7724. :int 33,a
  7725. ^INT 33,A - Set Mouse Text Cursor
  7726.  
  7727.  
  7728.     AX = 0A
  7729.     BX = 00  software cursor
  7730.          01  hardware cursor
  7731.     CX = start of screen mask or hardware cursor scan line
  7732.     DX = end of screen mask or hardware cursor scan line
  7733.  
  7734.  
  7735.     returns nothing
  7736.  
  7737. :int 33,b
  7738. ^INT 33,B - Read Mouse Motion Counters
  7739.  
  7740.  
  7741.     AX = 0B
  7742.  
  7743.  
  7744.     on return:
  7745.     CX = horizontal mickey count (-32768 to 32767)
  7746.     DX = vertical mickey count (-32768 to 32767)
  7747.  
  7748.  
  7749.     - count values are 1/200 inch intervals (1/200 in. = 1 mickey)
  7750.  
  7751. :int 33,c
  7752. ^INT 33,C - Set Mouse User Defined Subroutine and Input Mask
  7753.  
  7754.     AX = 0C
  7755.     ES:DX = far pointer to user interrupt
  7756.     CX = user interrupt mask:
  7757.  
  7758.        │F-5│4│3│2│1│0│ user interrupt mask in CX
  7759.          │    │ │ │ │ └─── cursor position changed
  7760.          │    │ │ │ └──── left button pressed
  7761.          │    │ │ └───── left button released
  7762.          │    │ └────── right button pressed
  7763.          │    └─────── right button released
  7764.          └───────── unused
  7765.  
  7766.     returns nothing
  7767.  
  7768.  
  7769.     - routine at ES:DX is called if an event occurs and the
  7770.       corresponding bit specified in user mask is set
  7771.     - routine at ES:DX receives parameters in the following
  7772.       registers:
  7773.  
  7774.       AX = condition mask causing call
  7775.       CX = horizontal cursor position
  7776.       DX = vertical cursor position
  7777.       DI = horizontal counts
  7778.       SI = vertical counts
  7779.       DS = mouse driver data segment
  7780.       BX = button state:
  7781.  
  7782.          │F-2│1│0│
  7783.            │  │ └─── left button (1 = pressed)
  7784.            │  └──── right button (1 = pressed)
  7785.            └────── unused
  7786.  
  7787.     - initial call mask and user routine should be restore on exit
  7788.       from user program
  7789.     - user program may need to set DS to its own segment
  7790.     - user routine should return via RETF instead of IRET
  7791.     - see    ~INT 33,14~
  7792.  
  7793. :int 33,d
  7794. ^INT 33,D - Mouse Light Pen Emulation On
  7795.  
  7796.  
  7797.     AX = 0D
  7798.  
  7799.  
  7800.     returns nothing
  7801.  
  7802.  
  7803.     - turns on light pen emulation;  the light pen is considered
  7804.       down when both buttons are down;   when both buttons are
  7805.       up the pen is considered off screen
  7806.  
  7807.     - see    ~INT 33,E~
  7808.  
  7809. :int 33,e
  7810. ^INT 33,E - Mouse Light Pen Emulation Off
  7811.  
  7812.  
  7813.     AX = 0E
  7814.  
  7815.  
  7816.     returns nothing
  7817.  
  7818.  
  7819.     - disables light pen emulation
  7820.  
  7821.     - see    ~INT 33,D~
  7822.  
  7823. :int 33,f
  7824. ^INT 33,F - Set Mouse Mickey Pixel Ratio
  7825.  
  7826.  
  7827.     AX = 0F
  7828.     CX = horizontal ratio (1..32767, default 8)
  7829.     DX = vertical ratio (1..32767, default 16)
  7830.  
  7831.  
  7832.     returns nothing
  7833.  
  7834.  
  7835.     - sets the ratio between physical cursor movement (mickeys) and
  7836.       screen coordinate changes
  7837.     - CX and DX must be unsigned (high bit must be 0)
  7838.  
  7839. :int 33,10
  7840. ^INT 33,10 - Mouse Conditional OFF
  7841.  
  7842.  
  7843.     AX = 10h
  7844.     CX = upper X screen coordinate
  7845.     DX = upper Y screen coordinate
  7846.     SI = lower X screen coordinate
  7847.     DI = lower Y screen coordinate
  7848.  
  7849.  
  7850.     returns nothing
  7851.  
  7852.  
  7853.     - defines screen region for updating in which the mouse is hidden
  7854.       if found these coordinates (INT 33,1 must be used to turn cursor
  7855.       on again)
  7856.  
  7857.     - see  ~INT 33,1~
  7858.  
  7859. :int 33,13
  7860. ^INT 33,13 - Set Mouse Double Speed Threshold
  7861.  
  7862.  
  7863.     AX = 13h
  7864.     DX = threshold speed (mickeys per second, default 64)
  7865.  
  7866.  
  7867.     returns nothing
  7868.  
  7869.  
  7870.     - cursor speed is doubled when the cursor moves across the screen
  7871.       at the threshold speed
  7872.  
  7873. :int 33,14
  7874. ^INT 33,14 - Swap Interrupt Subroutines
  7875.  
  7876.     AX = 14h
  7877.     ES:DX = far pointer to user routine
  7878.     CX = user interrupt mask:
  7879.  
  7880.         │F-8│7│6│5│4│3│2│1│0│ user interrupt mask in CX
  7881.           │  │ │ │ │ │ │ │ └─── cursor position changed
  7882.           │  │ │ │ │ │ │ └──── left button pressed
  7883.           │  │ │ │ │ │ └───── left button released
  7884.           │  │ │ │ │ └────── right button pressed
  7885.           │  │ │ │ └─────── right button released
  7886.           └──┴─┴─┴──────── unused
  7887.  
  7888.     on return:
  7889.     CX = previous user interrupt mask
  7890.     ES:DX = far pointer to previous user interrupt
  7891.  
  7892.     - routine at ES:DX is called if an event occurs and the
  7893.       corresponding bit specified in user mask is set
  7894.     - routine at ES:DX receives parameters in the following
  7895.       registers:
  7896.  
  7897.       AX = condition mask causing call
  7898.       CX = horizontal cursor position
  7899.       DX = vertical cursor position
  7900.       DI = horizontal counts
  7901.       SI = vertical counts
  7902.       DS = mouse driver data segment
  7903.       BX = button state:
  7904.  
  7905.          │F-2│1│0│
  7906.            │  │ └─── left button (1 = pressed)
  7907.            │  └──── right button (1 = pressed)
  7908.            └────── unused
  7909.  
  7910.     - initial call mask and user routine should be restore on exit
  7911.       from user program
  7912.     - user program may need to set DS to its own segment
  7913.     - see    ~INT 33,C~
  7914.  
  7915. :int 33,15
  7916. ^INT 33,15 - Get Mouse Driver State and Memory Requirements
  7917.  
  7918.  
  7919.     AX = 15h
  7920.  
  7921.  
  7922.     on return
  7923.     BX = buffer size need to hold current mouse state
  7924.  
  7925.  
  7926.     - used before mouse functions 16h and 17h to determine memory
  7927.       needed to save mouse state before giving up control of mouse
  7928.       to another program
  7929.  
  7930. :int 33,16
  7931. ^INT 33,16 - Save Mouse Driver State
  7932.  
  7933.  
  7934.     AX = 16h
  7935.     ES:DX = far pointer to mouse state save buffer
  7936.  
  7937.  
  7938.     returns nothing
  7939.  
  7940.  
  7941.     - used to save mouse information before relinquishing control
  7942.       to another programs mouse handler
  7943.     - see ~INT 33,15~   ~INT 33,17~
  7944.  
  7945. :int 33,17
  7946. ^INT 33,17 - Restore Mouse Driver State
  7947.  
  7948.  
  7949.     AX = 17h
  7950.     ES:DX = far pointer to mouse state save buffer
  7951.  
  7952.  
  7953.     returns nothing
  7954.  
  7955.  
  7956.     - used to restore mouse information after regaining control
  7957.       from another programs mouse handler
  7958.     - see ~INT 33,15~   ~INT 33,16~
  7959.  
  7960. :int 33,18
  7961. ^INT 33,18 - Set alternate subroutine call mask and address
  7962.  
  7963.     AX = 18h
  7964.     DX = offset to function
  7965.     CX = user interrupt mask:
  7966.  
  7967.         │F-8│7│6│5│4│3│2│1│0│ user interrupt mask in CX
  7968.           │  │ │ │ │ │ │ │ └─── alt key pressed during event
  7969.           │  │ │ │ │ │ │ └──── ctrl key pressed during event
  7970.           │  │ │ │ │ │ └───── shift key pressed during event
  7971.           │  │ │ │ │ └────── right button up event
  7972.           │  │ │ │ └─────── right button down event
  7973.           │  │ │ └──────── left button up event
  7974.           │  │ └───────── left button down event
  7975.           │  └────────── cursor moved
  7976.           └──────────── unused
  7977.  
  7978.     - entire mask is set to zero when ~INT 33,0~ is called
  7979.     - up to three handlers may be defined with this call
  7980.     - mask should be cleared before program exit
  7981.     - when handler is called it receives parameters in the following
  7982.       registers:
  7983.  
  7984.       AX = condition mask causing call
  7985.       CX = horizontal cursor position
  7986.       DX = vertical cursor position
  7987.       DI = horizontal counts
  7988.       SI = vertical counts
  7989.       DS = mouse driver data segment
  7990.       BX = button state:
  7991.  
  7992.          │F-2│1│0│
  7993.            │  │ └─── left button (1 = pressed)
  7994.            │  └──── right button (1 = pressed)
  7995.            └────── unused
  7996.  
  7997. :int 33,19
  7998. ^INT 33,19 - Get User Alternate Interrupt Address
  7999.  
  8000.     AX = 19h
  8001.     CX = user interrupt call mask (see below)
  8002.  
  8003.  
  8004.     on return:
  8005.     BX:DX = user interrupt vector
  8006.     CX = user interrupt call mask or zero if not found
  8007.  
  8008.         │F-8│7│6│5│4│3│2│1│0│ user interrupt mask in CX
  8009.           │  │ │ │ │ │ │ │ └─── alt key pressed during event
  8010.           │  │ │ │ │ │ │ └──── ctrl key pressed during event
  8011.           │  │ │ │ │ │ └───── shift key pressed during event
  8012.           │  │ │ │ │ └────── right button up event
  8013.           │  │ │ │ └─────── right button down event
  8014.           │  │ │ └──────── left button up event
  8015.           │  │ └───────── left button down event
  8016.           │  └────────── cursor moved
  8017.           └──────────── unused
  8018.  
  8019.     - returns vector to function defined by ~INT 33,18~
  8020.     - searches the event handlers defined by INT 33,18 for a routine
  8021.       with a call mask matching CX
  8022.  
  8023. :int 33,1a
  8024. ^INT 33,1A - Set Mouse Sensitivity
  8025.  
  8026.  
  8027.     AX = 1A
  8028.     BX = horizontal coordinates per pixel  (≤ 100)
  8029.     CX = vertical coordinates per pixel  (≤ 100)
  8030.     DX = double speed threshold
  8031.  
  8032.  
  8033.     returns nothing
  8034.  
  8035.  
  8036.     - sets mouse sensitivity by setting the ratio of the mouse
  8037.       coordinates per screen pixel
  8038.     - provides same results as calls to both ~INT 33,F~ and ~INT 33,13~
  8039.     - these values are not reset by ~INT 33,0~
  8040. :int 33,1b
  8041. ^INT 33,1B - Get Mouse Sensitivity
  8042.  
  8043.  
  8044.     AX = 1B
  8045.  
  8046.  
  8047.     on return:
  8048.     BX = horizontal coordinates per pixel  (≤ 100)
  8049.     CX = vertical coordinates per pixel  (≤ 100)
  8050.     DX = double speed threshold
  8051.  
  8052.  
  8053.     - returns mouse sensitivity information as the number of mouse
  8054.       coordinates per screen pixel
  8055.  
  8056. :int 33,1c
  8057. ^INT 33,1C - Set Mouse Interrupt Rate  (InPort only)
  8058.  
  8059.  
  8060.     AX = 1C
  8061.     BX = rate code
  8062.        = 0    no interrupts
  8063.        = 1    30 interrupts per second
  8064.        = 2    50 interrupts per second
  8065.        = 3    100 interrupts per second
  8066.        = 4    200 interrupts per second
  8067.  
  8068.  
  8069.  
  8070.     - work with the InPort mouse only
  8071.     - sets the rate the mouse status is polled by the mouse driver
  8072.     - faster rates provide better resolution but take away CPU time
  8073.     - values in BX > 4 can cause unpredicatable results
  8074.  
  8075. :int 33,1d
  8076. ^INT 33,1D - Set Mouse CRT Page
  8077.  
  8078.  
  8079.     AX = 1D
  8080.     BX = CRT page number
  8081.  
  8082.  
  8083.     returns nothing
  8084.  
  8085.  
  8086.     - sets the CRT page which the mouse cursor is displayed
  8087.     - see ~VIDEO PAGES~
  8088.  
  8089. :int 33,1e
  8090. ^INT 33,1E - Get Mouse CRT Page
  8091.  
  8092.  
  8093.     AX = 1E
  8094.  
  8095.  
  8096.     on return:
  8097.     BX = CRT page number cursor is displayed on
  8098.  
  8099.  
  8100.     - see ~VIDEO PAGES~
  8101.  
  8102. :int 33,1f
  8103. ^INT 33,1F - Disable Mouse Driver
  8104.  
  8105.  
  8106.     AX = 1F
  8107.  
  8108.  
  8109.     on return:
  8110.     AX = 001F if successful
  8111.          FFFF if error
  8112.     ES:BX = previous ~INT 33~ vector
  8113.  
  8114.  
  8115.     - restores vectors for ~INT 10~ and INT 71 (8088/86) or INT 74 (286+)
  8116.     - ~INT 33~ interrupt vector (software) is not affected
  8117.     - use of the vector returned in ES:BX to restore the previous INT 33
  8118.       vector can cause problems since it contains the value of INT 33
  8119.       before the driver was installed; any other hooks into INT 33 set
  8120.       after driver installation will not receive service
  8121.  
  8122. :int 33,20
  8123. ^INT 33,20 - Enable Mouse Driver
  8124.  
  8125.  
  8126.     AX = 20h
  8127.  
  8128.  
  8129.     returns nothing
  8130.  
  8131.  
  8132.     - reinstalls the mouse drivers interrupt vectors for INT 10 and
  8133.       INT 71 (8088/86) and INT 74 (286/386)
  8134.     - see ~INT 33,1F~
  8135.  
  8136. :int 33,21
  8137. ^INT 33,21 - Reset Mouse Software
  8138.  
  8139.     AX = 21h
  8140.  
  8141.     on return:
  8142.     AX = 0021  mouse driver not installed
  8143.          FFFF  mouse driver installed
  8144.     BX = 2    mouse driver installed
  8145.  
  8146.     - similar to ~INT 33,0~ but does not reset the mouse hardware or
  8147.       display variables
  8148.     - both AX and BX must be correct for successful reset
  8149.     - interrupt routines set through ~INT 33,18~ are preserved
  8150.     - resets the mouse to the following defaults:
  8151.  
  8152.       .  mouse is positioned to screen center
  8153.       .  mouse cursor is reset and hidden
  8154.       .  no interrupts are enabled (mask = 0)
  8155.       .  double speed threshold set to 64 mickeys per second
  8156.       .  horizontal mickey to pixel ratio (8 to 8)
  8157.       .  vertical mickey to pixel ratio (16 to 8)
  8158.       .  max width and height are set to maximum for video mode
  8159.  
  8160. :int 33,22
  8161. ^INT 33,22 - Set Language for Messages
  8162.  
  8163.     AX = 22h
  8164.     BX = language number (with /L switch value):
  8165.        = 0    English     n/a
  8166.        = 1    French        F
  8167.        = 2    Dutch        NL
  8168.        = 3    German        D
  8169.        = 4    Swedish     S
  8170.        = 5    Finnish     SF
  8171.        = 6    Spanish     E
  8172.        = 7    Portuguese  P
  8173.        = 8    Italian     I
  8174.  
  8175.  
  8176.     returns nothing
  8177.  
  8178.  
  8179.     - only works with international version of the mouse driver
  8180.     - see    ~INT 33,23~
  8181. :int 33,23
  8182. ^INT 33,23 - Get Language Number
  8183.  
  8184.     AX = 23h
  8185.  
  8186.  
  8187.     on return:
  8188.     BX = language number (with /L switch value):
  8189.        = 0    English     n/a
  8190.        = 1    French        F
  8191.        = 2    Dutch        NL
  8192.        = 3    German        D
  8193.        = 4    Swedish     S
  8194.        = 5    Finnish     SF
  8195.        = 6    Spanish     E
  8196.        = 7    Portuguese  P
  8197.        = 8    Italian     I
  8198.  
  8199.     - only works with international version of the mouse driver
  8200.     - returns English (0) if not international version
  8201.  
  8202.     - see    ~INT 33,22~
  8203. :int 33,24
  8204. ^INT 33,24 - Get Driver Version, Mouse Type & IRQ Number
  8205.  
  8206.     AX = 24h
  8207.  
  8208.  
  8209.     on return:
  8210.     BH = major version (see below)
  8211.     BL = minor version (see below)
  8212.     CH = mouse type:
  8213.        = 1    bus mouse
  8214.        = 2    serial mouse
  8215.        = 3    InPort mouse
  8216.        = 4    PS/2  mouse
  8217.        = 5    Hewlett Packard mouse
  8218.     CL = IRQ number:
  8219.        = 0    PS/2
  8220.        = 2    ~IRQ~ 2
  8221.        = 5    IRQ 5
  8222.        = 7    IRQ 7
  8223.  
  8224.     - version 6.1 would be represented as BH = 06h, BL = 10h
  8225. :int 4a
  8226. ^INT 4A - RTC Alarm Handler Vector
  8227.  
  8228.  
  8229.     - not a true interrupt, but a pointer to an alarm handler routine
  8230.     - called by  ~INT 70~  and enabled by ~INT 1A,6~
  8231.     - routine must exit via IRET
  8232.  
  8233. :int 67:EMS services
  8234. ^INT 67 - Expanded Memory Specification
  8235.  
  8236. %    For more information, see the following topics:
  8237.  
  8238.     ~INT 67,40~  Get EMM Status
  8239.     ~INT 67,41~  Get Page Frame Base Address
  8240.     ~INT 67,42~  Get Page Counts
  8241.     ~INT 67,43~  Get Handle and Allocate Pages
  8242.     ~INT 67,44~  Map Logical Page Into Physical Page Window
  8243.     ~INT 67,45~  Release Handle and Memory Pages
  8244.     ~INT 67,46~  Get EMM Version
  8245.     ~INT 67,47~  Save Page Map Context
  8246.     ~INT 67,48~  Restore Page Map Context
  8247.     ~INT 67,49~  Get I/O Port Addresses
  8248.     ~INT 67,4A~  Get Logical to Physical Page Mapping
  8249.     ~INT 67,4B~  Get Handle Count
  8250.     ~INT 67,4C~  Get Page Count for Handle
  8251.     ~INT 67,4D~  Get Page Count for All Handles
  8252.     ~INT 67,4E~  Get/Set Page Map Context
  8253.     ~INT 67,4F~  Get/Set Partial Page Map
  8254.     ~INT 67,50~  Map/Unmap Multiple Handle Pages
  8255.     ~INT 67,51~  Reallocate Pages
  8256.     ~INT 67,52~  Get/Set Handle Attributes
  8257.     ~INT 67,53~  Get/Set Handle Name
  8258.     ~INT 67,54~  Get Handle Directory
  8259.     ~INT 67,55~  Alter Page Map and Jump
  8260.     ~INT 67,56~  Alter Page Map and Call
  8261.     ~INT 67,57~  Move/Exchange Memory Region
  8262.     ~INT 67,58~  Get Mappable Physical Address Array
  8263.     ~INT 67,59~  Get Expanded Memory Hardware Information
  8264.     ~INT 67,5A~  Allocate Standard/Raw Pages
  8265.     ~INT 67,5B~  Alternate Map Register Set DMA Registers
  8266.     ~INT 67,5C~  Prepare Expanded Memory for Warm Boot
  8267.     ~INT 67,5D~  Enable/Disable OS Functions
  8268.     ~INT 67,60~  Get Physical Window Array
  8269.  
  8270.     - function number is specified in AH
  8271.     - see    ~EMS STATUS~
  8272.  
  8273. :int 67,40:EMS status
  8274. ^INT 67,40 - Get EMM Status  (LIM EMS 3.0+)
  8275.  
  8276.     AH = 40h
  8277.  
  8278.     on return:
  8279.     AH = status
  8280.  
  8281.          00  success
  8282.          80  internal software error
  8283.          81  hardware malfunction
  8284.          83  unallocated or invalid handle
  8285.          84  undefined function requested
  8286.          85  no handles available
  8287.          86  error in save or restore of mapping context
  8288.          87  more pages requested than physically exist
  8289.          88  more pages requested than currently available
  8290.          89  zero pages requested
  8291.          8A  invalid logical page number
  8292.          8B  illegal physical page number
  8293.          8C  context stack out of memory
  8294.          8D  context save failed, handle already has context stack
  8295.          8E  context restore failed, no context stack for handle
  8296.          8F  invalid subfunction
  8297.          90  undefined attribute type
  8298.          91  feature not supported
  8299.          92  success, portion of the source region was overwritten
  8300.          93  length of source or destination region exceeds length of
  8301.          region allocated to either source or destination handle
  8302.          94  conventional and expanded memory regions overlap
  8303.          95  offset within logical page exceeds size of logical page
  8304.          96  region length exceeds 1M
  8305.          97  source and destination regions have same handle and overlap
  8306.          98  memory source or destination type undefined
  8307.          9A  specified DMA register set not supported ???
  8308.          specified alternate map register set not supported
  8309.          9B  all DMA register sets currently allocated ???
  8310.          all alternate map register sets currently allocated
  8311.          9C  alternate DMA sets not supported ???
  8312.          alternate map register sets not supported
  8313.          9D  undefined or unallocated DMA register set ???
  8314.          undefined or unallocated alternate map register set
  8315.          9E  dedicated DMA channels not supported
  8316.          9F  specified dedicated DMA channel not supported
  8317.          A1  duplicate handle name
  8318.          A2  attempted to wrap around 1Mb conventional address space
  8319.          A3  contents of partial page map corrupted or count of
  8320.          mappable segments exceeds total mappable segments
  8321.          A4  operating system denied access
  8322.  
  8323.  
  8324.     - registers not listed are preserved
  8325.     - should only be used after establishing that the EMS driver
  8326.       is present
  8327. :int 67,41
  8328. ^INT 67,41 - Get Page Frame Base Address  (LIM EMS 3.0+)
  8329.  
  8330.  
  8331.     AH = 41h
  8332.  
  8333.  
  8334.     on return:
  8335.     AH = 00 success
  8336.        = error code (see ~EMS STATUS~)
  8337.     BX = segment of page frame (PFBA)
  8338.  
  8339.  
  8340.     - use this to determine where in the 1Mb memory address the page
  8341.       frame will be mapped
  8342.     - registers not listed are preserved
  8343.  
  8344. :int 67,42
  8345. ^INT 67,42 - Get Page Counts  (LIM EMS 3.2+)
  8346.  
  8347.  
  8348.     AH = 42h
  8349.  
  8350.  
  8351.     on return:
  8352.     AH = 00  success
  8353.        = error code (see ~EMS STATUS~)
  8354.     BX = number of unallocated or available pages
  8355.     DX = total number of pages in EMM system
  8356.  
  8357.  
  8358.     - registers not listed are preserved
  8359.  
  8360. :int 67,43
  8361. ^INT 67,43 - Get Handle and Allocate Pages  (LIM EMS 3.2+)
  8362.  
  8363.  
  8364.     AH = 43h
  8365.     BX = number of logical pages to allocate
  8366.  
  8367.  
  8368.     on return:
  8369.     AH = 00  success
  8370.        = error code (see ~EMS STATUS~)
  8371.     DX = EMM handle
  8372.  
  8373.  
  8374.     - handles not explicitly closed by the application are not
  8375.       recoverable on exit from the program
  8376.     - registers not listed are preserved
  8377.  
  8378. :int 67,44
  8379. ^INT 67,44 - Map Logical Page Into Physical Page Window (LIM EMS)
  8380.  
  8381.  
  8382.     AH = 44h
  8383.     AL = physical page number (0-3)
  8384.     BX = logical page number (0 to total allocated minus 1)
  8385.     DX = EMM handle
  8386.  
  8387.  
  8388.     on return:
  8389.     AH = 00  success
  8390.        = error code (see ~EMS STATUS~)
  8391.  
  8392.  
  8393.     - registers not listed are preserved
  8394.  
  8395. :int 67,45
  8396. ^INT 67,45 - Release Handle and Memory Pages  (LIM EMS)
  8397.  
  8398.  
  8399.     AH = 45h
  8400.     DX = EMM handle
  8401.  
  8402.  
  8403.     on return:
  8404.     AH = 00 success
  8405.        = error code (see ~EMS STATUS~)
  8406.  
  8407.  
  8408.     - handles must be explicitly freed by an application or the memory
  8409.       will not be available to the following applications
  8410.     - if unsuccessful, the operation should be retried
  8411.     - registers not listed are preserved
  8412.  
  8413. :int 67,46
  8414. ^INT 67,46 - Get EMM Version  (LIM EMS)
  8415.  
  8416.  
  8417.     AH = 46h
  8418.  
  8419.  
  8420.     on return:
  8421.     AH = 00  success
  8422.        = error code (see ~EMS STATUS~)
  8423.     AL = EMM version number in BCD
  8424.  
  8425.  
  8426.     - upper four bits of AL contain the BCD major version
  8427.     - lower four bits of AL contain the BCD minor version
  8428.     - registers not listed are preserved
  8429.  
  8430. :int 67,47
  8431. ^INT 67,47 - Save Page Map Context  (LIM EMS 3.0+)
  8432.  
  8433.  
  8434.     AH = 47h
  8435.     DX = EMM handle assigned to the interrupt service routine
  8436.          servicing the interrupt
  8437.  
  8438.  
  8439.     on return:
  8440.     AH = 00  success
  8441.        = error code (see ~EMS STATUS~)
  8442.  
  8443.  
  8444.     - any TSR, ISR or device driver using EMS should save contexts
  8445.       before manipulating EMS memory and restore contexts afterwards
  8446.     - registers not listed are preserved
  8447.     - see ~INT 67,48~
  8448.  
  8449. :int 67,48
  8450. ^INT 67,48 - Restore Page Map Context  (LIM EMS 3.0+)
  8451.  
  8452.  
  8453.     AH = 48h
  8454.     DX = EMM handle assigned to the interrupt service routine
  8455.          servicing the interrupt
  8456.  
  8457.  
  8458.     on return:
  8459.     AH = 00  success
  8460.        = error code (see ~EMS STATUS~)
  8461.  
  8462.  
  8463.     - any TSR, ISR or device driver using EMS should save contexts
  8464.       before manipulating EMS memory and restore contexts afterwards
  8465.     - registers not listed are preserved
  8466.  
  8467. :int 67,49
  8468. ^INT 67,49 - Get I/O Port Addresses  (LIM EMS ≤ 3.0)
  8469.  
  8470.  
  8471.     AH = 49h
  8472.     ES:DI = far pointer to storage array
  8473.  
  8474.  
  8475.     on return:
  8476.     AL = board count  (0 < AL <= 4)
  8477.     AH = 00 success
  8478.        = error code (see ~EMS STATUS~)
  8479.  
  8480.  
  8481.     - defined in EMS 3.0, but undocumented in EMS 3.2;  new software
  8482.       should not use this function, but old software still works
  8483.     - registers not listed are preserved
  8484.  
  8485. :int 67,4a
  8486. ^INT 67,4A - Get Logical to Physical Page Mapping  (LIM EMS ≤ 3.0)
  8487.  
  8488.  
  8489.     AH = 4A
  8490.     DX = EMS handle
  8491.     ES:DI far pointer to storage array
  8492.  
  8493.  
  8494.     on return:
  8495.     AH = 00  success
  8496.        = error code (see ~EMS STATUS~)
  8497.     BX = contains count of entries placed in array at ES:DI
  8498.  
  8499.  
  8500.     - defined in EMS 3.0, but undocumented in EMS 3.2;  new software
  8501.       should not use this function, but old software still works
  8502.     - registers not listed are preserved
  8503.  
  8504. :int 67,4b
  8505. ^INT 67,4B - Get Handle Count  (LIM EMS)
  8506.  
  8507.  
  8508.     AH = 4Bh
  8509.  
  8510.  
  8511.     on return:
  8512.     AH = 00  success
  8513.        = error code (see ~EMS STATUS~)
  8514.     BX = number of currently active EMM handles (0-256)
  8515.          zero indicates EMS not in use
  8516.  
  8517.  
  8518.     - to determine the number of handles available subtract BX from 255
  8519.     - registers not listed are preserved
  8520.  
  8521. :int 67,4c
  8522. ^INT 67,4C - Get Page Count for Handle    (LIM EMS)
  8523.  
  8524.  
  8525.     AH = 4Ch
  8526.     DX = EMM handle
  8527.  
  8528.  
  8529.     on return:
  8530.     AH = 00  success
  8531.        = error code (see ~EMS STATUS~)
  8532.     BX = total allocated page count for handle (1-512)
  8533.  
  8534.  
  8535.     - a handle can refer to up to 512 logical pages
  8536.     - registers not listed are preserved
  8537.  
  8538. :int 67,4d
  8539. ^INT 67,4D - Get Page Count for All Handles  (LIM EMS)
  8540.  
  8541.     AH = 4Dh
  8542.     ES:DI = pointer to handle array
  8543.  
  8544.  
  8545.     on return:
  8546.     AH = 00  success
  8547.        = error code (see ~EMS STATUS~)
  8548.     BX = number of active EMM handles (0..255)
  8549.     ES:DI = pointer to an array of entries of the format:
  8550.  
  8551.        Offset  Size     Description
  8552.          00    word   EMS handle number
  8553.          02    word   number of pages
  8554.  
  8555.     - buffer at ES:DI should be able to hold an array of at least 4*BX
  8556.     - an error will occur if ES:DI points to a buffer that will
  8557.       cause a segment swap
  8558.     - registers not listed are preserved
  8559. :int 67,4e
  8560. ^INT 67,4E - Get/Set Page Map Context  (LIM EMS 3.2+)
  8561.  
  8562.     AH = 4Eh
  8563.     AL = 00  get page mapping context into array
  8564.          ES:DI = pointer to destination array
  8565.          01  set page mapping context from array
  8566.          DS:SI = pointer to context source array
  8567.          02  get and set page mapping registers at once
  8568.          ES:DI = pointer to destination array
  8569.          DS:SI = pointer to context source array
  8570.          03  get size of page mapping array
  8571.          04-31  reserved
  8572.  
  8573.  
  8574.     on return:
  8575.     AH = 00  success
  8576.        = error code (see ~EMS STATUS~)
  8577.     AL = bytes in pagemapping array (when AL=3)
  8578.     ES:DI = pointer to array with mapping info (AL=00/02)
  8579.  
  8580.     - an error will occur if ES:DI points to a buffer that will
  8581.       cause a segment swap
  8582.     - designed for use by multitasking operating systems only
  8583.  
  8584. :int 67,4f
  8585. ^INT 67,4F - Get/Set Partial Page Map  (LIM EMS 4.0+)
  8586.  
  8587.     AH = 4Fh
  8588.  
  8589.     AL = 00  get partial page map
  8590.          DS:SI = pointer to structure containing list of segments whose
  8591.              mapping contexts are to be saved
  8592.          ES:DI = pointer to array to receive page map
  8593.  
  8594.     AL = 01  set partial page map
  8595.          DS:SI = pointer to structure containing saved partial page map
  8596.  
  8597.     AL = 02  get size of partial page map
  8598.          BX = number of mappable segments in the partial map to be saved
  8599.  
  8600.  
  8601.     on return:
  8602.     AH = 00  success
  8603.        = error code (see ~EMS STATUS~)
  8604.     AL = size of partial page map (if AL=2)
  8605.  
  8606. :int 67,50
  8607. ^INT 67,50 - Map/Unmap Multiple Handle Pages  (LIM EMS 4.0+)
  8608.  
  8609.  
  8610.     AH = 50h
  8611.     AL = 00 Map/unmap pages
  8612.        = 01 map/unmap segments
  8613.     DX = EMM handle
  8614.     CX = number of entries in array
  8615.     DS:SI = pointer to mapping array
  8616.  
  8617.  
  8618.     on return:
  8619.     AH = 00  success
  8620.        = error code (see ~EMS STATUS~)
  8621.  
  8622. :int 67,51
  8623. ^INT 67,51 - Reallocate Pages  (LIM EMS 4.0+)
  8624.  
  8625.  
  8626.     AH = 51h
  8627.     DX = EMM handle
  8628.     BX = number of pages to be allocated to handle
  8629.  
  8630.  
  8631.     on return:
  8632.     AH = 00  success
  8633.        = error code (see ~EMS STATUS~)
  8634.     BX = actual number of pages allocated to handle
  8635.  
  8636. :int 67,52
  8637. ^INT 67,52 - Get/Set Handle Attributes    (LIM EMS 4.0+)
  8638.  
  8639.  
  8640.     AH = 52h
  8641.     AL = 00  get handle attributes
  8642.          01  set handle attributes
  8643.          02  get attribute capability
  8644.     BL = new attribute (if AL=1)
  8645.     DX = EMM handle
  8646.  
  8647.  
  8648.     on return:
  8649.     AH = 00  success
  8650.        = error code (see ~EMS STATUS~)
  8651.     AL = attribute (input AL=0)
  8652.          00  handle is volatile
  8653.          01  handle is nonvolatile
  8654.     AL = attribute capability (input AL=2)
  8655.          00  only volatile handles supported
  8656.          01  both volatile and nonvolatile supported
  8657.  
  8658. :int 67,53
  8659. ^INT 67,53 Get/Set Handle Name    (LIM EMS 4.0+)
  8660.  
  8661.  
  8662.     AH = 53h
  8663.     AL = 00 get handle name
  8664.         ES:DI = pointer to 8byte handle name array
  8665.  
  8666.          01 set handle name
  8667.         DS:SI = pointer to 8byte handle name
  8668.         DX = EMM handle
  8669.  
  8670.  
  8671.     on return:
  8672.     AH = status  (see ~EMS STATUS~)
  8673.  
  8674. :int 67,54
  8675. ^INT 67,54 - Get Handle Directory  (LIM EMS 4.0+)
  8676.  
  8677.  
  8678.     AH = 54h
  8679.     AL = 00  get handle directory
  8680.          ES:DI = pointer to buffer for handle directory
  8681.  
  8682.          01  search for named handle
  8683.          DS:SI = pointer to 8byte name
  8684.  
  8685.          02  get total number of handles
  8686.  
  8687.  
  8688.     on return:
  8689.     AL = number of entries in handle directory (AL = 00h)
  8690.     DX = value of named handle (if AH was 01)
  8691.     BX = total number of handles (if AH was 02)
  8692.     AH = status  (see ~EMS STATUS~)
  8693.  
  8694. :int 67,55
  8695. ^INT 67,55 - Alter Page Map and Jump  (LIM EMS 4.0+)
  8696.  
  8697.  
  8698.     AH = 55h
  8699.     AL = 00  physical page numbers provided by caller
  8700.          01  segment addresses provided by caller
  8701.     DX = EMM handle
  8702.     DS:SI = pointer to structure with map and jump address
  8703.  
  8704.  
  8705.     on return:
  8706.     AH = status  (see ~EMS STATUS~)
  8707.  
  8708. :int 67,56
  8709. ^INT 67,56 - Alter Page Map and Call  (LIM EMS 4.0+)
  8710.  
  8711.  
  8712.     AH = 56h
  8713.     AL = 00  physical page numbers provided by caller
  8714.          DX = EMM handle
  8715.          DS:SI = pointer to structure with page map and call address
  8716.          01  segment addresses provided by caller
  8717.          DX = EMM handle
  8718.          DS:SI = pointer to structure with page map and call address
  8719.          02  get page map stack space required
  8720.  
  8721.  
  8722.     on return:
  8723.     BX = stack space required (AL = 02)
  8724.     AH = status  (see ~EMS STATUS~)
  8725.  
  8726.  
  8727.     - if successful, the target address is called
  8728.     - use a RETF to return and restore mapping context
  8729.  
  8730. :int 67,57
  8731. ^INT 67,57 - Move/Exchange Memory Region  (LIM EMS 4.0+)
  8732.  
  8733.  
  8734.     AH = 57h
  8735.     AL = 00  move memory region
  8736.          01  exchange memory region
  8737.     DS:SI = pointer to structure describing source and destination
  8738.  
  8739.  
  8740.     on return:
  8741.     AH = status  (see ~EMS STATUS~)
  8742.  
  8743. :int 67,58
  8744. ^INT 67,58 - Get Mappable Physical Address Array  (LIM EMS 4.0+)
  8745.  
  8746.  
  8747.     AH = 58h
  8748.     AL = 00  get mappable physical address array
  8749.          ES:DI = pointer to buffer to be filled with array
  8750.          01  get number of entries in m.p.a. array
  8751.  
  8752.  
  8753.     on return:
  8754.     CX = number of entries in array
  8755.     AH = status  (see ~EMS STATUS~)
  8756.  
  8757. :int 67,59
  8758. ^INT 67,59 - Get Expanded Memory Hardware Information (LIM EMS 4.0+)
  8759.  
  8760.  
  8761.     AH = 59h
  8762.     AL = 00  get hardware configuration array
  8763.          ES:DI = pointer to buffer to be filled with array
  8764.          01  get unallocated raw page count
  8765.  
  8766.  
  8767.     on return:
  8768.     BX = unallocated raw pages (AL = 01)
  8769.     DX = total raw pages (AL = 01)
  8770.     AH = status  (see ~EMS STATUS~)
  8771.  
  8772.  
  8773.     - subfunction 00 is for use by operating systems only; can be
  8774.       enabled or disabled at any time by the operating system
  8775.  
  8776. :int 67,5a
  8777. ^INT 67,5A - Allocate Standard/Raw Pages  (LIM EMS 4.0+)
  8778.  
  8779.  
  8780.     AH = 5A
  8781.     AL = 00  allocate standard pages
  8782.          01  allocate raw pages
  8783.     BX = number of pages to allocate
  8784.  
  8785.  
  8786.     on return:
  8787.     DX = EMM handle
  8788.     AH = status  (see ~EMS STATUS~)
  8789.  
  8790. :int 67,5b
  8791. ^INT 67,5B - Alternate Map Register Set  (LIM EMS 4.0+)
  8792.  
  8793.     AH = 5B
  8794.     AL = 00  get alternate map register set
  8795.          01  set alternate map register set
  8796.          BL = new alternate map register set number
  8797.          ES:DI = pointer to map register context save area if BL=0
  8798.          02  get alternate map save array size
  8799.          03  allocate alternate map register set
  8800.          04  deallocate alternate map register set
  8801.          BL = number of alternate map register set
  8802.          05  allocate DMA register set
  8803.          06  enable DMA on alternate map register set
  8804.          BL = DMA register set number
  8805.          DL = DMA channel number
  8806.          07  disable DMA on alternate map register set
  8807.          BL = DMA register set number
  8808.          08  deallocate DMA register set
  8809.          BL = DMA register set number
  8810.  
  8811.     on return:
  8812.     AH = status  (see ~EMS STATUS~)
  8813.     BL = active alternate map register set number if nonzero (AL=0)
  8814.        = number of alternate map register set; 0 if not supported (AL=3)
  8815.        = DMA register set number; zero if not supported (AL = 05)
  8816.     DX = array size in bytes (AL = 02)
  8817.     ES:DI = pointer to a map register context save area if BL=0 (AL=0)
  8818.  
  8819.  
  8820.     - for use by operating systems only; can be enabled or disabled
  8821.       at any time by the operating system
  8822.  
  8823. :int 67,5c
  8824. ^INT 67,5C - Prepare Expanded Memory for Warm Boot  (LIM EMS 4.0+)
  8825.  
  8826.     AH = 5C
  8827.  
  8828.  
  8829.     on return:
  8830.     AH = status  (see ~EMS STATUS~)
  8831.  
  8832. :int 67,5d
  8833. ^INT 67,5D - Enable/Disable OS Functions  (LIM EMS 4.0+)
  8834.  
  8835.  
  8836.     AH = 5D
  8837.     AL = 00  enable OS function Set
  8838.          01  disable OS function Set
  8839.          02  return access key
  8840.     BX,CX = access key returned by first invocation
  8841.  
  8842.  
  8843.     on return:
  8844.     AH = status  (see ~EMS STATUS~)
  8845.     BX,CX = access key, returned only on first invocation of function
  8846.  
  8847.  
  8848.     - function 2 resets memory manager, returns access key at next
  8849.       invocation
  8850.  
  8851. :int 67,60
  8852. ^INT 67,60 - LIM EMS Get Physical Window Array
  8853.  
  8854.  
  8855.     AH = 60h
  8856.     ES:DI = pointer to physical window array
  8857.  
  8858.  
  8859.     on return:
  8860.     AH = 00  success
  8861.        = error status  (see ~EMS STATUS~)
  8862.  
  8863. :int 70
  8864. ^INT 70 - Real Time Clock Interrupt  (XT 286,AT,PS/2)
  8865.  
  8866.  
  8867.     - called 1024 times per second for periodic and alarm functions
  8868.     - decrements a DWORD counter by 976µ sec (1/1024)
  8869.     - when DWORD reaches zero, bit 7 of designated wait flag is set
  8870.     - if alarm was enabled by  ~INT 1A,6~,  ~INT 4A~ is called when
  8871.       counter reaches zero to activate alarm handler
  8872.     - not available in model 30 PS/2
  8873.  
  8874.  
  8875.     - see    ~INT 15,83~   ~INT 15,86~
  8876.