home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD2.mdf / doc / helppc / interrup.txt < prev    next >
Text File  |  1991-04-14  |  250KB  |  8,823 lines

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