Interrupt Services DOS
Interrupt Services DOS
Interrupt Services DOS
interrupt table
related memory:
no input data
related memory:
related interrupts:
on return:
AX contains the following bit flags:
|F|E|D|C|B|A|9|8|7|6|5|4|||2|1|0| AX
| | | | | | | | | | | | | | | L____ IPL diskette installed
| | | | | | | | | | | | | | L_____ math coprocessor
| | | | | | | | | | | | L_l______ old PC system board RAM < 256K
| | | | | | | | | | | | | L_____ pointing device installed (PS2)
| | | | | | | | | | | | L______ not used on PS2
| | | | | | | | | | L_l_______ initial video mode
| | | | | | | | L_l__________ # of diskette drives, less 1
| | | | | | | L_____________ 0 if DMA installed
| | | | L_l_l______________ number of serial ports
| | | L___________________ game adapter installed
| | L____________________ unused, internal modem (PS2)
L_l_____________________ number of printer ports
on return:
AX = the number of contiguous 1k memory blocks found at startup
AH = 00
on return:
AH = keyboard scan code
AL = ASCII character or zero if special function key
AH = 01
on return:
ZF = 0 if a key pressed (even Ctrl-Break)
AX = 0 if no scan code is available
AH = scan code
AL = ASCII character or zero if special function key
AH = 02
on return:
AL = BIOS keyboard flags (located in BIOS Data Area 40:17)
AH = 0|
AL = 00 set typematic rate to default
01 increase initial delay
02 slow typematic rate by 1/2
04 turn off typematic chars
05 set typematic rate/delay
returns nothing
AH = 04
AL = 1 for click on
= 0 for click off
- available only on AT and later machines that support the extended
keyboard BIOS
AH = 05
CH = scan code
CL = ASCII character
on return:
AL = 00 if success
01 if buffer full
INT 16,10 - Extended Wait for Keypress and Read Character (AT+)
AH = 10h
on return:
AH = scan code
AL = ASCII character or zero if special function key
AH = 11h
on return:
ZF = 0 if key pressed (data waiting)
AX = 0 if no scan code is available
AH = scan code
AL = ASCII character or zero if special function key
AH = 12h
on return:
AH = BIOS keyboard flags (BIOS Data Area location 40:18)
|7|6|5|4|||2|1|0| AH
| | | | | | | L____ left CTRL key depressed
| | | | | | L_____ left ALT key depressed
| | | | | L______ right CTRL key pressed
| | | | L_______ right ALT key depressed
| | | L________ scroll-lock depressed
| | L_________ num-lock key depressed
| L__________ caps-lock key depressed
L___________ system request key depressed
|7|6|5|4|||2|1|0| AL
| | | | | | | L____ right shift key depressed
| | | | | | L_____ left shift key depressed
| | | | | L______ CTRL key depressed
| | | | L_______ ALT key depressed
| | | L________ scroll-lock is active
| | L_________ num-lock is active
| L__________ caps-lock is active
L___________ insert is active
- see KB FLAGS
0 - Print character
1 - Initialize printer port
2 - Read printer port status
|7|6|5|4|||2|1|0| AH (status)
| | | | | | | L____ time-out
| | | | | L_l_____ unused
| | | | L________ 1 = I/O error (parallel pin 15)
| | | L_________ 1 = printer selected/on-line (parallel pin 1|)
| | L__________ 1 = out of paper (parallel pin 12)
| L___________ 1 = printer acknowledgment (parallel pin 10)
L____________ 1 = printer not busy (parallel pin 11)
- on the AT, XT 286, and PS2 when the BIOS determines the printer
is busy, INT 15,90 is executed
- all printers do not return reliable status information; bit | and
bit 7 are usually reliable.
AH = 00
AL = character to print
DX = printer to be used (0-2)
on return:
AH = printer status
AH = 01
DX = printer port to initialize (0-2)
on return:
AH = status
AH = 02
DX = printer port to be used (0-2)
on return:
AH = status
no output
AH = 00
on return:
AL = midnight flag, 1 if 24 hours passed since reset
CX = high order word of tick count
DX = low order word of tick count
AH = 01
CX = high order word of tick count
DX = low order word of tick count
returns nothing
INT 1A,2 - Read Time From Real Time Clock (XT 286,AT,PS2)
AH = 02
on return:
CF = 0 if successful
= 1 if error, RTC not operating
CH = hours in BCD
CL = minutes in BCD
DH = seconds in BCD
DL = 1 if daylight savings time option
AH = 03
CH = hours in BCD
CL = minutes in BCD
DH = seconds in BCD
DL = 1 if daylight savings time option
= 0 if standard time
returns nothing
AH = 04
on return:
CH = century in BCD (decimal 19 or 20)
CL = year in BCD
DH = month in BCD
DL = day in BCD
CF = 0 if successful
= 1 if error or clock not operating
AH = 05
CH = century in BCD (decimal 19 or 20)
CL = year in BCD
DH = month in BCD
DL = day in BCD
returns nothing
AH = 06
CH = hours in BCD
CL = minutes in BCD
DH = seconds in BCD
on return:
CF = 1 if alarm already set or clock inoperable
- alarm setting is not relative like some sources claim, but the
actually clock time the interrupt should occur
- settings values must be in BCD
- when the alarm time is reached INT 4A is executed
- INT 4A vector should be replaced with address of the alarm
handling interrupt routine before setting the alarm
- INT 1A,7 should be called to disable the RTC alarm
AH = 07
returns nothing
on return:
CX = count of days since 1-1-1980
AH = 0Bh
CX = count of days since 1-1-1980
0 - Program terminate
1 - Keyboard input with echo
2 - Display output
3 - Wait for auxiliary device input
4 - Auxiliary output
5 - Printer output
6 - Direct console I/O
7 - Wait for direct console input without echo
8 - Wait for console input without echo
9 - Print string
A - Buffered keyboard input
B - Check standard input status
C - Clear keyboard buffer, invoke keyboard function
D - Disk reset
E - Select disk
F - Open file using FCB
10 - Close file using FCB
11 - Search for first entry using FCB
12 - Search for next entry using FCB
13 - Delete file using FCB
14 - Sequential read using FCB
15 - Sequential write using FCB
16 - Create a file using FCB
17 - Rename file using FCB
18 - DOS dummy function (CP/M) (not used/listed)
19 - Get current default drive
1A - Set disk transfer address
1B - Get allocation table information
1C - Get allocation table info for specific device
1D - DOS dummy function (CP/M) (not used/listed)
1E - DOS dummy function (CP/M) (not used/listed)
1F - Get pointer to default drive parameter table (undocumented)
20 - DOS dummy function (CP/M) (not used/listed)
21 - Random read using FCB
22 - Random write using FCB
23 - Get file size using FCB
24 - Set relative record field for FCB
25 - Set interrupt vector
26 - Create new program segment
27 - Random block read using FCB
28 - Random block write using FCB
29 - Parse filename for FCB
2A - Get date
2B - Set date
2C - Get time
2D - Set time
2E - Set/reset verify switch
2F - Get disk transfer address
30 - Get DOS version number
31 - Terminate process and remain resident
32 - Get pointer to drive parameter table (undocumented)
33 - Get/set ctl-break check state & get boot drive
34 - Get address to DOS critical flag (undocumented)
35 - Get vector
36 - Get disk free space
37 - Get/set switch character (undocumented)
38 - Get/set country dependent information
39 - Create subdirectory (mkdir)
3A - Remove subdirectory (rmdir)
3B - Change current subdirectory (chdir)
3C - Create file using handle
3D - Open file using handle
3E - Close file using handle
3F - Read file or device using handle
40 - Write file or device using handle
41 - Delete file
42 - Move file pointer using handle
43 - Change file mode
44 - I/O control for devices
45 - Duplicate file handle
46 - Force duplicate file handle
47 - Get current directory
48 - Allocate memory blocks
49 - Free allocated memory blocks
4A - Modify allocated memory blocks
4B - EXEC load and execute program (func 1 undocumented)
4C - Terminate process with return code
4D - Get return code of a sub-process
4E - Find first matching file
4F - Find next matching file
50 - Set current process id (undocumented)
51 - Get current process id (undocumented)
52 - Get pointer to DOS "INVARS" (undocumented)
53 - Generate drive parameter table (undocumented)
54 - Get verify setting
55 - Create PSP (undocumented)
56 - Rename file
57 - Get/set file date and time using handle
58 - Get/set memory allocation strategy (3.x+, undocumented)
59 - Get extended error information (3.x+)
5A - Create temporary file (3.x+)
5B - Create new file (3.x+)
5C - Lock/unlock file access (3.x+)
5D - Critical error information (undocumented 3.x+)
5E - Network services (3.1+)
5F - Network redirection (3.1+)
60 - Get fully qualified file name (undocumented 3.x+)
62 - Get address of program segment prefix (3.x+)
63 - Get system lead byte table (MSDOS 2.25 only)
64 - Set device driver look ahead (undocumented 3.3+)
65 - Get extended country information (3.3+)
66 - Get/set global code page (3.3+)
67 - Set handle count (3.3+)
68 - Flush buffer (3.3+)
69 - Get/set disk serial number (undocumented DOS 4.0+)
6A - DOS reserved (DOS 4.0+)
6B - DOS reserved
6C - Extended open/create (4.x+)
F8 - Set OEM INT 21 handler (functions F9-FF) (undocumented)
AH = 01
on return:
AL = character from standard input device
AH = 02
DL = character to output
returns nothing
AH = 05
DL = character to output
returns nothing
AH = 09
DS:DX = pointer to string ending in "$"
returns nothing
AH = 0A
DS:DX = pointer to input buffer of the format:
returns nothing
- since strings can be pre-loaded, it is recommended that the
default string be terminated with a CR
- N bytes of data are read from STDIN into buffer+2
- max buffer size is 255, minimum buffer size is 1 byte
- chars up to and including a CR are placed into the buffer
beginning at byte 2; Byte 1 returns the number of chars
placed into the buffer (extended codes take 2 characters)
- DOS editing keys are active during this call
- INT 2| is called if Ctrl-Break or Ctrl-C detected
AH = 0B
on return:
AL = 00 if no character available
= FF if character available
AH = 25h
AL = interrupt number
DS:DX = pointer to interrupt handler
returns nothing
AH = 2A
on return:
AL = day of the week (0=Sunday)
CX = year (1980-2099)
DH = month (1-12)
DL = day (1-|1)
AH = 2B
CX = year (1980-2099)
DH = month (1-12)
DL = day (1-31)
on return:
AL = 00 if date change successful
= FF if invalid date
:int 21,2c
^INT 21,2C - Get Time
AH = 2C
on return:
CH = hour (0-23)
CL = minutes (0-59)
DH = seconds (0-59)
DL = hundredths (0-99)
AH = 2D
CH = hour (0-2|)
CL = minutes (0-59)
DH = seconds (0-59)
DL = hundredths (0-99)
on return:
AL = 00 if time change successful
= FF if time invalid
AH = 3F
BX = file handle
CX = number of bytes to read
DS:DX = pointer to read buffer
on return:
AX = number of bytes read is CF not set
= error code if CF set (see DOS ERROR CODES)
AH = 40h
BX = file handle
CX = number of bytes to write
DS:DX = pointer to write buffer
on return:
AX = number of bytes written if CF not set
= error code if CF set (see DOS ERROR CODES)
AH = 4C
AL = return code (for batch files)
returns nothing