ralf@b.gp.cs.cmu.edu (Ralf Brown) (09/18/88)
AL = subfunction
0 reset typematic (PCjr)
1 increase initial delay (PCjr)
2 increase continuing delay (PCjr)
3 increase both delays (PCjr)
4 turn off typematic (PCjr)
5 Set typematic rate (AT or PS/2)
BH = 00 - 03 for delays of 250ms, 500ms, 750ms, or 1s
BL = 00 - 1F for typematic rates of 30cps down to 2cps
------------------------------------------------------
INT 16 - KEYBOARD - KEYCLICK (Jr,CONV)
AH = 04h
AL =
0 click off
1 click on
------------------------------------------------------
INT 16 - KEYBOARD - WRITE TO KEYBOARD BUFFER (AT model 339,XT2,XT286,PS)
AH = 05h
CH = scan code
CL = character
Return: AL = 1 if buffer full
------------------------------------------------------
INT 16 - KEYBOARD - GET ENHANCED KEYSTROKE (AT model 339,XT2,XT286,PS)
AH = 10h
Return: AH = scan code
AL = character
------------------------------------------------------
INT 16 - KEYBOARD - CHECK ENHANCED KEYSTROKE (AT model 339,XT2,XT286,PS)
AH = 11h
Return: ZF = 0 if keystroke available
AH = scan code \ meaningless if ZF = 1
AL = character /
ZF = 1 if kbd buffer empty
------------------------------------------------------
INT 16 - KEYBOARD - GET ENHANCED SHIFT FLAGS (AT model 339,XT2,XT286,PS)
AH = 12h
Return: AL (same as for AH=02h)
bit 7: Ins ON
bit 6: CapsLock ON
bit 5: NumLock ON
bit 4: ScrollLock ON
bit 3: Either ALT key down
bit 2: Either CTRL key down
bit 1: Left shift key down
bit 0: Right shift key down
AH
bit 7: SysReq key down
bit 6: CapsLock key down
bit 5: NumLock key down
bit 4: ScrollLock key down
bit 3: Right Alt key down
bit 2: Right Ctrl key down
bit 1: Left Alt key down
bit 0: Right Alt key down
------------------------------------------------------
INT 17 - PRINTER - OUTPUT CHARACTER
AH = 00h
AL = character
DX = printer port (0-3)
Return: AH = status bits
0 = time out
1 = unused
2 = unused
3 = I/O error
4 = selected
5 = out of paper
6 = acknowledge
7 = not busy
------------------------------------------------------
INT 17 - PRINTER - INITIALIZE
AH = 01h
DX = printer port (0-3)
Return: AH = status (see AH = 00h above)
------------------------------------------------------
INT 17 - PRINTER - GET STATUS
AH = 02h
DX = printer port (0-3)
Return: AH = status (see AH = 00h above)
------------------------------------------------------
INT 18 - TRANSFER TO ROM BASIC
causes transfer to ROM-based BASIC (IBM-PC)
often reboots a compatible; often has no effect at all
------------------------------------------------------
INT 19 - DISK BOOT
causes reboot of disk system (no memory test performed)
------------------------------------------------------
INT 1A - CLOCK - GET TIME OF DAY
AH = 00h
Return: CX:DX = clock count
AL = 0 if clock was read or written (via AH=0,1)
within the current 24-hour period
Otherwise, AL > 0
------------------------------------------------------
INT 1A - CLOCK - SET TIME OF DAY
AH = 01h
CX:DX = clock count
Return: time of day set
------------------------------------------------------
INT 1A - CLOCK - READ REAL TIME CLOCK (AT,XT286,CONV,PS)
AH = 02h
Return: CH = hours in BCD
CL = minutes in BCD
DH = seconds in BCD
------------------------------------------------------
INT 1A - CLOCK - SET REAL TIME CLOCK (AT,XT286,CONV,PS)
AH = 03h
CH = hours in BCD
CL = minutes in BCD
DH = seconds in BCD
DL = 1, if daylight savings; 0 if standard time
Return: CMOS clock set
------------------------------------------------------
INT 1A - CLOCK - READ DATE FROM REAL TIME CLOCK (AT,XT286,CONV,PS)
AH = 04h
Return: DL = day in BCD
DH = month in BCD
CL = year in BCD
CH = century (19h or 20h)
------------------------------------------------------
INT 1A - CLOCK - SET DATE IN REAL TIME CLOCK (AT,XT286,CONV,PS)
AH = 05h
DL = day in BCD
DH = month in BCD
CL = year in BCD
CH = century (19h or 20h)
Return: CMOS clock set
------------------------------------------------------
INT 1A - CLOCK - SET ALARM (AT,XT286,CONV,PS)
AH = 06h
CH = hours in BCD
CL = minutes in BCD
DH = seconds in BCD
Return: CF set if alarm already set or clock inoperable
INT 4Ah will be called when alarm goes off, every 24 hours until reset
------------------------------------------------------
INT 1A - CLOCK - RESET ALARM (AT,XT286,CONV,PS)
AH = 07h
Return: alarm disabled
------------------------------------------------------
INT 1A - CLOCK - SET RTC ACTIVATED POWER ON MODE (CONVERTIBLE)
AH = 08h
CH = hours in BCD
CL = minutes in BCD
DH = seconds in BCD
------------------------------------------------------
INT 1A - CLOCK - READ RTC ALARM TIME AND STATUS (CONV,PS30)
AH = 09h
Return: CH = hours in BCD
CL = minutes in BCD
DH = seconds in BCD
DL = alarm status
0 alarm not enabled
1 alarm enabled but will not power up system
2 alarm will power up system
------------------------------------------------------
INT 1A - CLOCK - READ SYSTEM-TIMER DAY COUNTER (XT2,PS)
AH = 0Ah
Return: CF set on error
CX = count of days since Jan 1,1980
------------------------------------------------------
INT 1A - CLOCK - SET SYSTEM-TIMER DAY COUNTER (XT2,PS)
AH = 0Bh
CX = count of days since Jan 1,1980
Return: CF set on error
------------------------------------------------------
INT 1A - SET UP SOUND MULTIPLEXOR (PCjr ONLY)
AH = 80h
AL = 0 source is 8253 channel 2
1 source is cassette input
2 source is I/O channel "Audio IN"
3 source is sound generator chip
------------------------------------------------------
INT 1B - CTRL-BREAK KEY
This interrupt is called when the keyboard scanner of the IBM
machines detects CTRL and BREAK pressed at the same time. It
normally points to a short routine in DOS which sets the
Ctrl-C flag, thus invoking INT 23h the next time DOS checks
for Ctrl-C.
------------------------------------------------------
INT 1C - CLOCK TICK
This interrupt is called (in the IBM) at the end of each time-update
operation by the time-of-day routines. It normally points to an IRET.
------------------------------------------------------
INT 1D -> 6845 VIDEO INIT TABLES
table for modes 0 and 1 \
table for modes 2 and 3 \ each table is 16 bytes long and
table for modes 4,5, and 6 / contains values for 6845 registers
table for mode 7 /
4 words -- size of video RAM for modes 0/1, 2/3, 4/5, and 6/7
8 bytes -- number of columns in each mode
8 bytes -- video controller mode byte for each mode
------------------------------------------------------
INT 1E -> DISKETTE PARAMS (BASE TABLE)
(Default at F000:EFC7 in PC and most compatibles)
DB step rate & head unload times
DB head load time & DMA
DB motor off time in clock ticks (36 or 37 typical)
DB sector size in bytes (0->128, 1->256, 2->512, 3->1024)
DB last sector number (8 or 9 typical)
DB inter-sector gap size on read/write (42 typical)
DB data transfer length (255 typical)
DB inter-sector gap size on format (80 typical)
DB sector fill on format (F6h typical)
DB head-settle time ms (typical 25, 1.10->0, 2.10->15, 3.10->1)
DB motor start-up time (1/8 secs) (typical 4, 2.10->2)
------------------------------------------------------
INT 1F -> GRAPHICS SET 2
(NOT a vector!) pointer to bitmaps for high 128 chars
------------------------------------------------------
INT 20 - Minix - SEND/RECEIVE MESSAGE
AX = process ID of other process
BX = pointer to message
CX = 1 send
2 receive
3 send&receive
Note: the message contains the system call number (numbered as in V7 Unix(tm))
and the call parameters
------------------------------------------------------
INT 20 - DOS - PROGRAM TERMINATION
returns to DOS--identical to INT 21/AH=00h
------------------------------------------------------
INT 21 - DOS - PROGRAM TERMINATION
AH = 00h
Return: never
------------------------------------------------------
INT 21 - DOS - KEYBOARD INPUT
AH = 01h
Return: AL = character read
Note: ^C/^Break are checked, and INT 23h executed if read
character is echoed to standard output
------------------------------------------------------
INT 21 - DOS - DISPLAY OUTPUT
AH = 02h
DL = character to send to standard output
Note: ^C/^Break are checked, and INT 23h executed if pressed
------------------------------------------------------
INT 21 - DOS - AUX INPUT
AH = 03h
Return: AL = character read
------------------------------------------------------
INT 21 - DOS - AUX OUTPUT
AH = 04h
DL = character to send
------------------------------------------------------
INT 21 - DOS - PRINTER OUTPUT
AH = 05h
DL = character to print
------------------------------------------------------
INT 21 - DOS - DIRECT CONSOLE I/O CHARACTER OUTPUT
AH = 06h
DL = character <> FFh
------------------------------------------------------
INT 21 - DOS - DIRECT CONSOLE I/O CHARACTER INPUT
AH = 06h
DL = 0FFh
Return: ZF set = no character
ZF clear = character recieved
AL = character
Notes: Character is echoed to STDOUT if received.
^C/^Break are NOT checked
------------------------------------------------------
INT 21 - DOS - DIRECT STDIN INPUT, NO ECHO
AH = 07h
Note: same as function 06h for input but char not echoed
------------------------------------------------------
INT 21 - DOS - KEYBOARD INPUT, NO ECHO
AH = 08h
Return: AL = character
Note: same as function 07h, but ^C/^Break are checked
------------------------------------------------------
INT 21 - DOS - PRINT STRING
AH = 09h
DS:DX = address of string terminated by "$"
Note: ^C/^Break checked, and INT 23h called if pressed
------------------------------------------------------
INT 21 - DOS - BUFFERED KEYBOARD INPUT
AH = 0Ah
DS:DX = address of buffer
Note: first byte of buffer must contain maximum length
on entry, second byte contains actual length of previous line which may
be recalled with the DOS line-editing commands
on return the second byte contains actual length, third and
subsequent bytes contain the input line
------------------------------------------------------
INT 21 - DOS - CHECK STANDARD INPUT STATUS
AH = 0Bh
Return: AL = FFh if character available
00h if no character
Note: ^C/^Break checked, and INT 23h called if pressed
------------------------------------------------------
INT 21 - DOS - CLEAR KEYBOARD BUFFER
AH = 0Ch
AL must be 1, 6, 7, 8, or 0Ah.
Notes: Flushes all typeahead input, then executes function specified by AL
(effectively moving it to AH and repeating the INT 21 call).
If AL contains a value not in the list above, the keyboard buffer is
flushed and no other action is taken.
------------------------------------------------------
INT 21 - DOS - DISK RESET
AH = 0Dh
Note: Flushes all disk buffers.
------------------------------------------------------
INT 21 - DOS - SELECT DISK
AH = 0Eh
DL = new default drive number (0 = A, 1 = B, etc.)
Return: AL = number of logical drives
------------------------------------------------------
INT 21 - DOS - OPEN DISK FILE
AH = 0Fh
DS:DX = address of FCB
Return: AL = 00h file found
FFh file not found
Note: (DOS 3.x) file opened in compatibility mode
------------------------------------------------------
INT 21 - DOS - CLOSE DISK FILE
AH = 10h
DS:DX = address of FCB
Return: AL = 00h directory update successful
FFh file not found in directory
------------------------------------------------------
INT 21 - DOS - SEARCH FIRST USING FCB
AH = 11h
DS:DX = address of FCB
Return: AL = status
00h file found
FFh file not found
Note: If file found, FCB is created at DTA address and set up to
OPEN or DELETE it.
------------------------------------------------------
INT 21 - DOS - SEARCH NEXT USING FCB
AH = 12h
DS:DX = address of FCB
Return: AL = status
00h file found
FFh file not found
Note: If file found, FCB is created at DTA address and set up to
OPEN or DELETE it.
------------------------------------------------------
INT 21 - DOS - DELETE FILE via FCB
AH = 13h
DS:DX = address of FCB with filename field filled with template for
deletion ('?' wildcard allowed)
Return: AL = status
00h file found
FFh file not found
------------------------------------------------------
INT 21 - DOS - SEQUENTIAL DISK FILE READ
AH = 14h
DS:DX = address of FCB
Return: AL = status
0 successful read
1 end of file
2 data transfer area too small
3 partial record, EOF
------------------------------------------------------
INT 21 - DOS - SEQUENTIAL DISK RECORD WRITE
AH = 15h
DS:DX = address of FCB
Return: AL = status
0 successful write
1 disk full
2 data transfer area too small
------------------------------------------------------
INT 21 - DOS - CREATE A DISK FILE
AH = 16h
DS:DX = address of FCB
Return: AL = status
00h successful creation
FFh directory full
Note: if file already exists, it is truncated to zero length
------------------------------------------------------
INT 21 - DOS - RENAME FILE via FCB
AH = 17h
DS:DX = address of FCB
FCB contains new name starting at byte 17h.
Return: AL = status
00h file found
FFh file not found
------------------------------------------------------
INT 21 - DOS Internal - UNUSED
AH = 18h
Return: AL = 0
------------------------------------------------------
INT 21 - DOS - GET DEFAULT DISK NUMBER
AH = 19h
Return: AL = current drive number (letter - 'A')
------------------------------------------------------
INT 21 - DOS - SET DISK TRANSFER AREA ADDRESS
AH = 1Ah
DS:DX = address of buffer
------------------------------------------------------
INT 21 - DOS - ALLOCATION TABLE INFORMATION
AH = 1Bh
Return: DS:BX points to FAT ID byte for default drive
DX = number of allocation units on disk
AL = number of sectors per allocation unit (cluster)
CX = number of bytes per sector
------------------------------------------------------
INT 21 - DOS - ALLOCATION TABLE INFORMATION FOR SPECIFIC DEVICE
AH = 1Ch
DL = Drive Number to check
Return: DS:BX points to FAT ID byte
DX = number of allocation units on disk
AL = number of sectors per allocation unit (cluster)
CX = number of bytes per sector
------------------------------------------------------
INT 21 - DOS Internal - UNUSED
AH = 1Dh
Return: AL = 0
------------------------------------------------------
INT 21 - DOS Internal - UNUSED
AH = 1Eh
Return: AL = 0
------------------------------------------------------
INT 21 - DOS Internal - GET DEFAULT DRIVE PARAMETER BLOCK
AH = 1Fh
Return: AL = 00h No Error
FFh Error
DS:BX -> drive parameter block
Note: for DOS 2.x and 3.x, this just invokes function 32h with DL = 0
------------------------------------------------------
INT 21 - DOS Internal - UNUSED
AH = 20h
Return: AL = 0
------------------------------------------------------
INT 21 - DOS - RANDOM DISK RECORD READ
AH = 21h
DS:DX = address of FCB
Return: AL = status
0 successful read
1 end of file
2 data transfer area too small
3 partial record, EOF
------------------------------------------------------
INT 21 - DOS - RANDOM DISK RECORD WRITE
AH = 22h
DS:DX = address of FCB
Return: AL = status (see AH = 21h above)
------------------------------------------------------
INT 21 - DOS - GET FILE SIZE
AH = 23h
DS:DX = address of unopened FCB with filename and record size fields
initialized
Return: AL = status
00h file found
FFh file not found
Note: FCB's random-record field set to number of records (rounded up)
------------------------------------------------------
INT 21 - DOS - SET RANDOM RECORD FIELD
AH = 24h
DS:DX = address of FCB
Return: Random Record Field of FCB is set to be same as Current Block
and Current Record.
Note: FCB must be OPEN already
------------------------------------------------------
INT 21 - DOS - SET INTERRUPT VECTOR
AH = 25h
AL = interrupt number
DS:DX = new vector to be used for specified interrupt
------------------------------------------------------
INT 21 - DOS - CREATE PSP
AH = 26h
DX = Segment number to set up PSP at
Return: Current PSP is copied to specified segment
Note: new PSP is updated with memory size information; INTs 22h, 23h, 24h
taken from interrupt vector table
------------------------------------------------------
INT 21 - DOS - RANDOM BLOCK READ
AH = 27h
DS:DX = address of FCB
CX = number of records to be read
Return: AL = status
0 successful read
1 end of file
2 data transfer area too small
3 partial record, EOF
------------------------------------------------------
INT 21 - DOS - RANDOM BLOCK WRITE
AH = 28h
DS:DX = address of FCB
CX = number of records to be written
if zero, truncate file to current random file position
Return: AL = status
0 successful write
1 disk full
2 data transfer area too small
------------------------------------------------------
INT 21 - DOS - PARSE FILENAME
AH = 29h
DS:SI -> string to parse
ES:DI -> buffer to fill with unopened FCB
AL = bit mask to control parsing
0 = 0: parsing stops if file separator found
1: leading separator ignored
1 = 0: drive number in FCB set to default drive if not present
in string
1: drive number in FCB not changed
2 = 0: filename in FCB set to blanks if no filename in string
1: filename in FCB not changed if string does not contain
a filename
3 = 0: extension in FCB set to blanks if no extension in string
1: extension left unchanged
Return: AL = 00h: no wildcards in name or extension
01h: wildcards appeared
FFh: drive specifier invalid
DS:SI -> first byte after parsed string
ES:DI buffer filled with unopened FCB
------------------------------------------------------
INT 21 - DOS - GET CURRENT DATE
AH = 2Ah
Return: DL = day
DH = month
CX = year
AL = day of the week (0=Sunday, 1=Monday, etc.)
------------------------------------------------------
INT 21 - DOS - SET CURRENT DATE
AH = 2Bh
DL = day
DH = month
CX = year
Return: AL = 00h if no error
= FFh if bad value sent to routine
Note: DOS 3.3 also sets CMOS clock
------------------------------------------------------
INT 21 - DESQview - INSTALLATION CHECK
AH = 2Bh
AL = subfunction (DV v2.00+)
01h get version
Return: BX = version (BH = major, BL = minor)
Note: early copies of v2.00 return 0002h
02h get shadow buffer info, and start shadowing
Return: BH = rows in shadow buffer
BL = columns in shadow buffer
DX = segment of shadow buffer
04h get shadow buffer info
Return: BH = rows in shadow buffer
BL = columns in shadow buffer
DX = segment of shadow buffer
05h stop shadowing
CX = 4445h ('DE')
DX = 5351h ('SQ')
Return: AL = FFh if DESQview not installed
Note: in DESQview v1.x, there were no subfunctions; this call only identified
whether or not DESQview was loaded
------------------------------------------------------
INT 21 - DOS - GET CURRENT TIME
AH = 2Ch
Return: CH = hours
CL = minutes
DH = seconds
DL = hundredths of seconds
Note: time is updated approximately every 5/100 second
------------------------------------------------------
INT 21 - DOS - SET CURRENT TIME
AH = 2Dh
CH = hours
CL = minutes
DH = seconds
DL = hundredths of seconds
Return: AL = 00h if no error
= FFh if bad value sent to routine
Note: DOS 3.3 also sets CMOS clock
------------------------------------------------------
INT 21 - DOS - SET VERIFY FLAG
AH = 2Eh
DL = 0
AL = 1 VERIFY on
0 VERIFY off
------------------------------------------------------
INT 21 - DOS 2+ - GET DISK TRANSFER AREA ADDRESS
AH = 2Fh
Return: ES:BX = address of DTA
------------------------------------------------------
INT 21 - DOS 2+ - GET DOS VERSION
AH = 30h
Return: AL = Major Version number (0 for DOS 1.x)
AH = Minor Version number
BH = OEM number
00h IBM
16h DEC
BL:CX = 24-bit user number
------------------------------------------------------
INT 21 - DOS 2+ - TERMINATE BUT STAY RESIDENT
AH = 31h
AL = exit code
DX = program size, in paragraphs
------------------------------------------------------
INT 21 - DOS Internal - GET DRIVE PARAMETER BLOCK
AH = 32h
DL = drive number
0 = default, 1 = A, etc.
Return: AL = 0FFh if invalid drive number, else
DS:BX = address of drive parameter block.
STRUCTURE OF DOS DRIVE PARAMETER BLOCK:
DPBLOCK STRUCT ;Offset
DISK_OFFSET DB ? ; 0 drive number (0 = A, etc.)
UNIT_OFFSET DB ? ; 1 unit number within device driver
SECTOR_SIZE DW ? ; 2 number of bytes per sector
MAX_CLUSTER DB ? ; 4 largest sector number in cluster
; add one for number of sectors/cluster
LOG2_SECTORS DB ? ; 5 log base two of the cluster size
RESERVED DW ? ; 6 number of reserved (boot) sectors
FAT_COUNT DB ? ; 8 number of copies of the FAT
ROOT_COUNT DW ? ; 9 number of root directory entries
DATA_START DW ? ; 11 first data sector on medium
MAX_NUMBER DW ? ; 13 largest possible cluster number
; subtract one for number of data clusters
FAT_SECTORS DB ? ; 15 number of sectors in one FAT copy
ROOT_START DW ? ; 16 first sector of root directory
DEVICE_ADDR DD ? ; 18 address of device driver for this drive
DESCRIPTOR DB ? ; 22 media descriptor byte for medium
VALID_BYTE DB ? ; 23 FFh indicates block must be rebuilt
(DOS 3.x) 00h indicates block accessed
NEXT_BLOCK DD ? ; 24 address of next device block in list
FFFFh indicates last block
; from this point on, DOS 3 differs from DOS 2:
IF DOS2
DIR_START DW ? ; 28 starting cluster of current directory
; zero indicates the root directory
PATH_NAME DB 64 DUP (?)
; 30 ASCIZ current directory path string
ELSE DOS3
; on my XT, this was always:
DW 0 ; probably unused, values left from before
DW 0FFFFh ; block was built
ENDIF
DPBLOCK ENDS
------------------------------------------------------
INT 21 - DOS 2+ - EXTENDED CONTROL-BREAK CHECKING
AH = 33h
AL = subfunction
00h get state
01h set state
DL = 0 for OFF or 1 for ON
02h internal, called by PRINT.COM (DOS 3.1)
Return: DL = current BREAK setting if AL = 00h
0 BREAK=OFF
1 BREAK=ON
AL = FFh if error
------------------------------------------------------
INT 21 - DOS Internal - RETURN CritSectFlag POINTER
AH = 34h
Return: ES:BX points to DOS "Critical Section Flag"
Notes:
When byte pointed to is zero, DOS is supposed to be safe to interrupt.
NOT RELIABLE according to Chris Dunford.
Examination of DOS 2.10 code in this area indicates that the byte
immediately FOLLOWING this "Critical Section Flag" must be 00 to permit the
PRINT.COM interrupt to be called.
For DOS 3.x (except COMPAQ DOS 3.0), the byte BEFORE the "Critical Section
Flag" must be zero, and for COMPAQ DOS 3.0, the byte 01AAh before it must
be zero.
------------------------------------------------------
INT 21 - DOS 2+ - GET INTERRUPT VECTOR
AH = 35h
AL = interrupt number
Return: ES:BX = value of interrupt vector
------------------------------------------------------
INT 21 - DOS 2+ - GET DISK SPACE
AH = 36h
DL = drive code (0 = default, 1 = A, 2 = B, etc.)
Return: AX = number of sectors per cluster
or 0FFFFh if invalid drive
BX = number of available clusters
CX = bytes per sector
DX = total clusters
Note: multiply AX x CX x BX for free space on disk
multiply AX x CX x DX for total disk space
------------------------------------------------------
INT 21 - DOS Internal - SWITCHAR/AVAILDEV
AH = 37h
AL = subfunction
0 Read switch character (returns current character in DL)
1 Set switch character (specify new character in DL)
2 (DOS 2.x only) Read device availability (as set by function AL=3)
3 (DOS 2.x only) Set device availability, where:
DL = 0 means /DEV/ must preceed device names
DL <> 0 means /DEV/ need not preceed device names
Return: DL = Switch character (if AL=0 or 1)
Device availability flag (if AL=2 or 3)
AL=0FFh means the value in AL was not in the range 0-3.
------------------------------------------------------
INT 21 - DOS 2+ - GET COUNTRY-DEPENDENT INFORMATION
AH = 38h
--DOS 2.x--
AL = 0 get current-country info
DS:DX = segment:offset of buffer for returned info
Return: BX = country code
buffer at DS:DX filled as follows:
bytes 0-1 = date format 0 = USA mm dd yy
1 = Europe dd mm yy
2 = Japan yy mm dd
byte 2 = currency symbol
byte 3 = 00h
byte 4 = thousands separator char
byte 5 = 00h
byte 6 = decimal separator char
byte 7 = 00h
bytes 8-1Fh reserved
--DOS 3.x--
AL = 0 for current country
AL = 01h thru 0FEh for specific country with code <255
AL = 0FFh for specific country with code >= 255
BX = 16-bit country code
DS:DX = segment:offset of buffer for returned info
DX = 0FFFFh if setting country code, rather than getting info
Return: (if DX <> 0FFFFh)
BX = country code
DS:DX filled in:
bytes 0-1 = date format (see above)
bytes 2-6 = currency symbol string, ASCIZ
byte 7 = thousands seaprator char
byte 8 = 00h
byte 9 = decimal separator char
byte 0Ah = 00h
byte 0Bh = date separator char
byte 0Ch = 00h
byte 0Dh = time separator char
byte 0Eh = 00h
byte 0Fh = currency format
bit 2 = set if currency symbol replaces decimal pt
bit 1 = number of spaces between value and curr sym
bit 0 = 0 if currency symbol precedes value
1 if currency symbol follows value
byte 10h = number of digits after decimal in currency
byte 11h = time format
bit 0 = 0 if 12-hour clock
1 if 24-hour clock
bytes 12h-15h = address of case map routine (FAR CALL, AL = char)
byte 16h = data-list separator char
byte 17h = 00h
bytes 18h-21h reserved
If error:
CF set
AX = error code
------------------------------------------------------
INT 21 - DOS 2+ - CREATE A SUBDIRECTORY (MKDIR)
AH = 39h
DS:DX = address of ASCIZ pathname
Return: CF = 1 if error
AX = Error Code
------------------------------------------------------
INT 21 - DOS 2+ - REMOVE A DIRECTORY ENTRY (RMDIR)
AH = 3Ah
DS:DX = address of ASCIZ pathname
Return: CF = 1 if error
AX = Error Code
------------------------------------------------------
INT 21 - DOS 2+ - CHANGE THE CURRENT DIRECTORY (CHDIR)
AH = 3Bh
DS:DX = address of ASCIZ directory name
Return: CF = 1 if error
AX = Error Code
------------------------------------------------------
INT 21 - DOS 2+ - CREATE A FILE WITH HANDLE (CREAT)
AH = 3Ch
CX = attributes for file
DS:DX = address of ASCIZ filename
Return: CF = 1 if error
AX = Error Code
CF = 0 successful
AX = file handle
------------------------------------------------------
INT 21 - DOS 2+ - OPEN DISK FILE WITH HANDLE
AH = 3Dh
AL = access code
0 = Read Only
1 = Write Only
2 = Read/Write
AL bits 7-3 = file-sharing modes (DOS 3.x)
bit 7 = inheritance flag, set for no inheritance
bits 4-6 = sharing mode
000 compatibility mode
001 exclusive (deny all)
010 write access denied (deny write)
011 read access denied (deny read)
100 full access permitted (deny none)
bit 3 = reserved, should be zero
DS:DX = address of ASCIZ filename
Return: CF = 1 if error
AX = Error Code
CF = 0 successful
AX = file handle
------------------------------------------------------
INT 21 - DOS 2+ - CLOSE A FILE WITH HANDLE
AH = 3Eh
BX = file handle
Return: CF = 1 if error
AX = Error Code
------------------------------------------------------
INT 21 - DOS 2+ - READ FROM FILE WITH HANDLE
AH = 3Fh
BX = file handle
CX = number of bytes to read
DS:DX = address of buffer
Return: CF = 1 if error
AX = Error Code
CF = 0 successful
AX = number of bytes read
------------------------------------------------------
INT 21 - DOS 2+ - WRITE TO FILE WITH HANDLE
AH = 40h
BX = file handle
CX = number of bytes to write
DS:DX -> buffer
Return: CF = 1 if error
AX = Error Code
CF = 0 successful
AX = number of bytes written
Note: if CX is zero, no data is written, and the file is truncated or extended
to the current position
------------------------------------------------------
INT 21 - DOS 2+ - DELETE A FILE (UNLINK)
AH = 41h
DS:DX -> ASCIZ name of file to delete
Return: CF = 1 if error
AX = Error Code
------------------------------------------------------
INT 21 - DOS 2+ - MOVE FILE READ/WRITE POINTER (LSEEK)
AH = 42h
AL = method value
0 = offset from beginning of file
1 = offset from present location
2 = offset from end of file
BX = file handle
CX:DX = offset in bytes
Return: CF = 1 if error
AX = Error Code
CF = 0 successful
DX:AX = new offset
------------------------------------------------------
INT 21 - DOS 2+ - GET/PUT FILE ATTRIBUTES (CHMOD)
AH = 43h
AL =
0 = get file attributes
1 = put file attributes
CX = file attribute bits
0 = read only
1 = hidden file
2 = system file
3 = volume label
4 = subdirectory
5 = written since backup
DS:DX -> ASCIZ file name
Return: CF = 1 if error
AX = Error Code if any
CX = file attributes on get
------------------------------------------------------
INT 21 - DOS 2+ - IOCTL - GET DEVICE INFORMATION
AX = 4400h
BX = file or device handle
Return: CF set on error
AX = error code
CF clear if successful
DX = device info
If bit 7 set: (character device)
bit 0: console input device
1: console output device
2: NUL device
3: CLOCK$ device
4: device is special
5: binary (raw) mode
6: Not EOF
12: network device (DOS 3.x)
14: can process IOCTL control strings (func 2-5)
If bit 7 clear: (file)
bits 0-5 are block device number
6: file has not been written
12: Network device (DOS 3.x)
15: file is remote (DOS 3.x)
------------------------------------------------------
INT 21 - DOS 2+ - IOCTL - SET DEVICE INFORMATION
AX = 4401h
BX = device handle
DH = 0
DL = device information to set (bits 0-7 from function 0)
Return: CF set on error
AX = error code
------------------------------------------------------
INT 21 - DOS 2+ - IOCTL - READ DEVICE CONTROL STRING
AX = 4402h
BX = device handle
CX = number of bytes to read
DS:DX -> buffer
Return: CF set on error
AX = error code
CF clear if successful
AX = number of bytes read
------------------------------------------------------
INT 21 - DOS 2+ - IOCTL - WRITE DEVICE CONTROL STRING
AX = 4403h
BX = device handle
CX = number of bytes to write
DS:DX -> buffer
Return: CF set on error
AX = error code
CF clear if successful
AX = number of bytes written
------------------------------------------------------
INT 21 - DOS 2+ - IOCTL - READ BLOCK DEVICE CONTROL STRING
AX = 4404h
BL = drive number (0=default)
CX = number of bytes to read
DS:DX -> buffer
Return: CF set on error
AX = error code
CF clear if successful
AX = number of bytes read
------------------------------------------------------
INT 21 - DOS 2+ - IOCTL - WRITE BLOCK DEVICE CONTROL STRING
AX = 4405h
BL = drive number (0=default)
CX = number of bytes to write
DS:DX -> buffer
Return: CF set on error
AX = error code
CF clear if successful
AX = number of bytes written
------------------------------------------------------
INT 21 - DOS 2+ - IOCTL - GET OUTPUT STATUS
AX = 4406h
BX = file or device handle
Return: AL = FFh device ready
00h device not ready
------------------------------------------------------
INT 21 - DOS 2+ - IOCTL - GET OUTPUT STATUS
AX = 4407h
BX = file or device handle
Return: AL = FFh device ready
00h device not ready
Note: for DOS 2.x, files are always ready for output
------------------------------------------------------
INT 21 - DOS 3.x - IOCTL - BLOCK DEVICE CHANGEABLE
AX = 4408h
BL = drive number (0=default)
Return: AX = 00h removable
01h fixed
0Fh invalid drive
------------------------------------------------------
INT 21 - DOS 3.x - IOCTL - BLOCK DEVICE LOCAL
AX = 4409h
BL = drive number (0=default)
Return: DX = attribute word, bit 12 set if device is remote
------------------------------------------------------
INT 21 - DOS 3.x - IOCTL - HANDLE LOCAL
AX = 440Ah
BX = file handle
Return: DX = attribute word, bit 15 set if file is remote
------------------------------------------------------
INT 21 - DOS 3.x - IOCTL - SET SHARING RETRY COUNT
AX = 440Bh
CX = delay (default 1)
DX = retry count (default 3)
Return: CF set on error
AX = error code
------------------------------------------------------
INT 21 - DOS 3.3 - IOCTL - GENERIC
AX = 440Ch
BX = device handle
CH = major subfunction
CL = minor subfunction
DS:DX -> parameter block
Return: CF = 1 if error
AX = Error Code
------------------------------------------------------
INT 21 - DOS 3.3 - IOCTL - BLOCK DEVICE REQUEST
AX = 440Dh
BL = drive number (0=default)
CH = major subfunction
08h
CL = minor subfunction
40h set device parameters
41h write logical device track
42h format and verify logical device track
60h get device parameters
61h read logical device track
62h verify logical device track
DS:DX -> parameter block
Return: CF set on error
AX = error code
------------------------------------------------------
INT 21 - DOS 3.3 - IOCTL - GET LOGICAL DEVICE
AX = 440Eh
BL = drive number (0=default)
Return: CF set on error
AX = error code
CF clear if successful
AL = 0 block device has only one logical drive assigned
1..n the last letter used to reference the device (1=A:,etc)
------------------------------------------------------
INT 21 - DOS 3.3 - IOCTL - SET LOGICAL DEVICE
AX = 440Fh
BL = drive number (0=default)
the drive is forced to appear as drive BL (???)
Return: CF set on error
AX = error code
------------------------------------------------------
INT 21 - DOS 2+ - CREATE DUPLICATE HANDLE (DUP)
AH = 45h
BX = file handle to duplicate
Return: CF = 1 if error
AX = Error Code
CF = 0 successful
AX = new file handle
------------------------------------------------------
INT 21 - DOS 2+ - FORCE DUPLICATE HANDLE (FORCDUP,DUP2)
AH = 46h
BX = Existing file handle
CX = new file handle
Return: CF = 1 if error
AX = Error Code
------------------------------------------------------
INT 21 - DOS 2+ - GET CURRENT DIRECTORY
AH = 47h
DL = drive (0=default, 1=A, etc.)
DS:SI points to 64-byte buffer area
Return: CF = 1 if error
AX = Error Code
Note: the returned path does not include the initial backslash
------------------------------------------------------
INT 21 - DOS 2+ - ALLOCATE MEMORY
AH = 48h
BX = number of 16-byte paragraphs desired
Return: CF = 1 if error
AX = Error Code
BX = Maximum available
CF = 0 successful
AX = segment of allocated memory block
------------------------------------------------------
INT 21 - DOS 2+ - FREE MEMORY
AH = 49h
ES = Segment address of area to be freed
Return: CF = 1 if error
AX = Error Code
------------------------------------------------------
INT 21 - DOS 2+ - ADJUST MEMORY BLOCK SIZE (SETBLOCK)
AH = 4Ah
ES = Segment address of block to change
BX = New size in paragraphs
Return: CF = 1 if error
AX = Error Code
BX = Maximum size possible for the block
------------------------------------------------------
INT 21 - DOS 2+ - LOAD OR EXECUTE (EXEC)
AH = 4Bh
AL = subfunction
0 = load and execute program
1 = load but do not execute (internal, DOS 3.x & DESQview only)
2 = load but do not execute (internal, DOS 2.x only)
3 = load overlay; do not create PSP
DS:DX = filename
ES:BX = parameter block
AL =
0: WORD segment of environment (0 = use current)
DWORD -> command line
DWORD -> FCB 1
DWORD -> FCB 2
1: WORD segment of environment (0 = use current)
DWORD -> command line
DWORD -> FCB 1
DWORD -> FCB 2
DWORD will hold SS:SP on return
DWORD will hold program entry point (CS:IP) on return
2: WORD segment of environment (0 = use current)
DWORD -> command line
DWORD -> FCB 1
DWORD -> FCB 2
3: WORD segment load address
WORD segment relocation factor
Return: CF = 1 if error
AX = Error Code
CF = 0
if function 1, process ID set to new program's PSP; get with
function 62h
if function 2, new program's initial stack and entry point
returned in registers
struct exec { /* structure of .EXE file header */
unsigned exec_magic; /* 0x4d, 0x5a signature */
unsigned exec_isr; /* image size remainder (mod 512) */
unsigned exec_size; /* file size in pages (512) */
unsigned exec_nrel; /* number of relocation items */
unsigned exec_hsize; /* header size in paragraphs */
unsigned exec_min; /* minimum extra paragraphs */
unsigned exec_max; /* maximum extra paragraphs */
unsigned exec_ss; /* stack segment */
unsigned exec_sp; /* stack offset */
unsigned exec_cksum; /* word checksum of entire file */
unsigned exec_pc; /* initial pc */
unsigned exec_cs; /* code segment */
unsigned exec_orel; /* offset of relocation table */
unsigned exec_ovno; /* overlay number */
};
------------------------------------------------------
INT 21 - DOS 2+ - QUIT WITH EXIT CODE (EXIT)
AH = 4Ch
AL = exit code
Return: never returns
------------------------------------------------------
INT 21 - DOS 2+ - GET EXIT CODE OF SUBPROGRAM (WAIT)
AH = 4Dh
Return: AL = exit code of subprogram (functions 31h or 4Ch)
AH = circumstance which caused termination
0 = Terminate/abort
1 = Control-C
2 = Hard error
3 = Terminate and stay resident
------------------------------------------------------
INT 21 - DOS 2+ - FIND FIRST ASCIZ (FIND FIRST)
AH = 4Eh
CX = search attributes
DS:DX -> ASCIZ filename
Return: CF = 1 if error
AX = Error Code if any
[DTA] = data block
undocumented fields
PC-DOS 3.10
byte 00h: drive letter
bytes 01h-0Bh: search template
byte 0Ch: search attributes
DOS 2.x (and DOS 3.x except 3.1???)
byte 00h: search attributes
byte 01h: drive letter
bytes 02h-0Ch: search template
bytes 0Dh-0Eh: entry count within directory
bytes 0Fh-12h: reserved
bytes 13h-14h: cluster number of parent directory
byte 15h: attribute of file found
bytes 16h-17h: file time
bytes 18h-19h: file date
bytes 1Ah-1Dh: file size
bytes 1Eh-3Ah: ASCIZ filename+extension
------------------------------------------------------
INT 21 - DOS 2+ - FIND NEXT ASCIZ (FIND NEXT)
AH = 4Fh
[DTA] = data block from last AH = 4Eh/4Fh call
Return: CF = 1 if error
AX = Error Code
[DTA] = data block, see AH = 4Eh above
------------------------------------------------------
INT 21 - DOS Internal - SET PSP SEGMENT
AH = 50h
BX = Segment address of new PSP
Note: under DOS 2.xx, this function cannot be invoked inside an INT 28h handler
without setting the Critical Error flag
------------------------------------------------------
INT 21 - DOS Internal - GET PSP SEGMENT
AH = 51h
Return: BX = Current PSP Segment
struct psp {
char psp_int20[2]; /* 00h: program exit point */
unsigned psp_msize; /* 02h: memory size in paragraphs */
char psp_res0[1]; /* 04h: unused (0) */
char psp_dos[5]; /* 05h: CP/M entry point (far call to DOS) */
int (*psp_term)(); /* 0Ah: terminate address (old INT 22h) */
unsigned psp_tseg; /* 0Ch: terminate segment */
int (*psp_break)(); /* 0Eh: break address (old INT 23h) */
unsigned psp_bseg; /* 10h: break segment */
int (*psp_error)(); /* 12h: error address (old INT 24h) */
unsigned psp_eseg; /* 14h: error segment */
unsigned psp_ppsp; /* 16h: parent PSP segment */
char psp_ofile[20]; /* 18h: DOS 2+ open files, FFh = unused */
unsigned psp_envp; /* 2Ch: DOS 2+ environment segment */
char far *psp_oldstack; /* 2Eh: far ptr to process's SS:SP */
int psp_nfiles; /* 32h: DOS 3.x max open files */
char *psp_aofile; /* 34h: DOS 3.x openfile table address */
unsigned psp_aoseg; /* 36h: DOS 3.x openfile table segment */
char psp_res3[24]; /* 38h: unused by DOS versions <= 3.3 */
char psp_int21[3]; /* 50h: DOS function dispatcher (FAR routine)*/
char psp_res4[2]; /* 53h: unused */
char psp_xfcb1[7]; /* 55h: FCB #1 extension */
char psp_fcb1[16]; /* 5Ch: FCB #1 */
char psp_fcb2[20]; /* 6Ch: FCB #2 */
char psp_dma[128]; /* 80h: Command Tail / default DTA buffer */
};
Note: under DOS 2.xx, this function cannot be invoked inside an INT 28h handler
without setting the Critical Error flag
------------------------------------------------------
INT 21 - DOS Internal - GET LIST OF LISTS
AH = 52h
Return: ES:BX points to DOS list of lists
List of Lists:
Bytes Value
-2&-1 Segment of first memory control block
00h-03h Pointer to first DOS disk block (see function 36h)
04h-07h Pointer to list of DOS file tables
DWORD pointer to next file table
WORD number of files in this table
35h bytes per file
00h-01h number of file handles referring to this file
02h-06h ???
07h-0Ah Pointer to device driver header if character device
Pointer to DOS Device Control Block if block device (see
func 32h for format)
0Bh-1Fh ???
20h-2Ah filename in FCB format (no path, no period, blank-padded)
2Bh-2Ch PSP segment of file's owner
2Dh-30h ??? I see 0 always
31h-32h ???
33h-34h ???
08h-0Bh Pointer to CLOCK$ device driver, whether installable or resident
0Ch-0Fh Pointer to actual CON: device driver, whether installable or resident
-----DOS 2.x
10h Number of logical drives in system
11h-12h Maximum bytes/block of any block device
13h-16h ???
17h Beginning (not a pointer--the real beginning!) of NUL device driver.
This is the first device on DOS's linked list of device drivers.
-----DOS 3.x
10h-11h Maximum bytes/block of any block device
12h-15h Pointer to first disk buffer
16h-19h Pointer to array of drive info:
51h bytes per drive, starting with A: ...
00-3F Current path as ASCIZ, starting with 'x:\'
40-43 ??? I see zeros always
44 ??? Flags? I see 40h, except entry after last valid entry = 00h
45-48 Pointer to DOS Disk Block for this drive
49-4A ??? Current track or block? -1 if never accessed.
4B-4E ??? I see -1 always
4F-50 ??? I see 2 always
1Ah-1Dh Pointer to FCB table (if CONFIG.SYS contains FCBS=)
1Eh-1Fh Size of FCB table
20h Number of block devices
21h Value of LASTDRIVE command in CONFIG.SYS (default 5)
22h Beginning (not a pointer--the real beginning!) of NUL device driver.
This is the first device on DOS's linked list of device drivers.
------------------------------------------------------
INT 21 - DOS Internal - TRANSLATE BPB
AH = 53h
DS:SI points to BPB (Bios Parameter Block)
ES:BP points to area for DOS Disk Block
Translates BPB (Bios Parameter Block, see below) into a DOS Disk Block
(see function call 32h).
BPB
Bytes Value
0-1 Bytes/sector. Get from DDB bytes 2-3.
2 Sectors/cluster. Get from (DDB byte 4) + 1
3-4 Reserved sectors. Get from DDB bytes 6-7
5 Number of FATs. Get from DDB byte 8
6-7 Number of root dir entries. Get from DDB bytes 09h-0Ah
8-9 Total # of sectors. Get from:
((DDB bytes D-E) - 1) * (sectors per cluster (BPB byte 2))
+ (DDB Bytes B-C)
A Media descriptor byte. Get from DDB byte 16h
B-C Number of sectors/FAT. Get from DDB byte 0Fh
------------------------------------------------------
INT 21 - DOS 2+ - GET VERIFY FLAG
AH = 54h
Return: AL = 0 if flag OFF
AL = 1 if flag ON
------------------------------------------------------
INT 21 - DOS Internal - CREATE PSP
AH = 55h
DX = segment number at which to set up PSP
Note: Like func 26h but creates "child" PSP rather than copying existing one.
------------------------------------------------------
INT 21 - DOS 2+ - RENAME A FILE
AH = 56h
DS:DX -> ASCIZ old name
ES:DI -> ASCIZ new name
Return: CF = 1 if error
AX = Error Code
Note: allows move between directories on same logical volume
(DOS 3.x) allows renaming of directories
------------------------------------------------------
INT 21 - DOS 2+ - GET/SET FILE'S DATE/TIME
AH = 57h
AL = function code
0 = get date and time
Return: CX = time of last write
DX = date of last write
1 = set date and time
CX = time to be set
DX = date to be set
BX = file handle
Return: CF = 1 if error
AX = Error Code
------------------------------------------------------
INT 21 - DOS 3.x - GET/SET MEMORY ALLOCATION STRATEGY
AH = 58h
AL = function code
0 = get allocation strategy
1 = set allocation strategy
BL = strategy code
0 first fit (use first memory block large enough)
1 best fit (use smallest memory block large enough)
2 last fit (use high part of last usable memory block)
Return: CF = 1 error
AX = error code
CF = 0 successful
AX = strategy code
Note: the Set subfunction accepts any value in BL; 2 or greater means last fit.
the Get subfunction returns the last value set, so programs should check
whether the value is >= 2, not just equal to 2.
------------------------------------------------------
INT 21 - DOS 3.x - GET EXTENDED ERROR CODE
AH = 59h
BX = version code (0000 for DOS 3.x)
Return: AX = extended error code
BH = class of error
BL = suggested action code
CH = locus (where error occurred)
CL, DX, SI, DI, BP, DS, and ES destroyed
Error codes:
01h function number invalid
02h file not found
03h path not found
04h too many open files
05h access denied
06h invalid handle
07h memory control block destroyed
08h insufficient memory
09h memory block address invalid
0Ah environment invalid
0Bh format invalid
0Ch access code invalid
0Dh data invalid
0Fh invalid drive
10h attempted to remove current directory
11h not same device
12h no more files
13h disk write-protected
14h unknown unit
15h drive not ready
16h unknown command
17h data error (CRC)
18h bad request structure length
19h seek error
1Ah unknwon media type
1Bh sector not found
1Ch printer out of paper
1Dh write fault
1Eh read fault
1Fh general failure
20h sharing violation
21h lock violation
22h disk change invalid
23h FCB unavailable
24h sharing buffer overflow
25h-31h reserved
32h Network request not supported (DOS 3.1 + MS Networks)
33h Remote computer not listening
34h Duplicate name on network
35h Network name not found
36h Network busy
37h Network device no longer exists
38h Network BIOS command limit exceeded
39h Network adapter hardware error
3Ah Incorrect response from network
3Bh Unexpected network error
3Ch Incompatible remote adapter
3Dh Print queue full
3Eh Queue not full
3Fh Not enough space to print file
40h Network name was deleted
41h Network: Access denied
42h Network device type incorrect
43h Network name not found
44h Network name limit exceeded
45h Network BIOS session limit exceeded
46h Temporarily paused
47h Network request not accepted
48h Print/disk redirection paused (DOS 3.1 + MS Networks)
49h-4Fh reserved
50h file exists
51h reserved
52h cannot make directory
53h fail on INT 24h
54h (DOS 3.3) too many redirections
55h (DOS 3.3) duplicate redirection
56h (DOS 3.3) invalid password
57h (DOS 3.3) invalid parameter
58h (DOS 3.3) network data fault
Error Classes:
01h out of resource
02h temporary situation
03h authorization (denied access)
04h internal
05h hardware failure
06h system failure
07h application program error
08h not found
09h bad format
0Ah locked
0Bh media error
0Ch already exists
0Dh unknown
Suggested Action:
01h retry
02h delayed retry
03h prompt user
04h abort after cleanup
05h immediate abort
06h ignore
07h retry after user intervention
Error Locus:
01h unknown or not appropriate
02h block device
03h network related
04h serial device
05h memory related
------------------------------------------------------
INT 21 - DOS 3.x - CREATE UNIQUE FILE
AH = 5Ah
DS:DX -> ASCIZ directory path name ending with a '\'
CX = file attribute
Return: CF = 1 if error
AX = Error Code if any
DS:DX = path name
Note: The file created is not truly "temporary". It MUST be removed by the
user.
------------------------------------------------------
INT 21 - DOS 3.x - CREATE NEW FILE
AH = 5Bh
DS:DX -> ASCIZ directory path name
CX = file attribute
Return: CF = 1 if error
AX = Error Code if any
DS:DX = path name
Note: Unlike function 3Ch, function 5Bh will fail if the file already exists.
------------------------------------------------------
INT 21 - DOS 3.x - LOCK/UNLOCK FILE ACCESS
AH = 5Ch
AL = 0 if lock
1 if unlock
BX = file handle
CX:DX = starting offset of region to lock
SI:DI = size of region to lock
Return: CF = 1 if error
AX = Error Code
------------------------------------------------------
INT 21 - DOS 3.x Internal - GET ADDRESS OF CRITICAL ERROR FLAG
AX = 5D06h
Return: DS:SI -> critical error flag
CX = ???
DX = ???
Notes: this call also does a lot of other work in addition to returning the
pointer
setting CritErr flag allows use of functions 50h/51h from INT 28h under
DOS 2.x by forcing use of correct stack
------------------------------------------------------
INT 21 - DOS 3.x Internal - ???
AH = 5Dh
AL = subfunction
07h: ???
08h: (used by COMMAND.COM)
09h: (used by COMMAND.COM)
------------------------------------------------------
INT 21 - DOS 3.1+ internal - SET EXTENDED ERROR INFORMATION
AX = 5D0Ah
DS:DX = address of 11-word error information
words 0 to 7: values of AX,BX,CX,DX,SI,DI,DS,ES that func 59h
will return
words 8 to 10: zero (reserved)
------------------------------------------------------
INT 21 - DOS 3.1 + Microsoft Networks - GET MACHINE NAME
AX = 5E00h
DS:DX -> buffer for ASCIZ name
Return: CF = 1 if error
AX = Error Code
CH = 0 if name not defined
CL = NETBIOS name number
DS:DX -> pointer to identifier if CH <> 0
------------------------------------------------------
INT 21 - DOS 3.1 + Microsoft Networks - SET MACHINE NAME
AX = 5E01h
DS:DX -> ASCIZ name
CL = name number
CH = ???
------------------------------------------------------
INT 21 - DOS 3.1 + Microsoft Networks - SET PRINTER SETUP
AX = 5E02h
BX = Redirection list index
CX = length of setup string <= 64
DS:SI -> string buffer
Return: CF = 1 if error
AX = Error Code
------------------------------------------------------
INT 21 - DOS 3.1 + Microsoft Networks - GET PRINTER SETUP
AX = 5E03h
BX = Redirection list index
ES:DI -> string buffer
Return: CF = 1 if error
AX = Error Code
CX = length of setup string <= 64
------------------------------------------------------
INT 21 - DOS 3.1 + Microsoft Networks - GET REDIRECTION LIST ENTRY
AX = 5F02h
BX = Redirection list index
DS:SI -> 16 char local device name buffer
ES:DI -> 128 char network name buffer
Return: CF = 1 if error
AX = Error Code
BH = Device status flag (BIT 0 = 0 if valid)
BL = device type (03 if printer, 04 if drive)
CX = stored parameter value
Note: DX and BP are destroyed by this call!
------------------------------------------------------
INT 21 - DOS 3.1 + Microsoft Networks - REDIRECT DEVICE
AX = 5F03h
BL = device type
03 = printer device
04 = file device
CX = stored parameter value
DS:SI -> source device name
ES:DI -> destination ASCIZ network path + ASCIZ password
Return: CF = 1 if error
AX = Error Code
------------------------------------------------------
INT 21 - DOS 3.1 + Microsoft Networks - CANCEL REDIRECTION
AX = 5F04h
DS:SI -> device name or network path
Return: CF = 1 if error
AX = Error Code
------------------------------------------------------
INT 21 - DOS 3.x Internal - RESOLVE PATH STRING TO FULLY QUALIFIED PATH STRING
AH = 60h
DS:SI = relative path string
ES:DI = buffer for fully qualified name
Return: buffer filled with qualified name; may return error code, unknown.
------------------------------------------------------
INT 21 - DOS 3.x Internal - UNUSED
AH = 61h
Return: AL = 0
------------------------------------------------------
INT 21 - DOS 3.x - GET PSP ADDRESS
AH = 62h
Return: BX = segment address of PSP
------------------------------------------------------
INT 21 - DOS 2.25 only - GET LEAD BYTE TABLE
AH = 63h
AL = subfunction
0 = get system lead byte table
1 = set/clear interim console flag
DL = 1/0 to set/clear interim console flag
2 = get interim console flag
Return: DS:SI -> lead byte table (AL = 0)
DL = interim console flag (AL = 2)
------------------------------------------------------
INT 21 - DOS 3.3 Internal - ???
AH = 64h
------------------------------------------------------
INT 21 - DOS 3.3 - GET EXTENDED COUNTRY INFORMATION
AH = 65h
AL = info ID (1 - 6)
BX = code page (-1=global code page)
DX = country ID (-1=current country)
ES:DI -> country information buffer
CX = size of buffer
Return: AX = error code if carry set, otherwise
CX = size of country information returned
ES:DI -> country information:
1 BYTE info ID
if info ID <> 1
1 DWORD pointer to information
if info ID == 1
1 WORD size
1 WORD country ID
1 WORD code page
34 BYTE see function 38h
------------------------------------------------------
INT 21 - DOS 3.3 - GET/SET GLOBAL CODE PAGE TABLE
AH = 66h
AL = 00h get global code page
Return: AX = error code if carry flag set
BX = active code page
DX = system code page
= 01h set global page
BX = active code page
437 US
850 ???
860 Portugal
863 Canada (French)
865 Norway/Denmark
DX = system code page (active page at boot time)
Return: AX = error code if carry flag set
------------------------------------------------------
INT 21 - DOS 3.3 - SET HANDLE COUNT
AH = 67h
BX = desired number of handles (max 255)
Return: Carry set if error (and error code in AX)
------------------------------------------------------
INT 21 - DOS 3.3 - COMMIT FILE, WRITE ALL BUFFERED DATA TO DISK
AH = 68h
BX = file handle
Return: carry flag set on error (and error code in AX)
------------------------------------------------------
INT 21 - DOS 4.0 - EXTENDED OPEN/CREATE
AX = 6C00h
BL = open mode as in AL for normal open
--
{harvard,uunet,ucbvax}!b.gp.cs.cmu.edu!ralf -=-=- AT&T: (412)268-3053 (school)
ARPA: RALF@B.GP.CS.CMU.EDU |"Tolerance means excusing the mistakes others make.
FIDO: Ralf Brown at 129/31 | Tact means not noticing them." --Arthur Schnitzler
BITnet: RALF%B.GP.CS.CMU.EDU@CMUCCVMA -=-=- DISCLAIMER? I claimed something?