home *** CD-ROM | disk | FTP | other *** search
/ For Beginners & Professional Hackers / cd.iso / docum / dos-ref.doc / inter.lst < prev    next >
Encoding:
File List  |  1979-12-31  |  94.4 KB  |  2,306 lines

  1. -----------------------------------------------------------
  2. INT 0 - DIVIDE ERROR
  3. Automatically called at end of DIV or IDIV operation
  4. that results in error. Normally set by DOS to display an error
  5. message and abort the program.
  6. -----------------------------------------------------------
  7. INT 1 - SINGLE-STEP
  8. Generated at end of each machine instruction if
  9. TF bit in FLAGS is set. This is what makes the T command
  10. of DEBUG work for single-stepping. Is not generated after
  11. MOV to segment register or POP of segment register.
  12. -----------------------------------------------------------
  13. INT 2 - NMI (Non Maskable Interrupt)
  14. Generated by NMI signal in hardware. Used in IBM for
  15. memory parity error trapping.
  16. -----------------------------------------------------------
  17. INT 3 - 1-BYTE INTERRUPT
  18. Generated by opcode 0CCh. Similar to 8080's RST
  19. instruction. Generally used to set breakpoints for DEBUG.
  20. -----------------------------------------------------------
  21. INT 4 - Overflow (internal interrupt)
  22. Generated by INTO instruction if OF flag is set. If
  23. flag is not set, INTO is effectively a NOP. Used to trap any
  24. arithmetic errors when program is ready to handle them rather
  25. than immediately when they occur.
  26. -----------------------------------------------------------
  27. INT 5 - Print-Screen Key
  28. Automatically called by keyboard scan when print-
  29. screen key is pressed. Normally executes routine to print
  30. the screen, but may call any routine that can safely be
  31. executed from inside the keyboard scanner.
  32. Status and result byte at address 0050:0000.
  33. -----------------------------------------------------------
  34. INT 5 - BOUND check failed (80286 internal interrupt)
  35. -----------------------------------------------------------
  36. INT 6 - Undefined Opcode (80286 internal interrupt)
  37. -----------------------------------------------------------
  38. INT 7 - No Math Unit Available (80286 protected-mode internal)
  39. -----------------------------------------------------------
  40. INT 8 thru 0F - Vectored Hardware Lines
  41. In IBM, these 8 interrupts are generated in
  42. response to IRQ 0 through IRQ 7 (if enabled via port 21).
  43.                                                 [Tandy 1000]
  44.         IRQ0    -       timer interrupt
  45.         IRQ1    -       keyboard interrupt
  46.         IRQ2    -       EGA vertical retrace    [fixed disk]
  47.         IRQ3    -       serial port 2 (com2:)
  48.         IRQ4    -       serial port 1 (com1:)
  49.         IRQ5    -       fixed disk              [60hz ram refresh]
  50.                         (LPT2 on PC/AT)
  51.         IRQ6    -       diskette interrupt
  52.         IRQ7    -       PPI interrupt (lpt1:, lpt2:)
  53. -----------------------------------------------------------
  54. INT 8 - Double Fault (80286 protected-mode internal)
  55. -----------------------------------------------------------
  56. INT 9 - Math Unit Protection Fault (80286 protected-mode internal)
  57. -----------------------------------------------------------
  58. INT 0A - Invalid Task State Segment (80286 protected-mode internal)
  59. -----------------------------------------------------------
  60. INT 0B - Not Present (80286 protected-mode internal)
  61. -----------------------------------------------------------
  62. INT 0C - Stack Fault (80286 protected-mode internal)
  63. -----------------------------------------------------------
  64. INT 0D - General Protection Violation (80286 protected-mode internal)
  65. -----------------------------------------------------------
  66. INT 0E - Page Fault (80386 native-mode internal)
  67. -----------------------------------------------------------
  68. INT 10 - VIDEO - SET VIDEO MODE
  69.         AH = 0
  70.         AL =
  71.                 0 = 40x25 B&W
  72.                 1 = 40x25 COLOR
  73.                 2 = 80x25 BW
  74.                 3 = 80x25 COLOR
  75.                 4 = 320x200 GRAPHICS, 4 COLOR
  76.                 5 = 320x200 GRAPHICS, 4 GREY
  77.                 6 = 640x200 GRAPHICS, B&W
  78.                 7 = MONOCHROME
  79.                 8 = 160x200 GRAPHICS, 16 COLOR (PCjr/Tandy 1000)
  80.                 9 = 320x200 GRAPHICS, 16 COLOR (PCjr/Tandy 1000)
  81.                 A = 640x200 GRAPHICS, 4 COLOR (PCjr/Tandy 1000)
  82.                 D = 320x200 graphics, 16 color (EGA)
  83.                 E = 640x200 graphics, 16 color (EGA)
  84.                 F = 640x350 graphics, monochrome (EGA)
  85.                10 = 640x350 graphics, 4 or 16 color (EGA)
  86. -----------------------------------------------------------
  87. INT 10 - VIDEO - SET CURSOR CHARACTERISTICS
  88.         AH = 1
  89.         CH =
  90.                 bits 5-6 = blink attribute
  91.                         (00=normal, 01=invis., 10 = slow, 11=fast)
  92.                 bits 0-4 = start line for cursor in char. cell
  93.         CL =
  94.                 bits 0-4 = end line for cursor in char. cell
  95. -----------------------------------------------------------
  96. INT 10 - VIDEO - SET CURSOR POSITION
  97.         AH = 2
  98.         DH,DL = ROW,COLUMN - 0,0 = UPPER LEFT
  99.         BH = PAGE NO. - 0 = GRAPHICS
  100. -----------------------------------------------------------
  101. INT 10 - VIDEO - READ CURSOR POSITION
  102.         AH = 3
  103.         BH = PAGE NO. - 0 = GRAPHICS
  104.         Return: DH,DL = ROW,COLUMN
  105.                 CH,CL = CURSOR MODE,CURRENT SET
  106. -----------------------------------------------------------
  107. INT 10 - VIDEO - READ LIGHT PEN POSITION
  108.         AH = 4
  109.         Return: AH = 0: light pen switch not activated
  110.                 AH = 1: light pen values in registers
  111.                 DH = row of current position
  112.                 DL = column of current position
  113.                 CH = raster line (0-199)
  114.                 BX = pixel column (0-319 or 0-639)
  115. -----------------------------------------------------------
  116. INT 10 - VIDEO - SELECT DISPLAY PAGE
  117.         AH = 5
  118.         AL =
  119.                 0 - 7: new page value for modes 0 & 1
  120.                 0 - 3: new page value for modes 2 & 3
  121.                 80H: read CRT/CPU page registers [PCjr]
  122.                 81H: set CPU page register to value in BL [PCjr]
  123.                 82H: set CRT page register to value in BH [PCjr]
  124.                 83H: set both display registers [PCjr]
  125.         Return: BH = CRT page register
  126.                 BL = CPU page register
  127. -----------------------------------------------------------
  128. INT 10 - VIDEO - SCROLL PAGE UP
  129.         AH = 6
  130.         AL = NO. OF LINES BLANKED AT BOTTOM OF PAGE
  131.                 0 = BLANK WINDOW
  132.         BH = ATTRIBUTES TO BE USED ON BLANK LINE
  133.         WINDOW:
  134.         CH,CL = UPPER LEFT CORNER
  135.         DH,DL = LOWER RIGHT CORNER
  136. -----------------------------------------------------------
  137. INT 10 - VIDEO - SCROLL PAGE DOWN
  138.         AH = 7
  139.         AL = NO. OF LINES BLANKED AT TOP OF PAGE
  140.                 0 = BLANK WINDOW
  141.         BH = ATTRIBUTES TO BE USED ON BLANK LINE
  142.         WINDOW:
  143.         CH,CL = UPPER LEFT CORNER
  144.         DH,DL = LOWER RIGHT CORNER
  145. -----------------------------------------------------------
  146. INT 10 - VIDEO - READ ATTRIBUTES/CHARACTER AT CURSOR POSITION
  147.         AH = 8
  148.         BH = DISPLAY PAGE
  149.         Return: AL = CHAR
  150.                 AH = ATTRIBUTE OF CHAR - ALPHA MODE
  151. -----------------------------------------------------------
  152. INT 10 - VIDEO - WRITE ATTRIBUTES/CHARACTERS AT CURSOR POS
  153.         AH = 9
  154.         AL = CHARACTER
  155.         BH = DISPLAY PAGE - ALPHA MODE
  156.         BL = attributes of char (alpha modes) or color (graphics modes)
  157.         CX = number of times to write character
  158. -----------------------------------------------------------
  159. INT 10 - VIDEO - WRITE CHARACTERS ONLY AT CURSOR POS
  160.         AH = 0AH
  161.         AL = CHARACTER
  162.         BH = DISPLAY PAGE - ALPHA MODE
  163.         BL = COLOR OF CHARACTER (GRAPHICS MODE)
  164.         CX = number of times to write character
  165. -----------------------------------------------------------
  166. INT 10 - SET COLOR PALETTE
  167.         AH = 0BH
  168.         BH = PALETTE COLOR ID
  169.         BL = COLOR TO BE USED W/COLOR ID
  170. -----------------------------------------------------------
  171. INT 10 - WRITE DOT ON SCREEN
  172.         AH = 0Ch
  173.         AL = color of dot (0/1 in mode 6, 0-3 in modes 4 and 5)
  174.              if bit 7 set, new color will be XORed with current pixel
  175.         DX = row (0 - 199)
  176.         CX = column (0 - 319 in modes 4/5, 0 - 639 in mode 6)
  177.         Note: video modes 4-6 only
  178. -----------------------------------------------------------
  179. INT 10 - READ DOT ON SCREEN
  180.         AH = 0Dh
  181.         CX = column (0 - 319 or 639)
  182.         DX = row (0 - 199)
  183.         Return: AL = COLOR READ
  184. -----------------------------------------------------------
  185. INT 10 - WRITE CHARACTER - ADVANCE CURSOR (TTY WRITE)
  186.         AH = 0EH
  187.         AL = character
  188.         BH = display page (alpha modes)
  189.         BL = foreground color (graphics modes)
  190. -----------------------------------------------------------
  191. INT 10 - GET CURRENT VIDEO MODE
  192.         AH = 0FH
  193.         Return: AH = # OF COLUMNS ON SCREEN
  194.                 AL = CURRENT VIDEO MODE
  195.                 BH = CURRENT ACTIVE DISPLAY PAGE
  196. -----------------------------------------------------------
  197. INT 10 - SET PALETTE REGISTERS (PCjr AND TANDY 1000)
  198.         AH = 10H
  199.         AL = 0: SET PALETTE REGISTER
  200.                 BL = PALETTE REGISTER TO SET
  201.                 BH = COLOR VALUE TO STORE
  202.         AL = 1: SET BORDER COLOR REGISTER
  203.                 BH = COLOR VALUE TO STORE
  204.         AL = 2: SET ALL PALETTE REGISTERS
  205.                 ES:DX = POINTER TO 17-BYTE LIST
  206.                         BYTES 0-15 = VALUES FOR PALETTE REGS. 0-15
  207.                         BYTE 16 = VALUE FOR BORDER REGISTER
  208. -----------------------------------------------------------
  209. INT 10 - WRITE STRING, DON'T MOVE CURSOR (PC/AT ONLY)
  210.         AH = 13H
  211.         AL = 0
  212.         BL = ATTRIBUTE
  213.         BH = DISPLAY PAGE NUMBER
  214.         DX = STARTING CURSOR POSITION
  215.         CX = LENGTH OF STRING
  216.         ES:BP = POINTER TO START OF STRING
  217. -----------------------------------------------------------
  218. INT 10 - WRITE STRING, MOVE CURSOR AFTER STRING (PC/AT ONLY)
  219.         AH = 13H
  220.         AL = 1
  221.         BL = ATTRIBUTE
  222.         BH = DISPLAY PAGE NUMBER
  223.         DX = STARTING CURSOR POSITION
  224.         CX = LENGTH OF STRING
  225.         ES:BP = POINTER TO START OF STRING
  226. -----------------------------------------------------------
  227. INT 10 - WRITE STRING OF ALTERNATING CHARACTERS, ATTRIBUTES;
  228.         DON'T MOVE CURSOR (PC/AT ONLY)
  229.         AH = 13H
  230.         AL = 2
  231.         BH = DISPLAY PAGE NUMBER
  232.         DX = STARTING CURSOR POSITION
  233.         CX = LENGTH OF STRING
  234.         ES:BP = POINTER TO START OF STRING
  235. -----------------------------------------------------------
  236. INT 10 - WRITE STRING OF ALTERNATING CHARACTERS, ATTRIBUTES;
  237.         MOVE CURSOR (PC/AT ONLY)
  238.         AH = 13H
  239.         AL = 3
  240.         BH = DISPLAY PAGE NUMBER
  241.         DX = STARTING CURSOR POSITION
  242.         CX = LENGTH OF STRING
  243.         ES:BP = POINTER TO START OF STRING
  244. -----------------------------------------------------------
  245. INT 10 - GET VIDEO RAM ADDRESS [TANDY 1000]
  246.         AH = 70H
  247.         Return: AX  = SEGMENT ADDRESS OF THE FOLLOWING
  248.                 [BX] = OFFSET ADDRESS OF GREEN PLANE
  249.                 [CX] = SEGMENT ADDRESS OF GREEN PLANE
  250.                 [DX] = SEGMENT ADDRESS OF RED/BLUE PLANE
  251.                 (RED OFFSET = 0, BLUE OFFSET = 4000)
  252. -----------------------------------------------------------
  253. INT 10 - GET INCRAM ADDRESSES [TANDY 1000]
  254.         AH = 71H
  255.         Return: AX  = SEGMENT ADDRESS OF THE FOLLOWING
  256.                 [BX] = SEGMENT ADDRESS OF INCRAM
  257.                 [CX] = OFFSET ADDRESS OF INCRAM
  258. -----------------------------------------------------------
  259. INT 10 - SCROLL SCREEN RIGHT [TANDY 1000]
  260.         AH = 72H
  261.         AL = NO. OF COLUMNS BLANKED AT LEFT OF PAGE
  262.                 0 = BLANK WINDOW
  263.         BH = ATTRIBUTES TO BE USED ON BLANK COLUMNS
  264.         WINDOW:
  265.         CH,CL = UPPER LEFT CORNER
  266.         DH,DL = LOWER RIGHT CORNER
  267. ----------------------------------------------------------
  268. INT 10 - SCROLL SCREEN LEFT [TANDY 1000]
  269.         AH = 73H
  270.         AL = NO. OF COLUMNS BLANKED AT RIGHT OF PAGE
  271.                 0 = BLANK WINDOW
  272.         BH = ATTRIBUTES TO BE USED ON BLANK COLUMNS
  273.         WINDOW:
  274.         CH,CL = UPPER LEFT CORNER
  275.         DH,DL = LOWER RIGHT CORNER
  276. -----------------------------------------------------------
  277. INT 10 - Get Video Buffer (TopView/DESQview/TaskView)
  278.         AH = FEh
  279.         ES:DI = segment:offset of assumed video buffer
  280.         Returns:
  281.                 ES:DI = segment:offset of actual video buffer
  282. -----------------------------------------------------------
  283. INT 10 - Update Video Buffer (TopView/DESQview/TaskView)
  284.         AH = FFh
  285.         CX = number of sequential characters that have been modified
  286.         DI = offset of first character that has been modified
  287.         ES = segment of video buffer
  288. -----------------------------------------------------------
  289. INT 11 - EQUIPMENT DETERMINATION
  290.         Return: AX = "equipment flag" bits
  291.                 0       diskette installed
  292.                 1       8087 present
  293.                 2,3     always = 11
  294.                 4,5     initial video mode
  295.                         01 = 40x25 COLOR
  296.                         10 = 80x25 COLOR
  297.                         11 = 80X25 IBM monochrome
  298.                 6,7     number of diskette drives (only if bit 0 = 1)
  299.                         00 = 1, 01 = 2
  300.                 8       0 = dma present, 1= no dma on system
  301.                 9,10,11 number of RS232 cards
  302.                 12      game I/O attached
  303.                 13      serial printer installed (IBM-PCjr)
  304.                 14,15   number of printers
  305. -----------------------------------------------------------
  306. INT 12 - MEMORY SIZE
  307.         Return: AX = NO. OF CONTIGUOUS 1K BLOCKS
  308. -----------------------------------------------------------
  309. INT 13 - RESET DISK SYSTEM
  310.         AH = 0
  311. -----------------------------------------------------------
  312. INT 13 - STATUS OF DISK SYSTEM
  313.         AH = 1
  314.         Return: AL = STATUS
  315.                 01H = BAD COMMAND
  316.                 02H = ADDRESS MARK NOT FOUND
  317.                 03H = WRITE ATTEMPTED ON WRITE-PROTECTED DISK
  318.                 04H = SECTOR NOT FOUND
  319.                 06H = DISKETTE REMOVED
  320.                 08H = DMA OVERRUN
  321.                 09H = DMA ACROSS 64K BOUNDARY
  322.                 10H = BAD CRC
  323.                 20H = CONTROLLER FAILURE
  324.                 40H = SEEK FAILED
  325.                 80H = TIME OUT
  326. -----------------------------------------------------------
  327. INT 13 - READ SECTORS INTO MEMORY
  328.         AH = 2
  329.         AL = NO. OF SECTORS
  330.         CH = TRACK NO.
  331.         CL = SECTOR NO.
  332.         DH = HEAD NO.
  333.         DL = DRIVE NO.
  334.         ES:BX = ADDRESS OF BUFFER
  335.         Return: CF = SUCCESS/FAILURE SIGNAL
  336.                 AH = STATUS (SEE AH = 01)
  337.                 AL = NUMBER OF SECTORS READ
  338. -----------------------------------------------------------
  339. INT 13 - WRITES SECTORS FROM MEMORY
  340.         AH = 3
  341.         AL = NO. OF SECTORS
  342.         CH = TRACK NO.
  343.         CL = SECTOR NO.
  344.         DH = HEAD NO.
  345.         DL = DRIVE NO.
  346.         ES:BX = ADDRESS OF BUFFER
  347.         Return: CF = SUCCESS/FAILURE SIGNAL
  348.                 AH = STATUS (SEE AH = 01)
  349.                 AL = NUMBER OF SECTORS WRITTEN
  350. -----------------------------------------------------------
  351. INT 13 - VERIFIES SECTORS
  352.         AH = 4
  353.         AL = NO. OF SECTORS
  354.         CH = TRACK NO.
  355.         CL = SECTOR NO.
  356.         DH = HEAD NO.
  357.         DL = DRIVE NO.
  358.         Return: CF = SUCCESS/FAILURE SIGNAL
  359.                 AH = STATUS (SEE AH = 01)
  360.                 AL = NUMBER OF SECTORS VERIFIED
  361. -----------------------------------------------------------
  362. INT 13 - FORMAT DISKETTE TRACK
  363.         AH = 5
  364.         AL = NUMBER OF SECTORS
  365.         CH = TRACK NUMBER
  366.         CL = SECTOR NUMBER
  367.         DH = HEAD NUMBER
  368.         DL = DRIVE NUMBER
  369.         ES:BX = POINTER TO 4-BYTE ADDRESS FIELD
  370.                 BYTE 1 = TRACK
  371.                 BYTE 2 = HEAD
  372.                 BYTE 3 = SECTOR
  373.                 BYTE 4 = BYTES/SECTOR
  374.         Return: CF = SUCCESS/FAILURE SIGNAL
  375.                 AH = STATUS CODE (SEE AH = 01)
  376. -----------------------------------------------------------
  377. INT 13 - GET CURRENT DRIVE PARAMETERS (PC/XT and PC/AT)
  378.         AH = 8
  379.         DL = DRIVE NUMBER
  380.         Return: CF = SUCCESS/FAILURE FLAG
  381.                 AH = STATUS CODE (SEE AH = 01)
  382.                 DL = NUMBER OF DRIVES (?)
  383.                 DH = MAX. NUMBER OF SIDES
  384.                 CL = MAX. NUMBER OF SECTORS
  385.                 CH = MAX. NUMBER OF TRACKS
  386. -----------------------------------------------------------
  387. INT 13 - INITIALIZE TWO FIXED DISK BASE TABLES (PC/AT ONLY)
  388.         AH = 9
  389.         Return: CF = SUCCESS/FAILURE FLAG
  390.                 AH = STATUS CODE (SEE ABOVE)
  391.                 INTERRUPT 41 POINTS TO TABLE FOR DRIVE 0
  392.                 INTERRUPT 46 POINTS TO TABLE FOR DRIVE 1
  393. -----------------------------------------------------------
  394. INT 13 - READ LONG (PC/AT ONLY)
  395.         AH = 0AH
  396.         DL = DRIVE ID
  397.         DH = HEAD NUMBER
  398.         CH = CYLINDER NUMBER
  399.         CL = SECTOR NUMBER
  400.         ES:BX = POINTER TO BUFFER
  401.         Return: CF = SUCCESS/FAILURE FLAG
  402.                 AH = STATUS CODE (SEE AH = 01)
  403. -----------------------------------------------------------
  404. INT 13 - WRITE LONG (PC/AT ONLY)
  405.         AH = 0BH
  406.         DL = DRIVE ID
  407.         DH = HEAD NUMBER
  408.         CH = SECTOR NUMBER
  409.         ES:BX = POINTER TO BUFFER
  410.         Return: CF = SUCCESS/FAILURE FLAG
  411.                 AH = STATUS CODE (SEE AH = 01)
  412. -----------------------------------------------------------
  413. INT 13 - SEEK TO CYLINDER (PC/XT and PC/AT)
  414.         AH = 0CH
  415.         DL = DRIVE ID
  416.         DH = HEAD NUMBER
  417.         CH = SECTOR NUMBER
  418.         Return: CF = SUCCESS/FAILURE FLAG
  419.                 AH = STATUS CODE (SEE AH = 01)
  420. -----------------------------------------------------------
  421. INT 13 - ATLERNATE DISK RESET (PC/XT and PC/AT)
  422.         AH = 0DH
  423.         DL = DRIVE ID
  424.         Return: CF = SUCCESS/FAIL FLAG
  425.                 AH = STATUS CODE (SEE AH = 01)
  426. -----------------------------------------------------------
  427. INT 13 - TEST FOR DRIVE READY (PC/AT ONLY)
  428.         AH = 10H
  429.         DL = DRIVE ID
  430.         Return: CF = SUCCESS/FAIL FLAG
  431.                 AH = STATUS CODE (SEE AH = 01)
  432. -----------------------------------------------------------
  433. INT 13 - RECALIBRATE DRIVE (PC/XT and PC/AT)
  434.         AH = 11H
  435.         DL = DRIVE ID
  436.         Return: CF = SUCCESS/FAIL FLAG
  437.                 AH = STATUS CODE (SEE AH = 01)
  438. -----------------------------------------------------------
  439. INT 13 - CONTROLLER DIAGNOSTICS (PC/AT ONLY)
  440.         AH = 14H
  441.         Return: CF = SUCCESS/FAIL FLAG
  442.                 AH = STATUS CODE (SEE AH = 01)
  443. -----------------------------------------------------------
  444. INT 13 - GET DISK TYPE (PC/AT ONLY)
  445.         AH = 15H
  446.         DL = DRIVE ID
  447.         Return: AH = DISK TYPE
  448.                 0 = DISK NOT THERE
  449.                 1 = DISKETTE, NO CHANGE DETECTION PRESENT
  450.                 2 = DISKETTE, CHANGE DETECTION PRESENT
  451.                 3 = FIXED DISK
  452.                 CX,DX = NUMBER OF 512-BYTE SECTORS WHEN AH = 3
  453. -----------------------------------------------------------
  454. INT 13 - CHANGE OF DISK STATUS (PC/AT ONLY)
  455.         AH = 16H
  456.         Return: DL = DRIVE THAT HAD DISK CHANGE
  457.                 AH = DISK CHANGE STATUS
  458.                 00 = NO DISK CHANGE
  459.                 01 = DISK CHANGED (6?)
  460. -----------------------------------------------------------
  461. INT 13 - SET DISK TYPE (PC/AT ONLY)
  462.         AH = 17H
  463.         AL = DISK TYPE
  464.         00 = NO DISK
  465.         01 = REGULAR DISK IN REGULAR DRIVE
  466.         02 = REGULAR DISK IN HIGH-CAP. DRIVE
  467.         03 = HIGH-CAP. DISK IN HIGH-CAP. DRIVE
  468.         DL = DRIVE ID
  469. -----------------------------------------------------------
  470. INT 14 - SERIAL I/O - INITIALIZE USART
  471.         AH = 0
  472.         AL = INITIALIZING PARAMETERS
  473.         7 - 6 - 5      4 - 3     2    1 - 0
  474.         -BAUD RATE-    PARITY   STOP   WORD
  475.                                 BITS  LENGTH
  476.         000  110 BD    00 NONE  0-1   10 - 7
  477.         001  150 BD    01 ODD   1-2   11 - 8
  478.         010  300 BD    11 EVEN
  479.         011  600 BD
  480.         100 1200 BD
  481.         101 2400 BD
  482.         110 4800 BD
  483.         111 9600 BD (4800 ON PCjr)
  484.         DX = PORT NUMBER
  485.         Return: AX port status--see below
  486. -----------------------------------------------------------
  487. INT 14 - SERIAL I/O - TRANSMIT CHARACTER
  488.         AH = 1
  489.         AL = CHARACTER
  490.         DX = PORT NUMBER
  491.         Return: AH = RS-232 STATUS CODE BITS
  492.                 0 = DATA READY
  493.                 1 = OVERRUN ERROR
  494.                 2 = PARITY ERROR
  495.                 3 = FRAMING ERROR
  496.                 4 = BREAK DETECTED
  497.                 5 = TRANSMISSION BUFFER REG. EMPTY
  498.                 6 = TRANSMISSION SHIFT REG. EMPTY
  499.                 7 = TIME OUT
  500.                 AL = MODEM STATUS BITS
  501.                 0 = DELTA CLEAR-TO-SEND
  502.                 1 = DELTA DATA-SET-READY
  503.                 2 = TRAILING EDGE RING DETECTED
  504.                 3 = CHANGE, RECEIVE LINE SIGNAL DETECTED
  505.                 4 = CLEAR-TO-SEND
  506.                 5 = DATA-SET-READY
  507.                 6 = RING DETECTED
  508.                 7 = RECEIVE LINE SIGNAL DETECTED
  509. -----------------------------------------------------------
  510. INT 14 - SERIAL I/O - RECEIVE CHARACTER
  511.         AH = 2
  512.         Return: AL = CHARACTER RECEIVED
  513.                 AH = RS-232 STATUS CODE (SEE ABOVE)
  514. -----------------------------------------------------------
  515. INT 14 - SERIAL I/O - GET USART STATUS
  516.         AH = 3
  517.         Return: AH = RS-232 STATUS CODE (SEE ABOVE)
  518.                 AL = MODEM STATUS CODE (SEE ABOVE)
  519. -----------------------------------------------------------
  520. INT 15 - TURN ON CASSETTE MOTOR
  521.         AH = 0
  522. -----------------------------------------------------------
  523. INT 15 - TURN OFF CASSETTE MOTOR
  524.         AH = 1
  525. -----------------------------------------------------------
  526. INT 15 - READ DATA BLOCKS FROM CASSETTE
  527.         AH = 2
  528.         CX = COUNT OF BYTES
  529.         ES:BX = POINTER TO DATA AREA
  530.         Return: CF = ERROR SIGNAL
  531.                 DX = COUNT OF BYTES READ
  532.                 ES:BX = POINTER PAST LAST BYTE READ
  533. -----------------------------------------------------------
  534. INT 15 - WRITE DATA BLOCKS TO CASSETTE
  535.         AH = 3
  536.         CX = COUNT OF BYTES TO WRITE
  537.         ES:BX = POINTER TO DATA AREA
  538.         Return: ES:BX = POINTER PAST LAST BYTE WRITTEN
  539. -----------------------------------------------------------
  540. INT 15 - DESQview/TopView/TaskView - Give up CPU time
  541.         AX = 1000h
  542.         Return: after other process(es) run
  543. -----------------------------------------------------------
  544. INT 15 - DESQview/TopView/TaskView - Get Version
  545.         AX = 1022h
  546.         BX = 0
  547.         Return: BX nonzero, TopView or compat loaded
  548.                 TaskView returns BX = 0001h
  549. -----------------------------------------------------------
  550. INT 15 - DESQview/TopView/TaskView command
  551.         AH = 11h
  552.         AL = various
  553. -----------------------------------------------------------
  554. INT 15 - DESQview/TopView/TaskView command
  555.         AH = 12h
  556.         AL = various
  557. -----------------------------------------------------------
  558. INT 15 - DEVICE OPEN (PC/AT ONLY)
  559.         AH = 80h
  560.         Return: BX = DEVICE ID
  561.                 CX = PROCESS TYPE
  562. -----------------------------------------------------------
  563. INT 15 - DEVICE CLOSE (PC/AT ONLY)
  564.         AH = 81h
  565.         Return: BX = DEVICE ID
  566.                 CX = PROCESS TYPE
  567. -----------------------------------------------------------
  568. INT 15 - DEVICE PROGRAM TERMINATE (PC/AT ONLY)
  569.         AH = 82h
  570.         Return: BX = DEVICE ID
  571. -----------------------------------------------------------
  572. INT 15 - EVENT WAIT (PC/AT ONLY)
  573.         AH = 83h
  574.         AL = SUBSERVICE
  575.         0 = SET INTERVAL
  576.         1 = CANCEL
  577.         ES:BX = POINTER TO CALLER'S MEMORY
  578.         CX,DX = number of microseconds to wait (only accurate to 977 us)
  579. -----------------------------------------------------------
  580. INT 15 - READ JOYSTICK SWITCH SETTINGS (PC/AT ONLY)
  581.         AH = 84h
  582.         DX = 0
  583.         Return: AL = SWITCH SETTINGS
  584. -----------------------------------------------------------
  585. INT 15 - READ JOYSTICK INPUTS (PC/AT ONLY)
  586.         AH = 84h
  587.         DX = 1
  588.         Return: AX = A(x) VALUE
  589.                 BX = A(y) VALUE
  590.                 CX = B(x) VALUE
  591.                 DX = B(y) VALUE
  592. -----------------------------------------------------------
  593. INT 15 - SYSTEM REQUEST KEY PRESS (PC/AT ONLY)
  594.         AH = 85h
  595.         Return: AL = 00 PRESS
  596.                 AL = 01 BREAK
  597. -----------------------------------------------------------
  598. INT 15 - WAIT (PC/AT ONLY)
  599.         AH = 86h
  600.         Return: CX,DX = number of microseconds to wait (only accurate to 977 us)
  601. -----------------------------------------------------------
  602. INT 15 - EXTENDED MEMORY - BLOCK MOVE   (PC/AT ONLY)
  603.         AH = 87h
  604.         CX = NUMBER OF WORDS TO MOVE
  605.         ES:SI = POINTER TO TABLE
  606. -----------------------------------------------------------
  607. INT 15 - EXTENDED MEMORY - GET MEMORY SIZE      (PC/AT ONLY)
  608.         AH = 88h
  609.         Return: AX = MEMORY SIZE
  610. -----------------------------------------------------------
  611. INT 15 - SWITCH TO VIRTUAL MODE (PC/AT ONLY)
  612.         AH = 89h
  613. -----------------------------------------------------------
  614. INT 15 - DEVICE BUSY LOOP (PC/AT ONLY)
  615.         AH = 90h
  616.         AL = TYPE CODE
  617. -----------------------------------------------------------
  618. INT 15 - SET FLAG AND COMPLETE INTERRUPT
  619.         AH = 91h
  620.         AL = TYPE CODE
  621. -----------------------------------------------------------
  622. INT 15 - GET SYSTEM CONFIGURATION (XT after 1/10/86, PC Conv, XT286, PS/2)
  623.         AH = C0h
  624.         Return: CF = 1 if BIOS doesn't support call
  625.                 ES:BX pointer to ROM table
  626.                    byte_count  dw   ?   ; number of bytes following
  627.                    model       db   ?   ; PC=ff, XT=fe or fb, PCjr = fd, etc, etc
  628.                    submodel    db   ?   ; distingushes between AT and XT/286, etc.
  629.                    BIOS_rev    db   ?   ; 0 for first release, 1 for 2nd, etc.
  630.                    featbyte    db   ?   ; 80h = DMA channel 3 used by hd BIOS,
  631.                                         ; 40h = 2nd 8259 installed,
  632.                                         ; 20h = Real-Time Clock installed,
  633.                                         ; 10h = INT 15h called upon INT 9h
  634.                                         ;  8h = wait for external event supported,
  635.                                         ;  4h = extended BIOS area allocated at 640K,
  636.                                         ;  2h = bus is Micro Channel instead of PC.
  637.                                         ;  1h   reserved
  638. -----------------------------------------------------------
  639. INT 16 - KEYBOARD I/O - READ CHAR FROM BUFFER - WAIT IF EMPTY
  640.         AH = 0
  641.         Return: AH = SCAN CODE
  642.                 AL = CHARACTER
  643. -----------------------------------------------------------
  644. INT 16 - KEYBOARD I/O - CHECK BUFFER - DO NOT CLEAR
  645.         AH = 1
  646.         Return: FLAG ZF = 0 = CHAR IN BUFFER
  647.                   AH = SCAN CODE
  648.                   AL = CHARACTER
  649.                 FLAG ZF = 1 = NO CHAR IN BUFFER
  650. -----------------------------------------------------------
  651. INT 16 - KEYBOARD I/O - GET SHIFT STATUS
  652.         AH = 2
  653.                 AL = SHIFT STATUS BITS
  654.                   0 = RIGHT SHIFT KEY DEPRESSED
  655.                   1 = LEFT SHIFT KEY DEPRESSED
  656.                   2 = CTRL DEPRESSED
  657.                   3 = ALT DEPRESSED
  658.                   4 = SCROLL LOCK ACTIVE
  659.                   5 = NUM LOCK ACTIVE
  660.                   6 = CAPS LOCK ACTIVE
  661.                   7 = INSERT STATE ACTIVE
  662. -----------------------------------------------------------
  663. INT 16 - KEYBOARD I/O - SET DELAYS (PCjr, AT, PS/2)
  664.         AH = 3
  665.         AL = 0: RESET TYPEMATIC (PCjr)
  666.         AL = 1: INCREASE INITIAL DELAY (PCjr)
  667.         AL = 2: INCREASE CONTINUING DELAY (PCjr)
  668.         AL = 3: INCREASE BOTH DELAYS (PCjr)
  669.         AL = 4: TURN OFF TYPEMATIC (PCjr)
  670.         AL = 5: Set typematic rate (AT or PS/2)
  671.           BH = 00 - 03 for delays of 250ms, 500ms, 750ms, or 1s
  672.           BL = 00 - 1F for typematic rates of 30cps down to 2cps
  673. -----------------------------------------------------------
  674. INT 16 - KEYBOARD I/O - KEYCLICK (PCjr ONLY)
  675.         AH = 4
  676.         AL = 0: CLICK OFF
  677.         AL = 1: CLICK ON
  678. -----------------------------------------------------------
  679. INT 16 - KEYBOARD - Write to keyboard buffer (AT or PS/2 with enhanced kbd)
  680.         AH = 5
  681.         CH = scan code
  682.         CL = character
  683. -----------------------------------------------------------
  684. INT 16 - KEYBOARD - Get enhanced keystroke (AT or PS/2 with enhanced kbd)
  685.         AH = 10h
  686.         Return: AH = scan code
  687.                 AL = character
  688. -----------------------------------------------------------
  689. INT 16 - KEYBOARD - Check enhanced keystroke (AT or PS/2 with enhanced kbd)
  690.         AH = 11h
  691.         Return: ZF = 0 if keystroke available
  692.                   AH = scan code \ meaningless if ZF = 1
  693.                   AL = character /
  694.                 ZF = 1 if kbd buffer empty
  695. -----------------------------------------------------------
  696. INT 16 - KEYBOARD - Get enhanced shift flags (AT or PS/2 with enhanced kbd)
  697.         AH = 12h
  698.         Return:
  699.                 AL (same as for AH=02)
  700.                   bit 7: Ins ON
  701.                   bit 6: CapsLock ON
  702.                   bit 5: NumLock ON
  703.                   bit 4: ScrollLock ON
  704.                   bit 3: Either ALT key down
  705.                   bit 2: Either CTRL key down
  706.                   bit 1: Left shift key down
  707.                   bit 0: Right shift key down
  708.                 AH
  709.                   bit 7: SysReq key down
  710.                   bit 6: CapsLock key down
  711.                   bit 5: NumLock key down
  712.                   bit 4: ScrollLock key down
  713.                   bit 3: Right Alt key down
  714.                   bit 2: Right Ctrl key down
  715.                   bit 1: Left Alt key down
  716.                   bit 0: Right Alt key down
  717. -----------------------------------------------------------
  718. INT 17 - CHARACTER TO PRINTER
  719.         AH = 0
  720.         AL = CHAR
  721.         Return: AH = STATUS BITS
  722.                   0 = TIME OUT
  723.                   1 = UNUSED
  724.                   2 = UNUSED
  725.                   3 = I/O ERROR
  726.                   4 = SELECTED
  727.                   5 = OUT OF PAPER
  728.                   6 = ACKNOWLEDGE
  729.                   7 = NOT BUSY
  730. -----------------------------------------------------------
  731. INT 17 - INITIALIZE PRINTER
  732.         AH = 1
  733.         Return: AH = STATUS (SEE ABOVE)
  734. -----------------------------------------------------------
  735. INT 17 - STATUS OF PRINTER
  736.         AH = 2
  737.         Return: AH = STATUS (SEE ABOVE)
  738. -----------------------------------------------------------
  739. INT 18 - TRANSFER TO ROM BASIC
  740. CAUSES TRANSFER TO ROM-BASED BASIC (IBM-PC)
  741. OFTEN REBOOTS A COMPATIBLE
  742. -----------------------------------------------------------
  743. INT 19 - DISK BOOT
  744. CAUSES REBOOT OF DISK SYSTEM (NO MEMORY TEST PERFORMED).
  745. -----------------------------------------------------------
  746. INT 1A - GET TIME OF DAY
  747.         AH = 0
  748.         Return: CX = high (most signif.) portion of clock count
  749.                 DX = low (least signif.) portion of clock count
  750.                 AL = 0 if clock was read or written (via AH=0,1)
  751.                 withing the current 24-hour period
  752.                 Otherwise, AL > 0
  753. -----------------------------------------------------------
  754. INT 1A - SET TIME OF DAY
  755.         AH = 1
  756.         CX = high (most signif.) portion of clock count
  757.         DX = low (least signif.) portion of clock count
  758. -----------------------------------------------------------
  759. INT 1A - READ REAL TIME CLOCK (PC/AT ONLY)
  760.         AH = 2
  761.         Return: CH = hours
  762.                 CL = minutes
  763.                 DH = seconds
  764. -----------------------------------------------------------
  765. INT 1A - SET REAL TIME CLOCK (PC/AT ONLY)
  766.         AH = 3
  767.         Return: CH = hours
  768.                 CL = minutes
  769.                 DH = seconds
  770.                 DL = 1, if daylight savings; 0 if standard time
  771. -----------------------------------------------------------
  772. INT 1A - READ DATE FROM REAL TIME CLOCK (PC/AT ONLY)
  773.         AH = 4
  774.         Return: DL = DAY
  775.                 DH = MONTH
  776.                 CL = YEAR
  777.                 CH = CENTURY (19 OR 20)
  778. -----------------------------------------------------------
  779. INT 1A - SET DATE IN REAL TIME CLOCK (PC/AT ONLY)
  780.         AH = 5
  781.         DL = DAY
  782.         DH = MONTH
  783.         CL = YEAR
  784.         CH = CENTURY (19 OR 20)
  785. -----------------------------------------------------------
  786. INT 1A - SET ALARM (PC/AT ONLY)
  787.         AH = 6
  788.         CH = HOURS
  789.         CL = MINUTES
  790.         DH = SECONDS
  791.         Return: INT 4Ah will be called when alarm goes off
  792. -----------------------------------------------------------
  793. INT 1A - RESET ALARM (PC/AT ONLY)
  794.         AH = 7
  795. -----------------------------------------------------------
  796. INT 1B - CTRL-BREAK KEY
  797. This interrupt is called when the keyboard scanner of
  798. the IBM machines detects CTRL and BREAK pressed at the same
  799. time. It normally points to a simple IRET so that it does
  800. nothing, but many programs change it to return a CTRL-C scan
  801. code and thus invoke INT 23.
  802. -----------------------------------------------------------
  803. INT 1C - CLOCK TICK
  804. This interrupt is called (in the IBM) at the end of
  805. each time-update operation by the real-time clock routines. It
  806. normally points to an IRET unless PRINT.COM has been installed.
  807. -----------------------------------------------------------
  808. INT 1D -> 6845 Video Init tables
  809.         table for modes 0 and 1   \
  810.         table for modes 2 and 3    \ each table is 16 bytes long
  811.         table for modes 4,5, and 6 /
  812.         table for mode 7          /
  813.         4 words -- size of video RAM for modes 0/1, 2/3, 4/5, and 6/7
  814.         8 bytes -- number of columns in each mode
  815.         8 bytes -- video controller mode byte for each mode
  816. -----------------------------------------------------------
  817. INT 1E -> Diskette Params (BASE TABLE)
  818. Default at f000:efc7
  819.         db      step rate & head unload times
  820.         db      head load time & DMA
  821.         db      motor off time
  822.         db      sector size (0->128, 1->256, 2->512, 3->1024)
  823.         db      last sector number (8 or 9 typical)
  824.         db      inter-sector gap size on read/write (42 typical)
  825.         db      data transfer length (255 typical)
  826.         db      inter-sector gap size on format (80 typical)
  827.         db      sector fill on format (f6 typical)
  828.         db      head-settle time ms (typical 25, 2.10->15)
  829.         db      motor start-up time (1/8 secs) (typical 4, 2.10->2)
  830. -----------------------------------------------------------
  831. INT 1F -> Pointer to Graphics Set 2--contains bitmaps for high 128 chars
  832. -----------------------------------------------------------
  833. INT 20 - PROGRAM TERMINATION
  834. RETURNS TO DOS
  835. -----------------------------------------------------------
  836. INT 21 - PROGRAM TERMINATION
  837.         AH = 00H
  838. Same action as INT 20; returns to DOS.
  839. -----------------------------------------------------------
  840. INT 21 - KEYBOARD INPUT
  841.         AH = 01H
  842.         Return: AL = CHARACTER READ
  843. -----------------------------------------------------------
  844. INT 21 - DISPLAY OUTPUT
  845.         AH = 02H
  846.         DL = CHAR
  847. -----------------------------------------------------------
  848. INT 21 - AUX Input
  849.         AH = 03H
  850.         Return: AL = CHARACTER READ
  851. -----------------------------------------------------------
  852. INT 21 - AUX Output
  853.         AH = 04H
  854.         DL = CHAR
  855. -----------------------------------------------------------
  856. INT 21 - PRINTER OUTPUT
  857.         AH = 05H
  858.         DL = CHAR
  859. -----------------------------------------------------------
  860. INT 21 - DIRECT CONSOLE I/O - CHARACTER OUTPUT
  861.         AH = 06H
  862.         DL = CHAR <> 0FFH
  863. -----------------------------------------------------------
  864. INT 21 - DIRECT CONSOLE I/O - CHARACTER INPUT
  865.         AH = 06H
  866.         DL = 0FFH
  867.         Return: FLAG ZF = SET    = NO CHARACTER
  868.                 CLEAR  = CHARACTER RECIEVED
  869.                 AL = CHARACTER
  870.                 Character is echoed to STDOUT if received.
  871. -----------------------------------------------------------
  872. INT 21 - Direct STDIN Input, no echo
  873.         Reg AH = 07H
  874. Same as Function 6 for input but char not echoed.
  875. -----------------------------------------------------------
  876. INT 21 - KEYBOARD INPUT - NO ECHO
  877.         AH = 08H
  878.         Return: AL = CHAR
  879. -----------------------------------------------------------
  880. INT 21 - PRINT STRING
  881.         AH = 09H
  882.         DS:DX  = ADDRESS OF STRING TERMINATED WITH "$"
  883. -----------------------------------------------------------
  884. INT 21 - BUFFERED KEYBOARD INPUT
  885.         AH = 0AH
  886.         DS:DX  = ADDRESS OF BUFFER
  887. FIRST BYTE OF BUFFER MUST HAVE MAX LENGTH
  888. ON RETURN SECOND BYTE HAS ACTUAL LENGTH
  889. -----------------------------------------------------------
  890. INT 21 - CHECK STANDARD INPUT STATUS
  891.         AH = 0BH
  892.         Return: AL =
  893.                 FFH IF CHAR TYPED
  894.                 00H IF NOT TYPED
  895. -----------------------------------------------------------
  896. INT 21 - Clear Keyboard Buffer
  897.         AH = 0CH
  898.         AL must be 1, 6, 7, 8, or 0aH.
  899.   Flushes all typeahead input, then executes function specified
  900. by AL (by moving it to AH and repeating the INT 21 call).
  901.   If AL contains a value not in the list above, the keyboard buffer is
  902. flushed and no other action is taken.
  903. -----------------------------------------------------------
  904. INT 21 - Disk Reset
  905.         Reg AH = 0DH
  906. Flushes all disk buffers.
  907. -----------------------------------------------------------
  908. INT 21 - SELECT DISK
  909.         AH = 0EH
  910.         DL = new default drive number (0 = A, 1 = B, etc.)
  911.         Return: AL = number of logical drives
  912. -----------------------------------------------------------
  913. INT 21 - OPEN DISK FILE
  914.         AH = 0FH
  915.         DS = SEGMENT ADDRESS OF FCB
  916.         DX = OFFSET ADDRESS OF FCB
  917.         Return: AL =
  918.                 00 = FILE FOUND
  919.                 FF = FILE NOT FOUND
  920. -----------------------------------------------------------
  921. INT 21 - CLOSE DISK FILE
  922.         AH = 10H
  923.         DS = SEGMENT ADDRESS OF FCB
  924.         DX = OFFSET ADDRESS OF FCB
  925. -----------------------------------------------------------
  926. INT 21 - Search First using FCB
  927.         AH = 11H
  928.         DS = SEGMENT ADDRESS OF FCB
  929.         DX = OFFSET ADDRESS OF FCB
  930.         Return: AL =
  931.                 00 = FILE FOUND
  932.                 FF = FILE NOT FOUND
  933. If file found, FCB is created at DTA address and
  934. set up to OPEN or DELETE it.
  935. -----------------------------------------------------------
  936. INT 21 - Search Next using FCB
  937.         AH = 12H
  938.         DS = SEGMENT ADDRESS OF FCB
  939.         DX = OFFSET ADDRESS OF FCB
  940.         Return: AL =
  941.                 00 = FILE FOUND
  942.                 FF = FILE NOT FOUND
  943. If file found, FCB is created at DTA address and
  944. set up to OPEN or DELETE it.
  945. -----------------------------------------------------------
  946. INT 21 - Delete File via FCB
  947.         AH = 13H
  948.         DS = SEGMENT ADDRESS OF FCB
  949.         DX = OFFSET ADDRESS OF FCB
  950.         Return: AL =
  951.                 00 = FILE FOUND
  952.                 FF = FILE NOT FOUND
  953. -----------------------------------------------------------
  954. INT 21 - SEQUENTIAL DISK FILE READ
  955.         AH = 14H
  956.         DS = SEGMENT ADDRESS OF FCB
  957.         DX = OFFSET ADDRESS OF FCB
  958.         Return: AL =
  959.                 0 = SUCCESSFUL READ
  960.                 1 = END OF FILE
  961.                 2 = DATA TRANSFER AREA TOO SMALL
  962.                 3 = PARTIAL RECORD, EOF
  963. -----------------------------------------------------------
  964. INT 21 - SEQUENTIAL DISK RECORD WRITE
  965.         AH = 15H
  966.         DS = SEGMENT ADDRESS OF FCB
  967.         DX = OFFSET ADDRESS OF FCB
  968.         Return: AL =
  969.                 0 = SUCCESSFUL WRITE
  970.                 1 = DISKETTE FULL
  971.                 2 = DATA TRANSFER AREA TOO SMALL
  972. -----------------------------------------------------------
  973. INT 21 - CREATE A DISK FILE
  974.         AH = 16H
  975.         DS = SEGMENT ADDRESS OF FCB
  976.         DX = OFFSET ADDRESS OF FCB
  977.         Return: AL =
  978.                 00 = SUCCESSFUL CREATION
  979.                 FF = NO ROOM IN DIRECTORY
  980. -----------------------------------------------------------
  981. INT 21 - Rename File via FCB
  982.         AH = 17H
  983.         DS = SEGMENT ADDRESS OF FCB
  984.         DX = OFFSET ADDRESS OF FCB
  985.         FCB contains new name starting at byte 17H.
  986.         Return: AL =
  987.                 00 = FILE FOUND
  988.                 FF = FILE NOT FOUND
  989. -----------------------------------------------------------
  990. INT 21 - Internal - does nothing
  991.         AH = 18h
  992.         Return: AL = 0
  993. -----------------------------------------------------------
  994. INT 21 - Default Disk Number
  995.         AH = 19h
  996.         Return: AL = current drive number (letter - 'A')
  997. -----------------------------------------------------------
  998. INT 21 - SET DISK TRANSFER AREA ADDRESS
  999.         AH = 1AH
  1000.         DS = SEGMENT ADDRESS OF BUFFER
  1001.         DX = OFFSET ADDRESS OF BUFFER
  1002. -----------------------------------------------------------
  1003. INT 21 - Default Drive Disk Size
  1004.         AH = 1BH
  1005.         Return: DS:BX points to FAT ID byte
  1006.                 DX = number of allocation units on disk
  1007.                 AL = number of sectors per AU
  1008.                 CX = number of bytes per sector
  1009. -----------------------------------------------------------
  1010. INT 21 - Specific Drive's Disk Size
  1011.         AH = 1CH
  1012.         DL = Drive Number to check
  1013.         Return: DS:BX points to FAT ID byte
  1014.                 DX = number of allocation units on disk
  1015.                 AL = number of sectors per AU
  1016.                 CX = number of bytes per sector
  1017. -----------------------------------------------------------
  1018. INT 21 - Internal - does nothing
  1019.         AH = 1Dh
  1020.         Return: AL = 0
  1021. -----------------------------------------------------------~r
  1022. INT 21 - Internal - does nothing
  1023.         AH = 1Eh
  1024.         Return: AL = 0
  1025. -----------------------------------------------------------
  1026. INT 21 - Internal - GET DEFAULT DRIVE PARAMETER BLOCK
  1027.         AH = 1Fh
  1028.         Return: AL = 00h No Error
  1029.                      FFh Error
  1030.                 (DS:BX) = ADDRESS OF DRIVE PARAMETER BLOCK.
  1031. (For DOS 2.x and 3.x, this just invokes function 32h with DL = 0)
  1032. -----------------------------------------------------------
  1033. INT 21 - Internal - does nothing
  1034.         AH = 20h
  1035.         Return: AL = 0
  1036. -----------------------------------------------------------
  1037. INT 21 - RANDOM DISK RECORD READ
  1038.         AH = 21H
  1039.         DS = SEGMENT ADDRESS OF FCB
  1040.         DX = OFFSET ADDRESS OF FCB
  1041.         Return: AL =
  1042.                 0 = SUCCESSFUL READ
  1043.                 1 = END OF FILE
  1044.                 2 = DATA TRANSFER AREA TOO SMALL
  1045.                 3 = PARTIAL RECORD, EOF
  1046. -----------------------------------------------------------
  1047. INT 21 - Random Disk Write
  1048.         AH = 22H
  1049. Same setup as Random Read, but writes to disk
  1050. -----------------------------------------------------------
  1051. INT 21 - FILE SIZE
  1052.         AH = 23H
  1053.         DS = SEGMENT ADDRESS OF FCB
  1054.         DX = OFFSET ADDRESS OF FCB
  1055.         Return: AL =
  1056.                 00 = FILE FOUND
  1057.                 FF = FILE NOT FOUND
  1058. FCB SET TO NO. OF RECORDS
  1059. -----------------------------------------------------------
  1060. INT 21 - Set Random Record Field
  1061.         AH = 24H
  1062.         DS = SEGMENT ADDRESS OF FCB
  1063.         DX = OFFSET ADDRESS OF FCB
  1064. FCB must be OPEN already
  1065.         Return: Random Record Field of FCB is set to be
  1066.                 same as Current Block and Current Record.
  1067. -----------------------------------------------------------
  1068. INT 21 - Set Interrupt Vector
  1069.         AH = 25H
  1070.         AL = INT number
  1071.         DS:DX = new vector to be used for specified INT
  1072. -----------------------------------------------------------
  1073. INT 21 - Create PSP
  1074.         AH = 26H
  1075.         DX = Segment number to set up PSP at
  1076. Current PSP is copied to specified segment
  1077. -----------------------------------------------------------
  1078. INT 21 - RANDOM BLOCK READ
  1079.         AH = 27H
  1080.         DS = SEGMENT ADDRESS OF FCB
  1081.         DX = OFFSET ADDRESS OF FCB
  1082.         CX = NO. OF RECORDS TO BE READ
  1083.         Return: AL =
  1084.                 0 = SUCCESSFUL READ
  1085.                 1 = END OF FILE
  1086.                 2 = DATA TRANSFER AREA TOO SMALL
  1087.                 3 = PARTIAL RECORD, EOF
  1088. -----------------------------------------------------------
  1089. INT 21 - RANDOM BLOCK WRITE
  1090.         AH = 28H
  1091.         DS = SEGMENT ADDRESS OF FCB
  1092.         DX = OFFSET ADDRESS OF FCB
  1093.         CX = NO. OF RECORDS TO BE WRITTEN
  1094.         Return: AL =
  1095.                 0 = SUCCESSFUL WRITE
  1096.                 1 = DISKETTE FULL
  1097.                 2 = DATA TRANSFER AREA TOO SMALL
  1098. -----------------------------------------------------------
  1099. INT 21 - Parse Filename
  1100.         AH = 29h
  1101.         DS:SI = pointer to string to parse
  1102.         ES:DI = pointer to memory to fill with unopened FCB
  1103.         AL = bit mask to control parsing
  1104.             0 = 0: parsing stops if file separator found
  1105.                 1: leading separator ignored
  1106.             1 = 0: drive number in FCB set to default drive if not present
  1107.                    in string
  1108.                 1: drive number in FCB not changed
  1109.             2 = 0: filename in FCB set to blanks if no filename in string
  1110.                 1: filename in FCB not changed if string does not contain
  1111.                    a filename
  1112.             3 = 0: extension in FCB set to blanks if no extension in string
  1113.                 1: extension left unchanged
  1114.         Return: AL = 00: no wildcards in name or extension
  1115.                      01: wildcards appeared
  1116.                 DS:SI = pointer to first byte after parsed string
  1117.                 ES:DI = unopened FCB
  1118. -----------------------------------------------------------
  1119. INT 21 - GET CURRENT DATE
  1120.         AH = 2AH
  1121.         Return: DL = DAY
  1122.                 DH = MONTH
  1123.                 CX = YEAR
  1124.                 AL = DAY OF THE WEEK (0=SUNDAY, 1=MONDAY, ETC.)
  1125. -----------------------------------------------------------
  1126. INT 21 - Set CURRENT DATE
  1127.         AH = 2Bh
  1128.         DL = day
  1129.         DH = month
  1130.         CX = year
  1131.         Return: AL = 0 if no error
  1132.                 AL = 0FFh if bad value sent to routine
  1133.         (DOS 3.3 also sets CMOS clock)
  1134.         (DESQview also accepts CX = 4445h and DX = 5351h, i.e. 'DESQ' as valid)
  1135. -----------------------------------------------------------
  1136. INT 21 - GET CURRENT TIME
  1137.         AH = 2CH
  1138.         Return: CH = HOURS
  1139.                 CL = MINUTES
  1140.                 DH = SEC
  1141.                 DL = SEC/100
  1142. NOTE: TIME IS UPDATED EVERY 5/100 SECOND
  1143. -----------------------------------------------------------
  1144. INT 21 - Set CURRENT TIME
  1145.         AH = 2DH
  1146.         CH = HOURS
  1147.         CL = MINUTES
  1148.         DH = SEC
  1149.         DL = SEC/100
  1150.         Return: AL = 0 if no error
  1151.                 AL = 0ffH if bad value sent to routine
  1152.         (DOS 3.3 also sets CMOS clock)
  1153. -----------------------------------------------------------
  1154. INT 21 - Set Verify Flag
  1155.         AH = 2EH
  1156.         DL = 0
  1157.         AL = 1 if VERIFY on
  1158.         AL = 0 if VERIFY off
  1159. -----------------------------------------------------------
  1160. INT 21 - Get Disk Transfer Area Address
  1161.         AH = 2FH
  1162.         Return: ES = SEGMENT address of DTA
  1163.                 BX = OFFSET address of DTA
  1164. -----------------------------------------------------------
  1165. INT 21 - Get DOS Version
  1166.         AH = 30H
  1167.         Return: AL = Major Version number
  1168.                 AH = Minor Version number
  1169.                 BH = OEM number
  1170.                 BL:CX = 24-bit user number
  1171. -----------------------------------------------------------
  1172. INT 21 - TERMINATE BUT STAY RESIDENT
  1173.         AH = 31H
  1174.         AL = EXIT CODE
  1175.         DX = PROGRAM SIZE, IN PARAGRAPHS
  1176. -----------------------------------------------------------
  1177. INT 21 - Internal - GET DRIVE PARAMETER BLOCK
  1178.         AH = 32H
  1179.         DL = DRIVE NUMBER
  1180.         0 = DEFAULT, 1 = A, ETC.
  1181.         Return: AL = 0FFH IF INVALID DRIVE NUMBER, ELSE
  1182.                 DS:BX = ADDRESS OF DRIVE PARAMETER BLOCK.
  1183.  
  1184.                 STRUCTURE OF DOS DRIVE PARAMETER BLOCK:
  1185.  
  1186. DPBLOCK         STRUCT          ;OFFSET
  1187. DISK_OFFSET     DB      ?       ;  0.  DRIVE NUMBER (0 = A, ETC.)
  1188. UNIT_OFFSET     DB      ?       ;  1.  UNIT NUMBER WITHIN DEVICE DRIVER
  1189. SECTOR_SIZE     DW      ?       ;  2.  NUMBER OF BYTES PER SECTOR
  1190. MAX_CLUSTER     DB      ?       ;  4.  LARGEST SECTOR NUMBER IN CLUSTER
  1191.                                 ;      ADD ONE FOR NUMBER OF SECTORS/CLUSTER
  1192. LOG2_SECTORS    DB      ?       ;  5.  LOG BASE TWO OF THE CLUSTER SIZE
  1193. RESERVED        DW      ?       ;  6.  NUMBER OF RESERVED (BOOT) SECTORS
  1194. FAT_COUNT       DB      ?       ;  8.  NUMBER OF COPIES OF THE FAT
  1195. ROOT_COUNT      DW      ?       ;  9.  NUMBER OF ROOT DIRECTORY ENTRIES
  1196. DATA_START      DW      ?       ; 11.  FIRST SECTOR OF DATA ON MEDIUM
  1197. MAX_NUMBER      DW      ?       ; 13.  LARGEST POSSIBLE CLUSTER NUMBER
  1198.                                 ;      SUBTRACT ONE FOR NUMBER OF CLUSTERS
  1199. FAT_SECTORS     DB      ?       ; 15.  NUMBER OF SECTORS IN ONE FAT COPY
  1200. ROOT_START      DW      ?       ; 16.  FIRST SECTOR OF ROOT DIRECTORY
  1201. DEVICE_ADDR     DD      ?       ; 18.  CORRESPONDING DEVICE DRIVER ADDRESS
  1202. DESCRIPTOR      DB      ?       ; 22.  MEDIA DESCRIPTOR BYTE FOR MEDIUM
  1203. VALID_BYTE      DB      ?       ; 23.  0FFH INDICATES BLOCK MUST BE REBUILT
  1204. NEXT_BLOCK      DD      ?       ; 24.  ADDRESS OF NEXT DEVICE BLOCK IN LIST
  1205.  
  1206. ;       FROM THIS POINT ON, DOS 3 DIFFERS FROM 2:
  1207.  
  1208.                 IF      DOS2
  1209. DIR_START       DW      ?       ; 28.  STARTING CLUSTER OF CURRENT DIRECTORY
  1210.                                 ;      ZERO INDICATES THE ROOT DIRECTORY
  1211. PATH_NAME       DB      64 DUP (?)
  1212.                                 ; 30.  ASCIIZ CURRENT DIRECTORY PATH STRING
  1213.                 ELSE    DOS3
  1214. ;               ON MY XT, THIS WAS ALWAYS:
  1215.                 DW      0
  1216.                 DW      0FFFFH
  1217.                 ENDIF
  1218. DPBLOCK         ENDS
  1219. -----------------------------------------------------------
  1220. INT 21 - Get or Set CONTROL-BREAK
  1221.         AH = 33H
  1222.         AL = 0 for Get or 1 for Put
  1223.         DL = 0 for OFF or 1 for ON
  1224.         Return: DL = 0 if BREAK=OFF or 1 if BREAK=ON
  1225.                 AL = FFH IF ERROR
  1226. -----------------------------------------------------------
  1227. INT 21 - Internal - Return CritSectFlag Pointer
  1228.         AH = 34H
  1229.         Return: ES:BX points to DOS "Critical Section Flag"
  1230.  
  1231. When byte pointed to is zero, DOS is supposed to be
  1232. safe to interrupt. NOT RELIABLE according to Chris Dunford.
  1233. Examination of DOS 2.10 code in this area
  1234. indicates that the byte immediately FOLLOWING this
  1235. "Critical Section Flag" must be 00 to permit the
  1236. PRINT.COM interrupt to be called. This suggests that
  1237. checking the WORD pointed to, rather than the BYTE,
  1238. might increase reliability of the test greatly.
  1239. -----------------------------------------------------------
  1240. INT 21 - Get Interrupt Vector
  1241.         AH = 35H
  1242.         AL = INT number
  1243.         Return: ES = Segment address of INT vector
  1244.                 BX = Offset address of INT vector
  1245. -----------------------------------------------------------
  1246. INT 21 - DISK SPACE
  1247.         AH = 36H
  1248.         DL = DRIVE NUMBER (1-4)
  1249.         Return: AX = ? (SIDES)
  1250.                 BX = ? (BLOCKS FREE)
  1251.                 CX = ? (BLOCK SIZE)
  1252.                 DX = ? (TOTAL BLOCKS)
  1253. NOTE: MULT AX x CX x BX for FREE SPACE ON DISK
  1254. MULT AX x CX x DX for TOTAL DISK SPACE
  1255. -----------------------------------------------------------
  1256. INT 21 - Internal - switchar/availdev
  1257.         AH = 37H
  1258.         AL =
  1259.         0 Read switch character (returns current character in DL)
  1260.         1 Set switch character (specify new character in DL)
  1261.         2 Read device availability (as set by function AL=3)
  1262.         3 Set device availability, where:
  1263.         DL = 0 means /DEV/ must preceed device names
  1264.         DL <> 0 means /DEV/ need not preceed device names
  1265.         Return: DL = Switch character (if AL=0 or 1)
  1266.                 Device availability flag (if AL=2 or 3)
  1267.                 AL=0FFh means the value in AL was not in the range 0-3.
  1268. Functions 2 & 3 appear not to be implemented for DOS 3.x
  1269. -----------------------------------------------------------
  1270. INT 21 - Get Country-Dependent Information
  1271.         AH = 38h
  1272.   DOS 2.x
  1273.         AL = 0  get current-country info
  1274.         DS:DX = segment:offset of buffer for returned info
  1275.         Return:
  1276.         BX = country code
  1277.         buffer at DS:DX filled as follows:
  1278.            bytes 0-1 = date format   0 = USA    mm dd yy
  1279.                                      1 = Europe dd mm yy
  1280.                                      2 = Japan  yy mm dd
  1281.            byte 2    = currency symbol
  1282.            byte 3    = 00h
  1283.            byte 4    = thousands separator char
  1284.            byte 5    = 00h
  1285.            byte 6    = decimal separator char
  1286.            byte 7    = 00h
  1287.            bytes 8-1Fh reserved
  1288.  
  1289.   DOS 3.x
  1290.         AL = 0 for current country
  1291.         AL = 01h thru 0FEh for specific country with code <255
  1292.         AL = 0FFh for specific country with code >= 255
  1293.            BX = 16-bit country code
  1294.         DS:DX = segment:offset of buffer for returned info
  1295.         DX = 0FFFFh if setting country code, rather than getting info
  1296.         Return: (if DX <> 0FFFFh)
  1297.            BX = country code
  1298.            DS:DX filled in:
  1299.               bytes 0-1 = date format (see above)
  1300.               bytes 2-6 = currency symbol string, ASCIZ
  1301.               byte 7    = thousands seaprator char
  1302.               byte 8    = 00h
  1303.               byte 9    = decimal separator char
  1304.               byte 0Ah  = 00h
  1305.               byte 0Bh  = date separator char
  1306.               byte 0Ch  = 00h
  1307.               byte 0Dh  = time separator char
  1308.               byte 0Eh  = 00h
  1309.               byte 0Fh  = currency format
  1310.                            bit 1 = number of spaces between value and curr sym
  1311.                            bit 0 = 0 if currency symbol precedes value
  1312.                                    1 if currency symbol follows value
  1313.               byte 10h  = number of digits after decimal in currency
  1314.               byte 11h  = time format
  1315.                            bit 0 = 0 if 12-hour clock
  1316.                                    1 if 24-hour clock
  1317.               bytes 12h-15h = address of case map routine (FAR CALL)
  1318.               byte 16h  = data-list separator char
  1319.               byte 17h  = 00h
  1320.               bytes 18h-21h reserved
  1321.          If error:
  1322.            CF set
  1323.            AX = error code
  1324. -----------------------------------------------------------
  1325. INT 21 - CREATE A SUBDIRECTORY (MKDIR)
  1326.         AH = 39H
  1327.         DS = SEGMENT address of ASCIIZ pathname
  1328.         DX = OFFSET address of ASCIIZ pathname
  1329.         Return: Flag CF = 1 if error
  1330.                 AX = Error Code if any
  1331. -----------------------------------------------------------
  1332. INT 21 - REMOVE A DIRECTORY ENTRY (RMDIR)
  1333.         AH = 3AH
  1334.         DS = SEGMENT address of ASCIIZ pathname
  1335.         DX = OFFSET address of ASCIIZ pathname
  1336.         Return: Flag CF = 1 if error
  1337.                 AX = Error Code if any
  1338. -----------------------------------------------------------
  1339. INT 21 - CHANGE THE CURRENT DIRECTORY (CHDIR)
  1340.         AH = 3BH
  1341.         DS = SEGMENT address of ASCIIZ
  1342.         DX = OFFSET address of ASCIIZ
  1343.         Return: Flag CF = 1 if error
  1344.                 AX = Error Code if any
  1345. -----------------------------------------------------------
  1346. INT 21 - CREATE A FILE WITH HANDLE (CREAT)
  1347.         AH = 3CH
  1348.         CX = ATTRIBUTES FOR FILE
  1349.         DS = SEGMENT ADDRESS OF ASCIIZ
  1350.         DX = OFFSET ADDRESS OF ASCIIZ
  1351.         Return: Flag CF = 1 if error
  1352.                 AX = File Handle or Error Code
  1353. -----------------------------------------------------------
  1354. INT 21 - OPEN DISK FILE WITH HANDLE
  1355.         AH = 3DH
  1356.         AL = ACCESS CODE
  1357.                 0 = Read Only
  1358.                 1 = Write Only
  1359.                 2 = Read/Write
  1360.                 Options (3.x):
  1361.                         80H = no inheritance
  1362.                         10H = deny read/write
  1363.                         20H = deny write
  1364.                         30H = deny read
  1365.                         40H = deny none
  1366.         DS = SEGMENT ADDRESS OF ASCIIZ
  1367.         DX = OFFSET ADDRESS OF ASCIIZ
  1368.         Return: Flag CF = 1 if error
  1369.                 AX = File Handle or Error Code
  1370. -----------------------------------------------------------
  1371. INT 21 - CLOSE A FILE WITH HANDLE
  1372.         AH = 3EH
  1373.         BX = FILE HANDLE
  1374.         Return: Flag CF = 1 if error
  1375.                 AX = Error Code if any
  1376. -----------------------------------------------------------
  1377. INT 21 - READ FROM FILE WITH HANDLE
  1378.         AH = 3FH
  1379.         BX = FILE HANDLE
  1380.         CX = NO. OF BYTES TO READ
  1381.         DS = SEGMENT ADDRESS OF BUFFER
  1382.         DX = OFFSET ADDRESS OF BUFFER
  1383.         Return: Flag CF = 1 if error
  1384.                 AX = Bytes Read or Error Code
  1385. -----------------------------------------------------------
  1386. INT 21 - WRITE TO FILE WITH HANDLE
  1387.         AH = 40H
  1388.         BX = FILE HANDLE
  1389.         CX = NO. OF BYTES TO Write
  1390.         DS = SEGMENT ADDRESS OF BUFFER
  1391.         DX = OFFSET ADDRESS OF BUFFER
  1392.         Return: Flag CF = 1 if error
  1393.                 AX = Bytes Read or Error Code
  1394. -----------------------------------------------------------
  1395. INT 21 - DELETE A FILE (UNLINK)
  1396.         AH = 41H
  1397.         DS = SEGMENT OF ASCIIZ TO DELETE
  1398.         DX = OFFSET OF ASCIIZ TO DELETE
  1399.         Return: Flag CF = 1 if error
  1400.                 AX = Error Code if any
  1401. -----------------------------------------------------------
  1402. INT 21 - MOVE FILE READ/WRITE POINTER (LSEEK)
  1403.         AH = 42H
  1404.         AL = METHOD VALUE
  1405.                 0 = offset from beginning of file
  1406.                 1 = offset from present location
  1407.                 2 = offset from end of file
  1408.         BX = FILE HANDLE
  1409.         CX = BYTES OFFSET HIGH
  1410.         DX = BYTES OFFSET LOW
  1411.         Return: Flag CF = 1 if error
  1412.                 AX = Offset low word or Error Code
  1413.                 DX = Offset high word
  1414. -----------------------------------------------------------
  1415. INT 21 - GET/PUT FILE ATTRIBUTES (CHMOD)
  1416.         AH = 43H
  1417.         AL =
  1418.         0 = GET FILE ATTRIBUTES
  1419.         1 = PUT FILE ATTRIBUTES
  1420.         CX = FILE ATTRIBUTES BITS ON PUT
  1421.         0 = READ ONLY
  1422.         1 = HIDDEN FILE
  1423.         2 = SYSTEM FILE
  1424.         3 = VOLUME LABEL
  1425.         4 = SUBDIRECTORY
  1426.         5 = WRITTEN SINCE BACKUP
  1427.         DX = POINTER TO FILE ASCIIZ FILE NAME
  1428.         Return: Flag CF = 1 if error
  1429.                 AX = Error Code if any
  1430.                 CX = FILE ATTRIBUTES ON GET
  1431. -----------------------------------------------------------
  1432. INT 21 - IOCTL
  1433.         AH = 44H
  1434.         AL =
  1435.         0 = Get device information (DX)
  1436.         1 = Set device information (DL, DH = 0)
  1437.                 DX BITS =
  1438.                 0 = console input device
  1439.                 1 = console output device
  1440.                 2 = null device
  1441.                 3 = clock device
  1442.                 5 = binary mode
  1443.                 6 = EOF
  1444.                 7 = is device
  1445.                         if not, EOF = 0 if channel has been written
  1446.                         bits 0-5 are block device number
  1447.                 12= network device
  1448.                 14= can process control strings (AL=2-5)
  1449.  
  1450.         2 = Read CX bytes to DS:DX from BX control chan
  1451.         3 = Write CX bytes from DS:DX from BX control chan
  1452.         4 = as 2 but for drive BL
  1453.         5 = as 3 but for drive BL
  1454.                 AX = number of bytes transfered
  1455.  
  1456.         6 = Get input status
  1457.         7 = Get output status
  1458.                 AX = FFH for ready or 00H for not ready
  1459.  
  1460.         8 = Is block device BL changeable? (DOS 3)
  1461.                 AX = 0 = yes
  1462.         9 = Is logical device BL local? (DOS 3)
  1463.                 DX (attribute word) bit 12 (1000H) = 0 = yes
  1464.         10= Is handle BX local? (DOS 3)
  1465.                 DX (attribute word) bit 15 (8000H) = 0 = yes
  1466.         11= Change sharing retry count to DX (def 3), (DOS 3)
  1467.                 delay CX (def 1)
  1468.         12= General IOCTL (DOS 3.3 [3.2?])
  1469.         BX = file handle (or BL = drive number w/0 = default)
  1470.         Return: Flag CF = 1 if error
  1471.                 AX = Error Code if any
  1472. -----------------------------------------------------------
  1473. INT 21 - Create Duplicate Handle (DUP)
  1474.         AH = 45H
  1475.         BX = file handle to duplicate
  1476.         Return: Flag CF = 1 if error
  1477.                 AX = File handle or Error Code
  1478. -----------------------------------------------------------
  1479. INT 21 - Force Duplicate Handle (FORCDUP) (DUP2)
  1480.         AH = 46H
  1481.         BX = Existing file handle
  1482.         CX = new file handle
  1483.         Return: Flag CF = 1 if error
  1484.                 AX = File handle or Error Code
  1485. -----------------------------------------------------------
  1486. INT 21 - Get Current Directory
  1487.         AH = 47H
  1488.         DL = drive (0=default, 1=A, etc.)
  1489.         DS:SI points to 64-byte buffer area
  1490.         Return: Flag CF = 1 if error
  1491.                 AX = Error Code if any
  1492. -----------------------------------------------------------
  1493. INT 21 - Allocate Memory
  1494.         AH = 48H
  1495.         BX = number of 16-byte paragraphs desired
  1496.         Return: Flag CF = 1 if error
  1497.                 AX = Segment of allocated memory or Error Code
  1498.                 BX = Maximum available on error
  1499. -----------------------------------------------------------
  1500. INT 21 - Free Memory
  1501.         AH = 49H
  1502.         ES = Segment address of area to be freed
  1503.         Return: Flag CF = 1 if error
  1504.                 AX = Error Code if any
  1505. -----------------------------------------------------------
  1506. INT 21 - Adjust Block Size (SETBLOCK)
  1507.         AH = 4AH
  1508.         ES = Segment address of block to change
  1509.         BX = New size in paragraphs
  1510.         Return: Flag CF = 1 if error
  1511.                 AX = Error Code if any
  1512.                 BX = Maximum available on error
  1513. -----------------------------------------------------------
  1514. INT 21 - Load or Execute (EXEC)
  1515.         AH = 4BH
  1516.         AL =
  1517.                 0 = load and execute program
  1518.                 2 = load (Internal) but do not execute
  1519.                 3 = load overlay; do not create PSP
  1520.         DS:DX = filename
  1521.         ES:BX = parameter block
  1522.                 AL =
  1523.                 0 =>    word segment environment pointer
  1524.                         dword command line pointer
  1525.                         dword FCB 1
  1526.                         dword FCB 2
  1527.                 3 =>    word segment load address
  1528.                         word segment relocation factor
  1529.         Return: Flag CF = 1 if error
  1530.                 AX = Error Code if any
  1531.  
  1532. struct exec {
  1533.         unsigned exec_magic;    /* 0x4d, 0x5a signature */
  1534.         unsigned exec_isr;      /* image size remainder (mod 512) */
  1535.         unsigned exec_size;     /* file size in pages (512) */
  1536.         unsigned exec_nrel;     /* number of relocation items */
  1537.         unsigned exec_hsize;    /* header size in paragraphs */
  1538.         unsigned exec_min;      /* minimum extra paragraphs */
  1539.         unsigned exec_max;      /* maximum extra paragraphs */
  1540.         unsigned exec_ss;       /* stack segment */
  1541.         unsigned exec_sp;       /* stack offset */
  1542.         unsigned exec_cksum;    /* word checksum of entire file */
  1543.         unsigned exec_pc;       /* initial pc */
  1544.         unsigned exec_cs;       /* code segment */
  1545.         unsigned exec_orel;     /* offset of relocation table */
  1546.         unsigned exec_ovno;     /* overlay number */
  1547. };
  1548. -----------------------------------------------------------
  1549. INT 21 - Quit With Exit Code (EXIT)
  1550.         AH = 4CH
  1551.         AL = exit code
  1552. -----------------------------------------------------------
  1553. INT 21 - GET EXIT CODE OF SUBPROGRAM (WAIT)
  1554.         AH = 4DH
  1555.         Return: AL = exit code of subprogram (FNs 31H or 4cH)
  1556.                 AH = circumstance which caused termination
  1557.                         0 = Terminate/abort
  1558.                         1 = Control-C
  1559.                         2 = Hard error
  1560.                         3 = Terminate and stay resident
  1561. -----------------------------------------------------------
  1562. INT 21 - Find First ASCIIZ (FIND FIRST)
  1563.         AH = 4EH
  1564.         CX = SEARCH ATTRIBUTES
  1565.         DS:DX = POINTER TO ASCIIZ FILENAME (WITH ATTRIBUTES)
  1566.         Return: Flag CF = 1 if error
  1567.                 AX = Error Code if any
  1568.                 (DTA) = data block
  1569. -----------------------------------------------------------
  1570. INT 21 - Find Next ASCIIZ (FIND NEXT)
  1571.         AH = 4FH
  1572.         Return: Flag CF = 1 if error
  1573.                 AX = Error Code if any
  1574.                 (DTA) = data block
  1575. -----------------------------------------------------------
  1576. INT 21 - Internal - Set PSP Segment
  1577.         AH = 50H
  1578.         BX = Segment address of new PSP
  1579. -----------------------------------------------------------
  1580. INT 21 - Internal - Get PSP Segment
  1581.         AH = 51H
  1582.         Return: BX = Current PSP Segment
  1583.  
  1584. struct psp {
  1585.         char psp_int20[2];      /* 00h: exit */
  1586.         unsigned psp_msize;     /* 02h: memory size in paragraphs */
  1587.         char psp_res0[1];       /* 04h: XXX (0) */
  1588.         char psp_dos[5];        /* 05h: far call to dos */
  1589.         int (*psp_term)();      /* 0ah: terminate address */
  1590.         unsigned psp_tseg;      /* 0ch: terminate segment */
  1591.         int (*psp_break)();     /* 0eh: break address */
  1592.         unsigned psp_bseg;      /* 10h: break segment */
  1593.         int (*psp_error)();     /* 12h: error address */
  1594.         unsigned psp_eseg;      /* 14h: error segment */
  1595.         unsigned psp_ppsp;      /* 16h: parent psp segment */
  1596.         char psp_ofile[20];     /* 18h: open files, 0xff = unused */
  1597.         unsigned psp_envp;      /* 2ch: environment segment */
  1598.         char psp_res2[4];       /* 2eh: XXX */
  1599.         int psp_nfiles;         /* 32h: max open files */
  1600.         char *psp_aofile;       /* 34h: ofile address */
  1601.         unsigned psp_aoseg;     /* 36h: ofile segment */
  1602.         char psp_res3[24];      /* 38h: XXX */
  1603.         char psp_int21[3];      /* 50h: int 21, far return */
  1604.         char psp_res4[2];       /* 53h: XXX */
  1605.         char psp_xfcb1[7];      /* 55h: FCB #1 extension */
  1606.         char psp_fcb1[9];       /* 5ch: FCB #1 */
  1607.         char psp_xfcb2[7];      /* 65h: FCB #2 extension */
  1608.         char psp_fcb2[20];      /* 6ch: FCB #2 */
  1609.         char psp_dma[128];      /* 80h: Command Tail */
  1610. };
  1611. -----------------------------------------------------------
  1612. INT 21 - Internal - Get Disk List
  1613.         AH = 52H
  1614.         Return: ES:BX points to DOS list of lists
  1615.  
  1616. List of Lists:
  1617. Bytes   Value
  1618. -2&-1   Segment of first memory control block
  1619. 0-3     Pointer to first DOS disk block (see func 36H)
  1620. 4-7     Partially Unknown. Pointer to a device driver. Maybe first
  1621.                resident driver?
  1622. 8-B     Pointer to CLOCK$ device driver, whether installable or
  1623.                resident
  1624. C-F     Pointer to actual CON: device driver, whether installable
  1625.                or resident
  1626. -----DOS 2.x
  1627. 10      Number of logical drives in system
  1628. 11-12   Maximum bytes/block of any block device
  1629. 13-16   unknown
  1630. 17      Beginning (not a pointer. The real beginning!) of NUL device
  1631.            driver. This is the first device on DOS's linked list
  1632.            of device drivers.
  1633. -----DOS 3.x
  1634. 10-11   Maximum bytes/block of any block device (0200H)
  1635. 12-15   Unknown. Pointer to current directory block????
  1636. 16-19   Partially Undefined: Pointer to array of drive info:
  1637.                51H bytes per drive, starting with A: ...
  1638.                00-3F Current path as ASCIIZ, starting with 'x:\'
  1639.                40-43 Unknown. I see zeros always
  1640.                44    Unknown. Flags? I see 40H, except for
  1641.                        entry after last valid entry = 00H
  1642.                45-48 Pointer to DOS Disk Block for this drive
  1643.                49-4A Unknown. Current track or block? -1 if never
  1644.                        accessed.
  1645.                4B-4E Unknown. I see -1 always
  1646.                4F-52 Unknown. I see 2 always
  1647. 1A-1D   Unknown. Pointer to data area, maybe including cluster
  1648.                allocation table?
  1649. 1E-1F   Unknown. I see zero always
  1650. 20      Number of block devices.
  1651. 21      Value of LASTDRIVE command in CONFIG.SYS (default 5)
  1652. 22      Beginning (not a pointer. The real beginning!) of NUL device
  1653.            driver. This is the first device on DOS's linked list
  1654.            of device drivers.
  1655. -----------------------------------------------------------
  1656. INT 21 - Internal - Translate BPB
  1657.         AH = 53H
  1658.         DS:SI points to BPB (Bios Parameter Block)
  1659.         ES:BP points to area for DOS Disk Block
  1660. Translates BPB (Bios Parameter Block, see below)
  1661. into a DOS Disk Block (see function call 32h).
  1662.  
  1663. BPB
  1664. Bytes   Value
  1665. 0-1     Bytes/sector. Get from DDB bytes 2-3.
  1666. 2       Sectors/cluster. Get from: (DDB byte 4) + 1
  1667. 3-4     Reserved sectors. Get from: DDB bytes 6-7
  1668. 5       Number of FATs. Get from: DDB byte 8
  1669. 6-7     Number of root dir entries. Get from: DDB bytes 9-A
  1670. 8-9     Total # of sectors. Get from:
  1671.         ((DDB bytes D-E) - 1) * (sectors per cluster (BPB byte 2))
  1672.           + (DDB Bytes B-C)
  1673. A       Media descriptor byte. Get from: DDB byte 16
  1674. B-C     Number of sectors/FAT. Get from: DDB byte F
  1675. -----------------------------------------------------------
  1676. INT 21 - Get Verify Flag
  1677.         AH = 54H
  1678.         Return: AL = 0 if flag OFF
  1679.                 AL = 1 if flag ON
  1680. -----------------------------------------------------------
  1681. INT 21 - Internal - Create PSP
  1682.         AH = 55H
  1683.         DX = Segment number to set up PSP at
  1684. Like FN 26H but creates "child" PSP rather
  1685. than copying existing one.
  1686. -----------------------------------------------------------
  1687. INT 21 - RENAME A FILE
  1688.         AH = 56H
  1689.         DS = SEGMENT OF ASCIIZ OLD NAME
  1690.         DX = OFFSET OF ASCIIZ OLD NAME
  1691.         ES = SEGMENT OF ASCIIZ NEW NAME
  1692.         DI = OFFSET OF ASCIIZ NEW NAME
  1693.         Return: Flag CF = 1 if error
  1694.                 AX = Error Code if any
  1695. -----------------------------------------------------------
  1696. INT 21 - Get/Put Date/Time
  1697.         AH = 57H
  1698.         AL = FUNCTION CODE
  1699.                 0 = GET DATE AND TIME
  1700.                 1 = SET DATE AND TIME
  1701.         BX = FILE HANDLE
  1702.         CX = TIME TO BE SET (IF AL = 1)
  1703.         DX = DATE TO BE SET (IF AL = 1)
  1704.         Return: Flag CF = 1 if error
  1705.                 AX = Error Code if any
  1706.                 CX = TIME OF LAST WRITE (IF AL = 0)
  1707.                 DX = DATE OF LAST WRITE (IF AL = 0)
  1708. -----------------------------------------------------------
  1709. INT 21 - Get/Set allocation strategy (DOS 3.x)
  1710.         AH = 58H
  1711.         AL = FUNCTION CODE
  1712.                 0 = GET ALLOCATION STRATEGY
  1713.                 1 = SET ALLOCATION STRATEGY
  1714.         BX = STRATEGY CODE (IF AL = 1)
  1715.                 0 = first fit
  1716.                 1 = best fit
  1717.                 2 = last fit
  1718.         Return: Flag CF = 1 if error
  1719.                 AX = Strategy code or Error Code
  1720. -----------------------------------------------------------
  1721. INT 21 - GET EXTENDED ERROR CODE (DOS 3.X)
  1722.         AH = 59H
  1723.         BX = VERSION CODE (0000 FOR DOS 3.0)
  1724.         Return: AX = EXTENDED ERROR CODE
  1725.                 BH = CLASS OF ERROR
  1726.                 BL = SUGGESTED ACTION CODE
  1727.                 CH = LOCUS (WHERE ERROR OCCURRED)
  1728.         Error codes:
  1729.                 01 function number invalid
  1730.                 02 file not found
  1731.                 03 path not found
  1732.                 04 too many open files
  1733.                 05 access denied
  1734.                 06 invalid handle
  1735.                 07 memory control block destroyed
  1736.                 08 insufficient memory
  1737.                 09 memory block address invalid
  1738.                 0A environment invalid
  1739.                 0B format invalid
  1740.                 0C access code invalid
  1741.                 0D data invalid
  1742.                 0F invalid drive
  1743.                 10 attempted to remove current directory
  1744.                 11 not same device
  1745.                 12 no more files
  1746.                 13 disk write-protected
  1747.                 14 unknown unit
  1748.                 15 drive not ready
  1749.                 16 unknown command
  1750.                 17 data error (CRC)
  1751.                 18 bad request structure length
  1752.                 19 seek error
  1753.                 1A unknwon media type
  1754.                 1B sector not found
  1755.                 1C printer out of paper
  1756.                 1D write fault
  1757.                 1E read fault
  1758.                 1F general failure
  1759.                 20 sharing violation
  1760.                 21 lock violation
  1761.                 22 disk change invalid
  1762.                 23 FCB unavailable
  1763.                 24-31 reserved
  1764.                 32 Network request not supported (DOS 3.1 + MS Networks)
  1765.                 33 Remote computer not listening
  1766.                 34 Duplicate name on network
  1767.                 35 Network name not found
  1768.                 36 Network busy
  1769.                 37 Network device no longer exists
  1770.                 38 Network BIOS command limit exceeded
  1771.                 39 Network adapter hardware error
  1772.                 3A Incorrect response from network
  1773.                 3B Unexpected network error
  1774.                 3C Incompatible remote adapter
  1775.                 3D Print queue full
  1776.                 3E Queue not full
  1777.                 3F Not enough space to print file
  1778.                 40 Network name was deleted
  1779.                 41 Network: Access denied
  1780.                 42 Network device type incorrect
  1781.                 43 Network name not found
  1782.                 44 Network name limit exceeded
  1783.                 45 Network BIOS session limit exceeded
  1784.                 46 Temporarily paused
  1785.                 47 Network request not accepted
  1786.                 48 Print/disk redirection paused (DOS 3.1 + MS Networks)
  1787.                 49-4F reserved
  1788.                 50 file exists
  1789.                 51 reserved
  1790.                 52 cannot make directory
  1791.                 53 fail on INT 24h
  1792.         Error Classes:
  1793.                 01 out of resource
  1794.                 02 temporary situation
  1795.                 03 authorization (denied access)
  1796.                 04 internal
  1797.                 05 hardware failure
  1798.                 06 system failure
  1799.                 07 application program error
  1800.                 08 not found
  1801.                 09 bad format
  1802.                 0A locked
  1803.                 0B media error
  1804.                 0C already exists
  1805.                 0D unknown
  1806.         Suggested Action:
  1807.                 01 retry
  1808.                 02 delayed retry
  1809.                 03 prompt user
  1810.                 04 abort after cleanup
  1811.                 05 immediate abort
  1812.                 06 ignore
  1813.                 07 retry after user intervention
  1814.         Error Locus:
  1815.                 01 unknown or not appropriate
  1816.                 02 block device
  1817.                 03 network related
  1818.                 04 serial device
  1819.                 05 memory related
  1820. -----------------------------------------------------------
  1821. INT 21 - CREATE TMEPORARY FILE (DOS 3.x)
  1822.         AH = 5AH
  1823.         DS:DX = POINTER TO DIRECTORY PATH NAME
  1824.         CX = FILE ATTRIBUTE
  1825.         Return: Flag CF = 1 if error
  1826.                 AX = Error Code if any
  1827.                 DS:DX = PATH NAME
  1828.  
  1829. NOTE: THE FILE CREATED IS NOT TRULY "TEMPORARY". IT MUST BE
  1830. REMOVED BY THE USER.
  1831. -----------------------------------------------------------
  1832. INT 21 - CREATE NEW FILE (DOS 3.x)
  1833.         AH = 5BH
  1834.         DS:DX = POINTER TO DIRECTORY PATH NAME
  1835.         CX = FILE ATTRIBUTE
  1836.         Return: Flag CF = 1 if error
  1837.                 AX = Error Code if any
  1838.                 DS:DX = PATH NAME
  1839.  
  1840. NOTE: UNLIKE FUNCTION 3CH, FUNCTION 5BH WILL FAIL IF THE FILE
  1841. ALREADY EXISTS.
  1842. -----------------------------------------------------------
  1843. INT 21 - LOCK/UNLOCK FILE ACCESS (DOS 3.x)
  1844.         AH = 5CH
  1845.         AL =
  1846.                 0 IF LOCK
  1847.                 1 IF UNLOCK
  1848.         BX = FILE HANDLE
  1849.         CX:DX = OFFSET TO LOCK
  1850.         SI:DI = AMOUNT TO LOCK
  1851.         Return: Flag CF = 1 if error
  1852.                 AX = Error Code if any
  1853. -----------------------------------------------------------
  1854. INT 21 - Internal - Unknown
  1855.         AH = 5DH XXX
  1856. -----------------------------------------------------------
  1857. INT 21 - Get Machine Name (DOS 3.1 + Microsoft Networks)
  1858.         AX = 5E00H
  1859.         DS:DX -> buffer for ASCIIZ name
  1860.         Return: Flag CF = 1 if error
  1861.                 AX = Error Code if any
  1862.                 CH = 0 if name not defined
  1863.                 CL = NETBIOS name number
  1864.                 DS:DX -> pointer to identifier if CH <> 0
  1865. -----------------------------------------------------------
  1866. INT 21 - Set Printer Setup (DOS 3.1 + Microsoft Networks)
  1867.         AX = 5E02H
  1868.         BX = Redirection list index
  1869.         CX = length of setup string <= 64
  1870.         DS:SI -> string buffer
  1871.         Return: Flag CF = 1 if error
  1872.                 AX = Error Code if any
  1873. -----------------------------------------------------------
  1874. INT 21 - Get Printer Setup (DOS 3.1 + Microsoft Networks)
  1875.         AX = 5E03H
  1876.         BX = Redirection list index
  1877.         ES:DI -> string buffer
  1878.         Return: Flag CF = 1 if error
  1879.                 AX = Error Code if any
  1880.                 CX = length of setup string <= 64
  1881. -----------------------------------------------------------
  1882. INT 21 - Get Redirection List Entry (DOS 3.1 + Microsoft Networks)
  1883.         AX = 5F02H
  1884.         BX = Redirection list index
  1885.         DS:SI -> 16 char local device name buffer
  1886.         ES:DI -> 128 char network name buffer
  1887.         Return: Flag CF = 1 if error
  1888.                 AX = Error Code if any
  1889.                 BH = Device status flag (BIT 0 = 0 if valid)
  1890.                 BL = device type (03 if printer, 04 if drive)
  1891.                 CX = stored param value
  1892.                 DX, BP destroyed
  1893. -----------------------------------------------------------
  1894. INT 21 - Redirect Device (DOS 3.1 + Microsoft Networks)
  1895.         AX = 5F03H
  1896.         BL = device type
  1897.                 03 = printer device
  1898.                 04 = file device
  1899.         CX = stored param value
  1900.         DS:SI -> source device name
  1901.         ES:DI -> destination ASCIIZ network path + ASCIIZ password
  1902.         Return: Flag CF = 1 if error
  1903.                 AX = Error Code if any
  1904. -----------------------------------------------------------
  1905. INT 21 - Cancel Redirection (DOS 3.1 + Microsoft Networks)
  1906.         AX = 5F04H
  1907.         DS:SI -> device name or network path
  1908.         Return: Flag CF = 1 if error
  1909.                 AX = Error Code if any
  1910. -----------------------------------------------------------
  1911. INT 21 - Internal - Resolve path string to fully qualified path string
  1912.         AH = 60h
  1913.         DI:SI = relative path strings
  1914.         ES:DI = buffer for fully qualified name
  1915.         Returns: buffer filled with qualified name
  1916.                  may return error code, unknown.
  1917. -----------------------------------------------------------
  1918. INT 21 - Internal - Unknown
  1919.         AH = 61H
  1920.         Returns AL = 0 in DOS 3.1 (unused function)
  1921. -----------------------------------------------------------
  1922. INT 21 - GET PSP ADDRESS (DOS 3.x)
  1923.         AH = 62H
  1924.         Return: BX = SEGMENT ADDRESS OF PSP
  1925. -----------------------------------------------------------
  1926. INT 21 - GET LEAD BYTE TABLE (DOS 2.25 only)
  1927.         AH = 63H
  1928.         AL = SUBFUNCTION
  1929.                 0 = get system lead byte table
  1930.                 1 = set/clear interim console flag
  1931.                 2 = get interim console flag
  1932.         DL = 1/0 to set/clear interim console flag
  1933.         Return: DS:SI -> lead byte table (AL = 0)
  1934.                 DL = interim console flag (AL = 2)
  1935. -----------------------------------------------------------
  1936. INT 21 - Internal - unknown (DOS 3.3)
  1937.         AH = 64h
  1938. -----------------------------------------------------------
  1939. INT 21 - GET EXTENDED COUNTRY INFORMATION (DOS 3.3)
  1940.         AH = 65h
  1941.         AL = info ID (1 - 6)
  1942.         BX = code page (-1=global code page)
  1943.         DX = country ID (-1=current country)
  1944.         ES:DI = pointer to country information buffer
  1945.         CX = size of buffer
  1946.         Return: AX = error code if carry set, otherwise
  1947.                 CX = size of country information returned
  1948.                 ES:DI = pointer to country information:
  1949.                         1 BYTE info ID
  1950.                         if info ID <> 1
  1951.                         1 DWORD pointer to information
  1952.                            if info ID == 1
  1953.                         1 WORD size
  1954.                         1 WORD country ID
  1955.                         1 WORD code page
  1956.                        34 BYTE see function 38h
  1957. -----------------------------------------------------------
  1958. INT 21 - GET/SET GLOBAL CODE PAGE TABLE (DOS 3.3)
  1959.         AH = 66h
  1960.         AL = 00h get global code page
  1961.              Return: AX = error code if carry flag set
  1962.                      BX = active code page
  1963.                      DX = system code page
  1964.            = 01h set global page
  1965.              BX = active code page
  1966.              DX = system code page (active page at boot time)
  1967.              Return: AX = error code if carry flag set
  1968. -----------------------------------------------------------
  1969. INT 21 - SET HANDLE COUNT (DOS 3.3)
  1970.         AH = 67h
  1971.         BX = desired number of handles (max 255)
  1972.         Return: Carry clear if ok
  1973.                 Carry set if error (and error code in AX)
  1974. -----------------------------------------------------------
  1975. INT 21 - COMMIT FILE - WRITE ALL BUFFERED DATA TO DISK (DOS 3.3)
  1976.         AH = 68H
  1977.         BX = file handle
  1978.         Return: carry flag set on error (and error code in AX)
  1979. -----------------------------------------------------------
  1980. INT 21 - DoubleDos -
  1981.         AX = E400h
  1982.         Return: AL <> 0 if DoubleDos is active
  1983. -----------------------------------------------------------
  1984. INT 21 - DoubleDos - Turn off Task Switching
  1985.         AH = EAh
  1986.         Return: task switching turned off
  1987. -----------------------------------------------------------
  1988. INT 21 - DoubleDos - Turn on Task Switching
  1989.         AH = EBh
  1990.         Return: task switching turned on
  1991. -----------------------------------------------------------
  1992. INT 21 - DoubleDos - Get Virtual Screen Address
  1993.         AH = ECh
  1994.         Return: ES = segment of virtual screen
  1995.                 Screen address can change if task-switching is on!!
  1996. -----------------------------------------------------------
  1997. INT 21 - DoubleDos - Give away time to other tasks
  1998.         AH = EEh
  1999.         AL = number of 55ms time slices to give away
  2000.         Return: returns after giving away time slices
  2001. -----------------------------------------------------------
  2002. INT 21 - CED installable commands
  2003.         AH = 0FFH
  2004.            AL = 0 add installable command
  2005.              BL = mode - bit 0 = 1 callable from DOS prompt
  2006.                          bit 1 = 1 callable from application
  2007.              DS:SI pointer to CR-terminated command name
  2008.              ES:DI pointer to FAR routine entry point
  2009.            AL = 1 remove installable command
  2010.              DS:SI pointer to CR-terminated command name
  2011.            AL = 2 reserved, may be used to test for CED installation
  2012.         Returns:
  2013.            CF set on error
  2014.              AX = 1 invalid function
  2015.                   2 command not found (subfunction 1 only)
  2016.                   8 insufficient memory (subfunction 0 only)
  2017.                  0Eh bad data (subfunction 0 only)
  2018.            AH = 0FFh if CED not installed
  2019. -----------------------------------------------------------
  2020. INT 22 - TERMINATE ADDRESS
  2021. FAR (DWORD) address of routine to be executed
  2022. when program "returns to DOS". Should NEVER be called directly.
  2023. -----------------------------------------------------------
  2024. INT 23 - CONTROL "C" EXIT ADDRESS
  2025. Automatically called from keyboard scanner when
  2026. CTRL-C or CTRL-BREAK is detected. Normally aborts program
  2027. and returns to DOS, but may be changed.
  2028. -----------------------------------------------------------
  2029. INT 24 - FATAL ERROR ABORT ADDRESS
  2030. Automatically called upon detection of unrecoverable
  2031. disk error. Normally prints "Abort, Retry, or Ignore?" message
  2032. and takes the reply, but may be changed if desired.
  2033.  
  2034. Provides the following values in registers on entry to interrupt handler:
  2035.         AH: bit 7 = 0 disk I/O error
  2036.                   = 1 other error -- if block device, bad FAT
  2037.                                   -- if char device, code in DI
  2038.             bit 6  unused
  2039.             bit 5 = 1 if Ignore allowed, 0 if not (DOS 3.2)
  2040.             bit 4 = 1 if Retry allowed, 0 if not (DOS 3.2?)
  2041.             bit 3 = 1 if Fail allowed, 0 if not (DOS 3.2)
  2042.             bit 2 \ disk area of error  00 = DOS area  01 = FAT
  2043.             bit 1 /                     10 = root dir  11 = data area
  2044.             bit 0 = 1 if write, 0 if read
  2045.         AL = drive number if AH bit 7 = 1, otherwise undefined
  2046.         BP:SI = address of device header for which error occurred
  2047.             block device if high bit of BP:SI+4 = 1
  2048.         low byte of DI:
  2049.            00 = write-protect error
  2050.            01 = unknown unit
  2051.            02 = drive not ready
  2052.            03 = unknown command
  2053.            04 = data error (bad CRC)
  2054.            05 = bad request structure length
  2055.            06 = seek error
  2056.            07 = unknown media type
  2057.            08 = sector not found
  2058.            09 = printer out of paper
  2059.            0A = write fault
  2060.            0B = read fault
  2061.            0C = general failure
  2062.            0F = invalid disk change (DOS 3.x)
  2063. Handler must return
  2064.         AL = 00  ignore error
  2065.            = 01  retry operation
  2066.            = 02  terminate program through INT 23
  2067.            = 03  fail system call in progress (DOS 3.2)
  2068. -----------------------------------------------------------
  2069. INT 25 - ABSOLUTE DISK READ
  2070.         AL = Drive number (0=A, 1=B, etc)
  2071.         DS:BX = Disk Transfer Address (buffer)
  2072.         CX = Number of sectors to read
  2073.         DX = First relative sector to read
  2074.         Return: Flag CF = 1 if error
  2075.                 AL = error code issued to INT 24h in low half of DI
  2076.                 AH = 80h if attachment failed to respond
  2077.                      40h if seek operation failed
  2078.                      20h if controller failed
  2079.                      10h if data error (bad CRC)
  2080.                      08h if DMA failure
  2081.                      04h if requested sector not found
  2082.                      03h if write-protected disk
  2083.                      02h if bad address mark
  2084.                      01h if bad command
  2085.        ORIGINAL FLAGS ON STACK!
  2086. -----------------------------------------------------------
  2087. INT 26 - ABSOLUTE DISK WRITE
  2088.         AL = Drive number (0=A, 1=B, etc)
  2089.         DS:BX = Disk Transfer Address (buffer)
  2090.         CX = Number of sectors to write
  2091.         DX = First relative sector to write
  2092.         Return: Flag CF = 1 if error
  2093.                 AL = error code issued to INT 24h in low half of DI
  2094.                 AH = same error codes as for INT 25h
  2095.         ORIGINAL FLAGS ON STACK!
  2096. -----------------------------------------------------------
  2097. INT 27 - TERMINATE BUT STAY RESIDENT
  2098.         CS = CURRENT PROGRAM SEGMENT
  2099.         DX = LAST PROGRAM BYTE + 1
  2100. -----------------------------------------------------------
  2101. INT 28 - Internal - Keyboard Busy Loop
  2102. This interrupt is called from inside the "get input
  2103. from keyboard" routine in DOS, if and only if it is safe to use
  2104. INT 21 to access the disk at that time. It is used primarily by
  2105. the PRINT.COM routines, but any number of other routines could
  2106. be chained to it by saving the original vector, and calling it
  2107. with a FAR call (or just JMPing to it) at the end of the new
  2108. routine.
  2109. Until PRINT.COM installs its own routine, this
  2110. interrupt vector simply points to an IRET opcode.
  2111. -----------------------------------------------------------
  2112. INT 29 - Internal - Fast Putchar
  2113. This interrupt is called from the DOS output routines
  2114. if output is going to a device rather than a file, and the
  2115. device driver's attribute word has bit 3 (04H) set to "1".
  2116. -----------------------------------------------------------
  2117. INT 2A - Network Installation Check (Microsoft Networks)
  2118.         AH = 00H
  2119.         Return: AH <> 0 if installed
  2120. -----------------------------------------------------------
  2121. INT 2A - Check Direct I/O (Microsoft Networks)
  2122.         AX = 0300H
  2123.         DS:SI -> ASCIIZ disk device name
  2124.         Return: CF == 0 if allowed
  2125. -----------------------------------------------------------
  2126. INT 2A - Execute NETBIOS (Microsoft Networks)
  2127.         AH = 04H
  2128.         AL = 0 for error retry, 1 for no retry
  2129.         ES:BX -> NCB
  2130.         Return: AX = 0 for no error
  2131.                 AH = 1, AL = error code
  2132. -----------------------------------------------------------
  2133. INT 2A - Get Network Resource Information (Microsoft Networks)
  2134.         AX = 0500H
  2135.         Return: AX = reserved
  2136.                 BX = # network names
  2137.                 CX = # commands
  2138.                 DX = # sessions
  2139. -----------------------------------------------------------
  2140. INT 2B - Internal routine for MSDOS (IRET) XXX
  2141. -----------------------------------------------------------
  2142. INT 2C - Internal routine for MSDOS (IRET) XXX
  2143. -----------------------------------------------------------
  2144. INT 2D - Internal routine for MSDOS (IRET) XXX
  2145. -----------------------------------------------------------
  2146. INT 2E - Internal - Execute Command
  2147.         ES:SI -> counted CR-terminated command string
  2148.  
  2149. The top-level command.com executes the command; all
  2150. registers are destroyed as in exec.
  2151. -----------------------------------------------------------
  2152. INT 2F - Multiplexor - PRINT Installation Check
  2153.         AX = 0100H
  2154.         Return: AL =
  2155.                 FFH if installed
  2156.                 01H if not installed, not OK to install
  2157.                 00H if not installed, OK to install
  2158. -----------------------------------------------------------
  2159. INT 2F - Multiplexor - PRINT Submit file
  2160.         AX = 0101H
  2161.         DS:DX -> packet of one byte level and DWORD file pointer
  2162.         Return: Flag CF = 1 if error
  2163.                 AX = Error Code if any
  2164. -----------------------------------------------------------
  2165. INT 2F - Multiplexor - PRINT Remove file
  2166.         AX = 0102H
  2167.         DS:DX -> file name (wildcards allowed)
  2168.         Return: Flag CF = 1 if error
  2169.                 AX = Error Code if any
  2170. -----------------------------------------------------------
  2171. INT 2F - Multiplexor - PRINT Remove all files
  2172.         AX = 0103H
  2173.         Return: Flag CF = 1 if error
  2174.                 AX = Error Code if any
  2175. -----------------------------------------------------------
  2176. INT 2F - Multiplexor - PRINT Hold queue/Get status
  2177.         AX = 0104H
  2178.         Return: Flag CF = 1 if error
  2179.                 AX = Error Code if any
  2180.                     1 if function invalid
  2181.                     2 if file not found
  2182.                     3 if path not found
  2183.                     4 if too many open files
  2184.                     5 if access denied
  2185.                     8 if queue full
  2186.                     9 if spooler busy
  2187.                    0Ch if name too long
  2188.                    0Fh if drive invalid
  2189.                 DX = Error count
  2190.                 DS:SI -> print queue (null-string terminated
  2191.                         list of 64-byte ASCIZ file names)
  2192. -----------------------------------------------------------
  2193. INT 2F - Multiplexor - PRINT Restart queue
  2194.         AX = 0105H
  2195.         Return: Flag CF = 1 if error
  2196.                 AX = Error Code if any
  2197. -----------------------------------------------------------
  2198. INT 2F - Multiplexor - ASSIGN Installation Check
  2199.         AX = 0600H
  2200.         Return: AH <> 0 if installed
  2201. -----------------------------------------------------------
  2202. INT 2F - Multiplexor - ASSIGN
  2203.         AX = 0601H XXX
  2204. -----------------------------------------------------------
  2205. INT 2F - Multiplexor - MSDOS Internal
  2206.         AH = 10H XXX
  2207. -----------------------------------------------------------
  2208. INT 2F - Multiplexor - MSDOS Internal
  2209.         AH = 11H XXX
  2210. -----------------------------------------------------------
  2211. INT 2F - Multiplexor - MSDOS Internal
  2212.         AH = 12H XXX
  2213. -----------------------------------------------------------
  2214. INT 2F - Multiplexor - APPEND Installation Check
  2215.         AX = B700H
  2216.         Return: AH <> 0 if installed
  2217. -----------------------------------------------------------
  2218. INT 2F - Multiplexor - APPEND
  2219.         AX = B701H XXX
  2220. -----------------------------------------------------------
  2221. INT 2F - Multiplexor - Network Program Installation Check
  2222.         AX = B800H
  2223.         Return: AH <> 0 if installed
  2224. -----------------------------------------------------------
  2225. INT 2F - Multiplexor - Get Current Post Address
  2226.         AX = B803H
  2227.         Return: ES:BX = post address
  2228. -----------------------------------------------------------
  2229. INT 2F - Multiplexor - Set New Post Address
  2230.         AX = B804H
  2231.         ES:BX = new post address
  2232. -----------------------------------------------------------
  2233. INT 30 -> (NOT A VECTOR!) FAR jump instruction for CP/M-style calls
  2234. INT 31
  2235. -----------------------------------------------------------
  2236. INT 32 -> not used
  2237. -----------------------------------------------------------
  2238. INT 33 -> USED BY MICROSOFT MOUSE
  2239. -----------------------------------------------------------
  2240. INT 40 -> Relocated (by fixed disk) Floppy Handler (original INT 13h)
  2241. -----------------------------------------------------------
  2242. INT 41 -> Fixed Disk Params
  2243.         dw      cylinders
  2244.         db      heads
  2245.         dw      0
  2246.         dw      write pre-comp
  2247.         db      0
  2248.         db      0 "control byte"
  2249.         db      0, 0, 0
  2250.         dw      landing zone
  2251.         db      sectors/track
  2252.         db      0
  2253. -----------------------------------------------------------
  2254. INT 42 -> Relocated (by EGA) Video Handler (original INT 10h)
  2255. -----------------------------------------------------------
  2256. INT 43 -> EGA Initialization Params
  2257. -----------------------------------------------------------
  2258. INT 44 -> EGA/PCjr fonts
  2259. -----------------------------------------------------------
  2260. INT 45 -> reserved
  2261. -----------------------------------------------------------
  2262. INT 46 -> Secondary Fixed Disk Params (see INT 41h)
  2263. -----------------------------------------------------------
  2264. INT 47 -> reserved
  2265. -----------------------------------------------------------
  2266. INT 48 -> PCjr Cordless Keyboard Translation
  2267. -----------------------------------------------------------
  2268. INT 49 -> PCjr Non-keyboard Scan Code Translation Table
  2269. -----------------------------------------------------------
  2270. INT 4A -> AT User Alarm
  2271. -----------------------------------------------------------
  2272. INT 4B -> reserved
  2273. -----------------------------------------------------------
  2274. INT 4C -> reserved
  2275. -----------------------------------------------------------
  2276. INT 4D -> reserved
  2277. -----------------------------------------------------------
  2278. INT 4E -> reserved
  2279. -----------------------------------------------------------
  2280. INT 4F -> reserved
  2281. -----------------------------------------------------------
  2282. INT 50-57 -> IRQ0-IRQ7 relocated by DESQview
  2283. -----------------------------------------------------------
  2284. INT 5C - NETBIOS interface
  2285.         ES:BX -> Network Control Block
  2286. -----------------------------------------------------------
  2287. INT 70 thru 77 - AT Vectored Hardware Lines
  2288.         IRQ8    -       real-time clock
  2289.         IRQ9    -       LAN adapter 1 (rerouted to INT 0Ah by BIOS)
  2290.         IRQ10   -       reserved
  2291.         IRQ11   -       reserved
  2292.         IRQ12   -       reserved
  2293.         IRQ13   -       80287 error (rerouted to INT 2 by BIOS)
  2294.         IRQ14   -       fixed disk
  2295.         IRQ15   -       reserved
  2296. -----------------------------------------------------------
  2297. INT 86 - Relocated (by NETBIOS) INT 18
  2298. -----------------------------------------------------------
  2299. INT F8 - INTERVAL TIMER (10 MSEC)
  2300. -----------------------------------------------------------
  2301. INT FA - USART READY (RS-232C)
  2302. -----------------------------------------------------------
  2303. INT FB - USART Rx READY (keyboard)
  2304. -----------------------------------------------------------
  2305. %
  2306.