UMBCCMSC 211 |
Func | Purpose | Input | Output | Description | Comments | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
00h | Program Termination | AH = 00h CS = segment address of PSP |
nothing | Terminates execution of the current process and returns control of the parent process. | COM programs store the segment address of the Program Segment Prefix (PSP) in the CS register automatically. For an EXE program, do not use this function, use Function 31H or 4Ch instead. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
01h | Keyboard Input | AH = 01h | AL = character read | Reads a character from a standard input device and displays it on the standard output device. When the function is called, it waits until a character is available. This can be redirected. | This function must be called twice to read extended ASCII codes on IBM and compatible PCs. The first call returns 0 in the AL register. If the character being read is the Ctrl-C character and input is not redirected, this function calls interrupt 23h. If standard input has been redirected, a Ctrl-C character is read and BREAK is ON, then this function calls interrupt 23h. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
02h | Display Output | AH = 02h DL = character to send to standard output |
nothing | Displays a character on the standard output device. This can be redirected. | If standard output has not been redirected, then control codes such as backspace, carriage return and linefeed are preformed when this function sends characters to the screen. If output has been redirected, these codes are sent to the file as ordinary ASCII codes. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
03h | Auxiliary Input | AH = 03h | AL = character read | Reads a character from the serial port. The default is the COM1. The MODE command can redirect serial access. | In most systems, the serial device has no internal buffer and is not interrupt driven. This means that it can send data faster than programs can read them. All unread characters may be lost. Before calling this function, you must initialize the serial port by performing the MODE command. When starting up, the serial port is initialized to 2400 baud, one stop bit, no parity, and 8 data bits The ROM BIOS functions of INT 14h are more efficient for accessing the serial port. This interrupt can be used to obrtain the status of the auxiliary device, which make them more flexible. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
04h | Auxiliary Output | AH = 04h DL = character to send |
nothing | Sends a character to the serial port. The default is the COM1. The MODE command can redirect serial access. | See comments for 03h. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
05h | Printer Output | AH = 05h DL = character to print |
nothing | Sends a character to the standard list device. By default, this is LPT1:. The MODE command allows you to redirect printer access. | The function transmits the character only when the output device is ready to accept it. The functions of the ROM BIOS IN 17h are more efficient for accessing the printer. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
06h | Direct Console Character I/O | AH = 06h DL = 00h - FEh sends a character DL = FFh - reads a character |
Character output: nothing Character input: no character ready: ZF = 1: No character ready Character received: ZF = 0 ; Character received AL = character read |
Reads a character from the standard input device and writes a character to the standard output device. This function is used to read and write all possible characters and control codes without examining them (e.g., Ctrl-C has not effect on the program). Input and output for standard devices can be redirected. This funtion does not test whether the floppy disk or hard disk is full when it is writing. Neither can it tell whether all the characters have been read from the input device. | This function must be called twice to read extended ASCII codes on PCs. The first call returns 0 in the AL register (this indicates presence of an extended code). This function cannot display blanks (ASCII code 255) because it interprets that value as a command to input a character. If a character is receceived, it is oched to STDOUT. Ctrl-C or Crtl-Break are not checked. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
07h | Unfiltered Character Input Without Echo | AH = 07h | AL = Character | Reads a character from the standard input device without displaying it on the standard output device. If the character is not ready when the function is called it waits until a character is available. Input to a standard device can be redirected. The OS does not test the input character. | To read extended ASCII codes, the function must be called twice. The first call returns 0 in the AL register, indicating an extended code. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
08h | Character Input Without Echo | AH = 08h | AL = Character | Reads a character from the standard input device without displaying it on the standard output device. If the character is not ready, it waits until a character is available. | To read extended ASCII codes, the function must be called twice. The first call returns 0 in the AL register, indicating an extended code. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
09h | Display ASCIIZ String | AH = 09h DS:DX = segment:offset of the string |
nothing | Displays a character string to the standard output device. | The string must be terminated with the dollar sign character '$'. Control codes such as carriage return, linefeed, and backspace can be embedded within the string. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
0Ah | Buffered Keyboard Input | AH = 0Ah DS:DX = segment:offset of the buffer |
nothing | Reads a string of bytes from the standard input device and sends the characters to a buffer. This function echoes characters to the standard output device. The input ends when it receives a carriage return code. | Uses the buffer in the following format:
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
0Bh | Check Input Status | AH = 0Bh | AL = 00h if no character is available AL = FFh one or more characters available |
Determines whether standard input device has a character available for reading | If this function detects Ctrl-C and Ctrl-Break it calls INT 23h | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
0Ch | Flush Input Buffer and Read Standard Input | AH = 0Ch AL = function to be called after clearing buffer DS:DX = segment:offset of input buffer (if AL = 0Ah) |
AL = input character (if called with AL = 01h, 06h, 07h, 08h) | Clears the type-ahead input buffer and then performs one of the character input functions 01h, 06h, 07h, 08h, or 0Ah. | If AL is not 01h, 06h, 07h, 08h, or 0Ah, this function flushes the buffer and passes control to the calling function. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
0Dh | Disk Reset | AH = 0Dh | nothing | Writes all data stored in the internal DOS buffers to the disk. | This function prevents access to new data, as it does not update the directory for all open files. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
0Eh | Select Default Disk Drive | AH = 0Eh DL = Drive number (00h = A, 01h = B ,etc) |
AL = number of logical drives | Defines the current or default disk and returns the number of available drives. | With DOS 3.0 and later, this function returns the number 5 or the drive code corresponding to the LASTDRIVE value in AL. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
0Fh | Open File (FCB) | AH = 0Fh DS:DX = Pointer to unopened FCB |
AL contains: 00h = File opened successfully FFh = File not opened |
Used to open existing disk files using an FCB. This function will not create a file (See Int 21/16). Function is called after filling in a drive, file name, and extension fields of FBC. Drive designations are 0 (default drive), 1 (A:), 2 (B:), etc. Function sets FCB block field to zero; record size to 80h; and file size, date, and time from requested file's directory entry. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
10h | Close File (FCB) | AH = 10h DS:DX = Pointer to opened FCB |
AL contains: 00H = File closed successfully FFh = File not closed |
DO NOT USE. Use 21H/3EH instead. | Used to close a previously opened disk file that uses an FCB. This function is essential with FCB files because it forces DOS to update file's directory entry. To use function, provide the information in file-name, extension, and drive-designator fields. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
11h | Search for First Entry (FCB) | AH = 11H DS:DX = Pointer to unopened FCB |
AL = 0 if match was found FFH if no match was found |
DO NOT USE. Use 21H/4EH instead. | Used to search for first occurrence of specified directory entry. To use this function, provide the filename, extension, and drive designators in the appropriate FCB fields. Use an extended FCB to search for a file with a specific attribute. Valid attributes are derived from the attribute bit settings and include the following:
Upon successful completion, the DTA holds an unopened FCB for the file that was found. If search is called with an extended FCB, DTA has entended FCB. If you are using wild-card characters to search for files, and no error was returned from this function, you can continue searching by using INT 21H/12H. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
12h | Search for Next Entry (FCB) | AH = 12H DS:DX Pointer to FCB return by INT 21H/11H |
AL = 00H, if match found = FFh, if no match found |
DO NOT USE. Use 21H/4FH instead. | Continues a directory search begun by INT 21H/11H. Can be called as many times as necessary to locate a given file within a directory, but will search only for next matching entry, not first entry. FCB pointed to by DS:DX should be the same one used in previous search. When successfully completed, the DTA holds an unopened FCB for the file found. If search was initiated with extended FDB, DTA will have extended FCB. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
13h | Delete File (FCB) | AH = 13H DS:DX = Pointer to unopened FCB |
AL = 00h, if file deleted = FFH if file not deleted |
DO NOT USE. Use 21H/41H instead. | Used to delete normal files using an FCB. Read-only files, system files, hidden files, volume labels, or directories cannot be deleted with this function. To use, provide the file name, extension, and drive designators in the appropriate FCB fields. Do not try to delete an open file. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
14h | Read Sequential File (FCB) | AH = 14H DS:DX = Pointer to opened FCB |
AL =
|
DO NOT USE. Use 21H/3DH instead. | Facilitates sequential reading of information from a disk file using an FCB. You can read information only from a previously opened file (INT 21H/0FH). To use, point DS:DX to an FCB created after file was opened. Reads are controlled by the arameters set in the FCB. Length of read is given in record-size field. Location is given by current block and record numbers. When completed, information read from the disk is placed in the DTA, and record address in the FCB is automatically incremented. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
15h | Write Sequential File |
|
AL =
|
DO NOT USE. Use 21H/3FH instead. | Allows sequential writing of data to a file using an FCB. You can write data only to a previously opened (or created) file. To use, point DS:DX to an FCB created after the file was opened or created. Parameters set in the FCB control writes. Length of write is given in record-size field. Location is given by current block and record numbers. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
16h | Create File (FCB) | AH = 16H DS:DX = Pointer to unopened FCB |
AL = 00H, if File Created = FFH, if file not created |
DO NOT USE. Use 21H/3CH instead. | Creates specified file and leaves it open for subsequent use with an FCB. To use, the FCB's drive, filename, and extension fields must be provided. When you use an extended FCB, you can assign an attribute to create a hidden file or volume label. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
17h | Rename File (FCB) | AH = 17H DS:DX = Pointer to modified FCB |
AL = 0 if file renamed FFH if file not renamed |
DO NOT USE. Use 21H/56H instead. | Allows you to change name of existing disk files using a modified FCB. Only normal files can be renamed. The modified FCB has the following format:
Because filenames in any given directory must be unique, this fucntion will return an error if asked to rename a file to a name that already exists. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
18h | RESERVED | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
19h | Get Current Disk | AH = 19h | AL = drive (01h = A:, 02h = B:, etc) | Determines the number of the current or default disk drive | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
1Ah | Set Data Transfer Address (DTA) | AH = 1Ah DS:DX = segment:offset of DTA |
nothing | Establishes the address of buffer area in memory to use as the current DTA for FCB-related function calls. | When the program starts, the DTA is set to a 128 byte buffer at offset 0080h in the PSP. It is recognized as an error and aborts a disk transfer if DTA is at the end of a segment and disk transfer exceeds the end of the segment. DOS does not test the length of the DTA. You must create a DTA of any size, less than 64K, that is large enough for any disk operation that will use it. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
1Bh | Get Default Drive Data | AH = 1Bh | AL = sector/cluster CX = bytes/sector DX = number of clusters DS:BX = segment:offset of media ID byte values: DS/SS, sectors/track FFh = DS, 8 FEh = SS, 8 FDh = DS, 9 FCh = SS, 9 F9h = DS, 15 F8h = hard disk F0h = other |
Get the information about the size of the default disk drive. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
1Ch | Get Disk Data | AH = 1Ch DL = drive (00h = default, 01h = A:, etc) |
AL = sector/cluster CX = bytes/sector DX = number of clusters DS:BX = segment:offset of media ID byte |
Get informat about the size of a specified disk drive. | Identical to Fucntion 1B except the any drive can be specified. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
1Dh | RESERVED | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
1Eh | RESERVED | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
1Fh | Get Drive Parameter Block (DPB) for current drive | AH = 1Fh | AL = 00h if function successful DS:BX = segment:offset of DPB AL = FFH, if invalid drive |
Gets information about the disk parameters for the current drive. | For DOS 4.0 - 5.0, the DPB has the following format:
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
20h | RESERVED | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
21h | Random Read | AH = 21H DS:DX = segment:offset of previously opened file control block (FCB) |
AL =
|
Reads a selected record from a file into memory. | DO NOT USE. Use 21H/3FH instead.
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
22h | Random Write | AH = 22H DS:DX = segment:offset of previously opened file control block (FCB) |
AL = 00H if write successful = 01H if disk full =02H if segment wrap, write canceled |
Writes data from memory inot a selected record in a file |
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
23h | Get File Size | AH = 23H DS:DX = segment:offset of unopened file control block (FCB) |
If successful (matching file found) AL = 00 FCB relative-record rield (offset 21H) set to the number of records in the file, rounded up if necessary to the next complete record If unsuccessful (no matching file found): |
Get File Size |
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
24h | Set Relative Record Number | AH = 24H DS:DX = segment:offset of previously opened file control block (FDB) |
AL is destroyed FCB relative record field (offset 21H) is updated |
Sets the relative-record number field of a file control block (FCB) to correspond to the current file position as recorded in the opened FCB. |
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
25h | Set Interrupt Vector | AH = 25h AL = interrupt number DS:DX = segment:offset address of new interrupt handler |
nothing | Sets a specfied interrupt vector to point to another handling routine. | This function is a better way to change interrupt handlers than direct modification of the interrupt vector table Before this function is called, the initial contents of the interrupt vector table must be retreived using Function 35h, and saved. Later, the original interrupt vector should be restored. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
26h | Create new PSP | AH = 26h DX = segment address of new PSP |
nothing | Copies the PSP from the PSP of the executing program to a specified address in the memory. | This function is obsolete. Use Function 4Bh instead. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
27h | Random Block Read | AH = 27H CX = number of records to read DS:DX = segment:offset of previously opened file control block |
AL =
|
Reads one or more sequential records from a file into memory, starting at a designated file location |
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
28h | Random Block Write | AH = 28H CX = number of records to write DS:DX = segment:offset of previously opened file control block |
AL = = 00H if all requested records written = 01H if disk full = 02H if segment wrap CX = actual number of records written |
Writes one ore more sequential records from memory to a file, starting at a designated file location. |
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
29h | Parse Filename into FCB | AH = 29h AL = parsing option:
DS:SI = segment:offset of string ES:DI = segment:offset of file control block (FCB) |
AL = return status (00h - no wildcards encountered, 01h - wildcard present, FFh - invalid drive specifier) DS:SI = segment:offset of first unparsed character ES:DI = segment:offset of buffer with unopened FCB |
Parses a character string and copies into the appropriate fields of an FCB. The string can include drive, filename and file extension. | If the filename or extension contain asterisks, then they are changed to question marks in the FCB. The filename must terminate with a null byte (ASCII code 0). This function cannot be used with a file specification which includes a path. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
2Ah | Get Date | AH = 2Ah | CX = year (1980 - 2099) DH = month (1-12) DL = day AL = day of the week (0 = Sunday, 1 = Monday, etc) |
Gets the current system date from the system calendar | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
2Bh | Set Date | AH = 2Bh CX = year (1980 - 2099) DH = month (1 - 12) DL = day |
AL = 00h if date set successful = FFh if invalid date. |
Changes the current system date to a specific date. | This function does not change the system time. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
2Ch | Get Time | AH = 2Ch | CH = hours (0 - 23) CL = minutes (0 - 59) DH = seconds (0 -59) DL = 1/100 seconds (0 - 99) |
Reads the current system time. | Resolution may be 5/100 of a second. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
2Dh | Set Time | AH = 2Dh CH = hours (0 - 24) CL = minutes (0 - 59) DH = seconds (0 - 59) DL = 1/100 seconds |
AL = 00h if function is successful = FFh if invalid time (ignored) |
Sets the current system time | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
2Eh | Set Verify Flag | AH = 01h AL = 00h Do not verify data = 01h Verify data |
nothing | Toggles the disk write verification flag. This flag determines that data must be verified once it has been written. | The default flag is OFF because this is a slow disk operation. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
2Fh | Get Disk Transfer Address (DTA) | AH = 2Fh | ES:BX = segment:offset of DTA | Determines the address of a current disk data buffer for all FCB file read and write operations. | The default DTA starts at offset 80h in the PSP and has a length of 128 bytes. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
30h | Get MSDOS Version Number | AH = 30h AL = Determines information returned in BH = 00h - Manufacturers ID = 01 - Flag |
AL = major version number AH = minor version number BH = OEM's serial number = 00h IBM PC DOS = FFh MSDOS BH = version flag = 08 DOS in ROM = 10h DOS in XMA |
Determines the MSDOS version number | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
31h | Terminate and Stay Resident (TSR) | AH = 31h AL = return code DX = number of paragraph to be kep resident |
nothing | Terminates the program currently being executed and passes control to the calling program, withing releasing resources allocated to the current process. The current process stays resident in the memory and waits for another call. | The parent process can read the return code in the AL register with Function 4Dh. Alternatively it can can be tested in a batch file by the ERRORLEVEL and IF statements. A non-zero return code usually indicates an error. The number of the 16-bit paragraph in the DX register indicates the initial memory allocation block, beginning with the PSP. This memory cannot be released for use by Function 48h. This memory can only be relased by Function 49h. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
32h | Get DOS Driver Parameter Block (DPB) for Specific Drive | AH = 32h DL = drive (0 = current, 1 = A; etc) |
AL = 00h if function is successful DS:BX = segment:offset of DPB AL = FFh invalid drive |
Get information about disk parameters for a specific drive |
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
33h/00h or 01h | Get or Set Break Flag | AH = 33h AL = 00h if getting break flag = 01 if setting break flag DL = 00h if turn break flag OFF = 01 if truning break flag ON |
DL = current state 00h - break flag is OFF 01h - break flag is ON |
Reads and chages the state of the Ctrl-Break check flag. | When the system break flag is on, this function determines whether DOS should check the keyboard to see if the Ctrl-C or Ctrl-Break keys have been pressed. When this flag is off, it checks for traditional character input/output. Since the Ctrl-Break flag is not part of the environment block of the current program, it affects all programs which use DOS functions fo character input/output and which check Ctrl-C and Ctrl-Break. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
33h/02h | Get and Set Extended Control-Break Checking State | AH = 33h AL = 02h DL = 00 if checking OFF 01 if checking is ON |
DL = old state of extended break checking | Obtains an changes the state of the Control-Break flag. | This function is full re-entrant. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
33h/05h | Determine Boot Drive Number | AH = 33h AL = 05h |
DL = boot drive (1=A, 2+=B, etc) | Reads the system boot drive | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
33h/06h | Get Actual Version Number | AH = 33h AL = 06h |
BL = major version BH = minor version DL = revision DH = version flag bit 3=1 DOS is in ROM bit 4 = DOS is in HMA |
Reads the actual version of MS-DOS. | This function returns the actual version of MS-DOS even if the DOS command SETVER has changed the version. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
34h | Get Address of InDOS Flag | AH = 34h | ES:BX = segment:offset of InDOS flag | Reads the address of Critical Section (InDOS) flag. This indicates that INT 21h Function is working. | The value of the InDOS flag is incremented when an INT 21h fucntion begins to work and decremented when it is completed. During INT 28h, call the falue in InDOS flag may be 01h instead of zero. Burt in this case the functions from 01h to 0Ch INT 21 only may be calledl There may, however be occasions when DOS is busy but the InDOS flag is zero. This is possible because during its operation, the critical error handler decrements InDOS and increments the critical error flag. The Critical error flag is the byte before the InDOS flag in DOS 3+. This function may be called once at the beginning of a program only. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
35h | Get Interrupt Vector | AH = 35h AL = interrupt number |
ES:BX = segment:offset of interrupt handler | Gets the address of the interrupt service routine for a specific interrupt vector. | This function must be used to ensure compatability with future versions of DOS. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
36h | Get Disk Free Space | AH = 36H | AX = sectors per cluster, or 0FFFFH if the drive number is invalid BX = number of available clusters CX = bytes per sector DX = clusters per drive |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
37h | RESERVED | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
38h | Get Country Specific Information | AH = 38h AL = 1-0FE for specific country with code < 255 0FFh for specific code >= 255 BX = country code, if AL=0FFh DX = 0FFFFH |
CF = 0 function is successful BX = country code DS:DX = segment:offset of buffer filled with info as follows:
CF = 1 if unsuccessful AX = error code |
Obtains country specific information or sets the current country parameters | The case map address in 12-15h is the segment:offset address of the FAR procedure which is used for performing country specific conversions of character codes from 80h through 0FFh. This procedure must be called with the character to be converted to a capital letter in the AL register. If a capital letter already exists for the character in the AL register, it is returned in AL after the function call, otherwise the contents of AL remain unchanged. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
39h | Create Directory | AH = 39h DS:DX = segment:offset of ASCIIZ pathname |
CF = 0 if successful CF = 1 if unsuccessful AX = error code = 03h Path not found = 05h Access denied |
Creates a new subdirectory in a specified drive. | An error will occur if: Any element of the pathname does not exist. A subdirectory with the same name already exists A subdirectory is to be created in a root directory which is already full. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
3Ah | Delete Directory | AH = 3Ah segment:offset of ASCIIZ pathname |
CF = 0 if successful CF = 1 if unsuccessful AX = error code = 03h if path not found = 05 if Access denied = 10h if attempt to remove current directory |
Deletes a subdirectory on a specified drive. | An error will occur if: Any element of the pathname does not exist. The specified directory is the current directory. The specified directory contains no files. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
3Bh | Set Current Directory | AH = 3Bh DS:DX = segment:offset of ASCIIZ pathname |
CF = 0 if successful CF = 1 if unsuccessful AX = error code = 03 if path not found |
Changes current or default directory for a specified path and drive. | An error will occur if any element of pathname does not exist. If the new pathname includes a drive letter, the default drive will not be changed. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
3Ch | Create File | AH = 3Ch CS = file attribute bit 0: read-only file bit 1: hidden file bit 2: system file bit 3: volume label (ignored) bit 4: reserved bit 5: archive bit bit 6: reserved DS:CS = segment:offset of ASCIIZ pathname |
CF = 0 if successful AX = handle CF = 1 if unsuccessful = 03 Path not found = 04 No available handle Access denied |
Creates a new empty file on a specified drive with a specified with a specified pathname. | Wildcards are not permitted in the filename. An error will occur if any element of pathname does not exist; the file is to be created in a root directory which is full; or a file with the same name and read-only attribute exists in the current directory. If a file with the same name exists, it is truncated to zero length. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
3Dh | Open File | AH = 3Dh AL = access mode bits 0-2: access mode: 000 = read only 010 = write only 010 = read/write bit 3: reserved (0) bits 4-6: Sharing mode: = 000 compatibility mode = 001 deny all (only current program can access file) = 010 deny write (other program can only read from file) = 011 deny read (other programs can only write into file) = 100 deny none (other programs can read and write the file) DS:DX = segment of ASCIIZ pathname |
CF = 0 if successful AX = handle CF = 1 if unsuccessful AX = error code = 01h missing file sharing software = 02h file not found = 03h path not found or file does not exist = 04h no handle available =05 access denied = 0Ch access mode not permitted |
Opens an existing file for reading, writing or appending on the specified drive and specified pathname. | Wildcards are not permitted in the filename. If the drive or path are omitted in the filename, DOS accesses the current drive or directory. An error will occur if any element of pathname does not exist, or if the file has the read-only attribute set and is opened in the read/write access mode. The file pointer is set to the first byte of file. File handlers which are inherited from a parent process also inherit all sharing and access restrictions. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
3Eh | Close File | AH = 3Eh BX = handle |
CF = 0 if successful AX is destroyed CF = 1 if unsuccessful AX = error code = 06 File not opened or unauthorized handle |
Writes all information in internal DOS buffers associated with the file to disk and updates directory information, then closes the file. | Do not call this function with a zero handle (standard input) and you won't be able to enter characters from the keyboard. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
3Fh | Read File or Device | AH = 3Fh BX = handle CX = number of bytes to be read DS:DX = segment:offset of buffer |
CF = 0 if successful AX = number of bytes read CF = 1 if unsuccessful AX = error code = 05h access denied 06 illegal handle or file not opened |
Reads a given number of bytes at the current file pointer position, from a previously opened file, with a given valid handle or device, to a buffer. | If the CF is clear after the function call and AX = 0, it means that the file pointer was already at the end of the file and the file cannot be read. If the CF is clear after the function call and the value in AX is small than the value in CX, it means that only part of a record was read, either because the end of file was reached or an error occurred. If the call is successful, the file pointer position is updated after the function call. If this function is used to read from a file with handle 0 (standard input device -- keyboard ), it stops reading after the first CR, or once a specified number of characters have been read. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
40h | Write File or Device | AH = 40h BX = handle CX = number of bytes to write DS:DX = segment:offset of buffer |
CF = 0 if successful number of bytes written CF = 1 if unsuccessful AX = Error Code = 05 Access denied = 06 Illegal handle of a file which is not opened |
Writes a given number of bytes at the current file pointer position, to a previously opened file, with a given valide handle or device | This function writes to a file with a valid handle or to a stardand output device. If CF = 0 and AX< CX, only a partial record was written, either because EOF was reached, or there was a DOS error (disk full). If CF = 0 and CX = 0 it means that no data is written and the file is truncated or extended to the current position of the file. If successful, the file pointer is updated after the function. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
41h | Delete File | AH = 41h DS:DX = segment:offset of ASCIIZ pathname |
CF = 0 if successful CF = 1 if unsuccessful AX = Error Code = 02h file not found = 03h path not found or file does not exist = 05h access denied |
Erases a specified file | This function cannot delete subdirectories or volume names. This function does not erase data in a file. It only replaces the first symbol in the filename in the directory with the hex code 0E5h and marks the FAT Chain for this file as "free". Wildcards are not permitted in file specification. An error occurs if an element in the pathname does not exist, or the file has the Read-Only Attribute set. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
42h | Set File Pointer | AH = 42h AL = offset code = 00h absolute offset from start of file = 01 signed offset from current file pointer = 02h signed offset from end of file. BX = handle CS = most significant part of offset least significant part of offset |
CF = 0 if successful DX = high word of file pointer AX = low word of file pointer CF = 1 if unsuccessful AX = error code = 01h illegal offset code = 06 illegal handle or file not open |
Moves the file location pointer to a specified position in the file. | This function always return the result absolute byte offset from the start of the file in DX:AX. For offset codes 01h and 02h, the file pointer may be position before the start of the file. The file pointer can also be set after the end of th file. No error will be returned at this point, but a subsequent attempt to read or write will create errors. YOu can get the size of the file using the offfset code 06 and offset of 0. After callint, examine the file pointer location. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
43h/01-02h | Get or Set File Attributes | AH = 43h AL = 00h to get attributes = 001 to set attributes CS = file attributes (if AL = 01h) = bit 0: read-only = bit 1: hidden = bit2: system = bit 3: volume label = bit 4: directory = bit 5: archive bits 6-15: reserved DS:DX = segment:offset of ASCIIZ pathname |
CF = 0 if successful CX = file attribute = bit 0: read-only = bit 1: hidden = bit2: system = bit 3: volume label = bit 4: directory = bit 5: archive bits 6-15: reserved CF = 0 if unsuccessful AX = error code = 01h unknown function code = 02 file not found = 03h path not found attribute cannot be changed. |
Determines or sets file attributes for a specified file. | Wildcards are not permitted in the pathname. This function can not change the volume label or directory attributes. An error occurs if an element in the pathname does not exists. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
44h/00h | Get Device Information | AH = 44h AL = 00h BX = handle |
CF = 0 if successful DX = device information word character device if bit 7 is set:
AX = error code
|
Gets information about a specified file or device | DH corresponds to the high byte of the attribute word of the handle for the character device. in the binary ("raw") mode MSDOS treats all characters as data. In the ASCII ("cooked" mode, MSDOS checks the character stream and performs the relevant function, if a special character Ctrl-C, Ctrl-S, Ctrl-P, Ctrl-Z or CR is detected. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
44h/01h | Set Device Information | AH = 44h AL = 01h BX = handle
|
CF = 0 if successful CF = 1 if unsuccessful
|
Sets specific characteristics of the character device. | This function is useful for switching between ASCII (cooked) and binary (raw) modes, when the handle is associated with a character device. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
44h/02h | IOCTL: Read Control Data from Character Device Driver DOS | AH = 44h AL = 02 BX = handle CX = number of bytes to be read DS:DX = segment:offset of buffer |
CF = 0 if successful AX = number of bytes read CF = 1 AX = error code
|
Reads data specific to each character device driver from a character device | The character device driver defines the structure and type of control data. This function can be used for reading hardware dependent information and status information of the character device, if this device supports this function. This information cannot usually be obtaned by other DOS functions. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
44h/03h | IOCTL: Write Control Data from Character Device Driver DOS | AH = 44h Al = 03h BX = handle CX = number of bytes to be written DS:DX = segment:offset of data |
CF = 0 if successful AX = number of bytes sent CF = 1 if unsuccessful AX = error code
|
Writes control data specific to each character device from an application directly to a specified character device. | If this function is support by a character device driver, it can be used to perform certain hardware dependent operations. These operations are not usually supported by other MSDOS function calls. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
44h/04h | IOCTL: Read Control Data from Block Device Driver DOS | AH = 44h AL = 04h BL = drive code (0 = default, 1=A, etc.) CX = number of bytes to be read DS:DX = setment:offset of buffer |
CF = 0 if successful AX = number of bytes read CF = 1 if unsuccessful AX = error code
|
Reads control data directly from the block device into the buffer. | This function can be used if the block device driver supports the IOCTL call | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
44h/05h | IOCTL: Write Control Data from Block Device Driver DOS | AH = 44h AL =05h device code CX = number of bytes to be written DS:DX = segment:offset of data |
CF = 0 if successful AX = number of bytes sent CF = 1 if unsuccessful AX = error code =01h unknown function code = 05h attribute cannot be changed = 06h handle not open or does not exist = 0Dh invalid data |
Write data specific to each character device control from an application program directly to a block device. The format and structure are specific to each device. | If this function is supported by a character device driver, it can be used to perform certain hardware dependent operations. These operations are usually not supported by other MSDOS function calls. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
44h/06h | IOCTL: Check Input Status | AH = 44h AL = 06h BX = handle |
CF = 0 if successful AX = 00h device not ready or EOF on file CF = 1 if unsuccessful AX = error code = 01h unknown function code = 05h attribute cannot be changed = 06h = handle not opened or does not exist = 0Dh invalid data |
Reads the status of the specified device to determine whether the device can read data. | This function can be used to check the status of certain character devices that do not have their own MSDOS functions for status checking (for example, serial port). | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
44h/07h | IOCTL: Check Output Status | AH = 44h AL = 07h BX = handle |
CF = 0 if successful AL = 00h device not ready = 01 device is ready CF = 1 if unsuccessful AX = error code = 01 unknown function code = 05h attribute cannot be changed = 06h handle not opened or does not exist = 0Dh invalid data |
Reads the status of a specified device that determines whether this device can write data. | This function always returns the ready status indicating that all files are ready for output, even if the disk is full or there is no disk in the drive. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
44h/08h | IOCTL: Check if Block Device is Removable | AH = 44h AL = 08h BL = device number (0=default, 1=A, etc.) |
CF = 0 if successful AL = 00h if media is removable = 01 if media is not removable CF = 1 if unsuccessful AX = error code = 01h unknown function code = 0F invalid drive |
Determines where the block device media (disk, hard disk, etc.) of the specified block device can be changed. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
44h/09h | IOCTL: Check if Block Device is Remote | AH = 44h AL = 09h BX = drive number (0=default, 1=A, etc.) |
CF = 0 if successful DX = device attribute word bit 15=1 drive is SUBSTituted bit 12=0 drive is local bit 12=1 drive is remote CF = 1 if unsuccessful AX = error code = 01h unknown function code = 0Fh invalid drive |
Determines whether the specified block device is local (part of the PC that is used as a workstation) or remote (part of a network server). | This subfunction can be used if network software has beeen installed previously. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
44h/0Ah | IOCTL: Check if Handle is Remote | AH = 44h AL = 0Ah BX = handle |
CF = 0 if successful DX = attribute word for file or device bit 15 = 0 if local = 1 if remote CF = 1 if unsuccessful AX = error code = 01h unknown function code 06h handle not opened or does not exist |
Determines whether the specif handle refers to a file on a remote or local device. | This subfunction can be used if network sofware has been install previously. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
44h/0Bh | IOCTL: Change Sharing Retry Count | AH = 44h AL = 0Bh CS = pause between attemps (default = 1) DX = number of attempts (default = 3) |
CF = 0 if successful CF = 1 if unsuccessful AX = error code = 01 unknown error code |
Sets the number of attempts which MSDOS will perform after the SHARE utility fails to open or lock a file. | This subfunction can be used if network software has been installed previously. The value in the CX register defines the delay which perfrom by executing empty cycles: xor cx,cx loop $; repeat this command 65536 times Consequently, the value of the delay depends of the processor speed. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
44h/0Ch | IOCTL: Generic I/O Control for Character Device | AH = 44h AL = 0Ch CH =
CL =
DS:DX = segment:offset of parameter block |
CF = 0 if successful DS:DX = segment:offset of parameter block if CL = 65h, 6ah, 6bh, or 7f CF = 1 if unsuccessful AX = error code |
Various calls for a character from an application | The parameter block for CL = 45h has the following format:
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
44h/0Dh | IOCTL: Generic I/O Control for Block Device | AH = 44h AL = 0Dh BX = drive number (00h=default, 01h=A, etc) CH =
CL =
|
CF = 0 if successful DS:DX = segment:offset of parameter block if CL=60h or 61h CF = 1 if unsuccessful = error code |
Transfers miscellaneous requests from application programs to block device drivers | The parameter block for functions 40h and 60 has the following format:
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
44h/0Eh | IOCTL: Get Logical Drive Map | AH = 44h AL = 0Eh BL = drive number (00h=default, 01h=A, etc) |
CF = 0 if successful AL = 00h block device has only one logical drive assigned, = 1 - 26: letter corresponding to the last logical device on the drive (1 = A, etc) CF = 1 if unsuccessful AX =
|
Reads the last logical drive used to reference a specific block device | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
44h/0Fh | IOCTL: Set Logical Drive Map | AH = 44h | CF = 0 if successful AL =
CF = 1 if unsuccessful AX =
|
Assigns the drive letter to a specified block device | This function treats a single physicall drove as both A: and B:. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
44h/10h | Query Generic IOCTL Capability (Handle) | AH = 44h AL = 10h BX = handle for device CH =
CL =
|
CF = 0 AX = 0000h specified IOCTL function is supported CF = 1 if unsuccessful AL = IOCTL capability not available |
Tests whether a character device will support a miscellaneous IOCTL request to character device driver. | Character device must support a Generic IOCTL Check call. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
44h/11h | Query Generic IOCTL Capability (Drive) | AH = 44h AL = 11h BL = driver number (0=default, 1=A, etc) CH =
CL = function code |
CF = 0 if successful AX = 0000h specified IOCTL function is supported CF = 1 function is unsucessful CL = IOCTL capability not available |
Tests whether a block device supports a miscellaneous IOCTL request. | A block device driver must support a Generic IOCTL Check call. This function may be used if you wish to use a Generic IOCTL call beyond the set of called defined for DOS 3.2 |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
45h | Duplicate Handle | AH = 45h BX = file handle |
CF = 0 if successful AX = new handle CF = 1 if unsuccessful AX =
|
Creates a new file handle that refers to the same currently operating device or file as an exist file handle | This function is used to force DOS to clear the file buffers by closing the duplicate handle. It is faster than closing and reopening a disk file. A better way of doing this is using Function 68h. This function can also be used for updating the directory entry of a file that has changed in length without closing and reopening a file. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
46h | Force Duplicate File Handle | AH = 46h BX = first file handle CX = second file handle |
CF = 0 if successful CF = 1 if unsuccessful AX =
|
Forces a second handle to become a duplicate of the first handle. | This function closes the first file handle if it is still open. This function associates an existing open file with a different file, or device. It is particularly useful for redirecting standard input or output to a different file or device by software (i.e., without using piping or redirection on the command line). |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
47h | Get Current Directory | AH = 47h DL = drive number (0=default, 1=A, etc) offset:segment of a 64 byte long buffer with ASCIIZ pathname |
CF = 0 if successful CF = 1 if unsuccessful AX =
|
Gets current working of a specified device. | This function returns the path description without the drive letter and the initial backslash. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
48h | Allocate Memory | AH = 48h BX = number of paragraphs to be requested |
CF = 0 if function successful AX = pointer to allocated block CF = 1 if unsuccessful AX =
BX = size of largest available memory block in paragraphs |
Allocates memory to the current program | This function always fails when it is executed within COM-format programs. This is because they initially occupy the largest avaiable block of memory. Therefore you must free some memory before using this function. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
49h | Release Memory | AH = 49h ES = segment of block to be freed |
CF = 0 if function successful CF = 1 if unsuccessful AX =
|
Releases memory blocks previously obtained using function 48h | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
4Ah | Modify Allocated Memory Block | AH = 4Ah BX = new memory size in paragraphs ES = segment of block address |
CF = 0 if function successful CF = 1 if unsuccessful AX =
|
Changes the size of a memory block previously allocated by function 48h. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
4Bh/00-03h | Load and/or Execute | AH = 4Bh AL =
DS:DX = ASCIIZ string of pathname ES:BX = segment:offset of parameter block |
CF = 0 if successful BX = destroyed DX = destroyed CF = 1 if unsuccessful AX =
|
Loads and executes (optionally) another program | This function loads a sub-program, creates PSP and runs the sub-program. The parameter block for AL=00h, 01h has the following format:
The parameter block for AL=03h has the following format:
If the segment address of the environment block is 0, then a child process has the same environment block as the parent process. The environment strings must be paragraph aligned and consist of a sequence of ASCIIZ strings. The strongs must be followed by the byte 00h. The command tail parameter string contains a count byte which represents the number of characters in the command string. This is followed by ASCII characters. The string ends with a carriage return (which is not included in count). The first character of the string should be a blank. Before using this function, you must ensure that there is enough unallocated memory availabe for the child process. If necessary, you must release all memory to load the child process. When this function loads and runs a sub-program, all open files of the parent process are available to the child process; therefore, if the parent process redirects standard input or output, it also affects the child process. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
4Bh/05h | Set Execution State | AH = 4Bh AL = 05h DS:DX = segment offset of execution state |
CF = 0 if successful AX = 00h CF = 1 if unsuccessful AX = error code |
Prepares new programs for execution | This function may be used by programs which want to bypass the normal EXEC function. All DOS, BIOS and other software interrupts cannot be used after returning from this function and before the start of the child process. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
4Ch | Terminate with Output Code | AH = 4Ch AL = return code |
Nothing | Ends the current process and passes an exit code to the parent process | This function is the proper method for terminating programs in DOS. It releases all the memory belonging to the parent process, flushes all the file buffers and closes all open file handles of the parent process. It also restores the contents of the interrupt vecotrs for the terminate handler (INT 22h), the Ctrol-C handler (INT 23h) and the critical error handler (INT 24h). AFter this, control is passed to the parent process. All files that have been opened using FCBs must be closed before executing this function. All network files locks should be removed before this function is performed. Batch files can test the exit code with an ErrorLevel and IF statement. The exit code zero indicates that the function was successful. code with an Error | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
4Dh | Get Output Code | AH = 4Dh | AH =
AL = return code |
Reads the exit cod and termination type of the child process after execution of the EXEC call. | This function can only retrieve the return code once, because the word where DOS stores this coded is cleared once the function has read it. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
4Eh | Find First Matching File | AH = 4Eh
DS:DX = segment:offset of ASCIIZ pathname |
CF = 0 if successful [DTA] Disk Transfer Area = FindFirst data block The DTA has the following format:
AX =
|
Searches for the first file that matches a specified filename in the default or specified directory on the default or specified drive. | This function allows the use of wildcards in the filename. If a wildcard character is included in the filename, only the first matching filename is returned. If the attribute byte is other than 08h, this functions returns all the specified combination of attribute bits. If the attribute is 08h (the volume label), the function returns the volume label only. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
4Fh | Find Next Matching File | AH = 4Fh DTA points to the data block from the previous FirstFind or FindNext call |
CF = 0 if successful CF = 1 if unsuccessful AX =
|
Search for the next file that matches a specified filename in the default or specified directory on the default or specified drive, if the previous call of Function 4Eh was successful. | This function is used after the function fEh. The function 4Fh continues the search performed by the function 4Eh if that function leaves the DTA unchanged. The original file specification must contain wildcard characters. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
50h | Set Current Process ID (Set PSP address) | AH = 50h BX = segment address of new PSP |
Nothing | Sets a new value of PID into "current process" variable | This function does not use any internal stacks and is thus fully re-entrant. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
51h | Get Current Process ID (Get PSP address) | AH = 51h | BX = segment address of new PSP | Reads the segment address of the current PSP | This function does not use any internal stacks and is thus fully re-entrant. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
53h | Translate BIOS Parameter Block to Drive Parameter Block DOS | AH = 53h DS:SI = segment:offset DPB ES:DI = segment:offset buffer for DPB |
ES:BP = address of buffer with information | -Transforms drive parameter informatin from the BIOS Parameter Block (BPB) which is stored on the disk to the format used by DOS. | The BPB has the following format:
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
54h | Get Verify Flag | AH = 54h | Al = 0 if OFF, else 1 if on | Gets the current value of the MSDOS "verify" flag (read after write) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
56h | Rename File | AH = 56h ? |
? | Changes the name of a file or moves a file from one directory to another on the same logical drive. | This function does not allow the wildcard character in any pathname specification This function cannot rename open files. It also allows you to rename directories but not to move them. An error occurs if the file is moved in the root directory and it is full, or a file with a new pathname exists. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
57h/00h | Get File's Date and Time | AH = 57h AL = 00h BX = file handle |
CF = 0 if successful CX = file's time
DX = file's date
CF = 1 if unscuccessful AX =
|
Reads the date and time of the creation or last modification of a file. | This function can only be called after the file has been created or opened using one of the handle functions. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
57h/01h | Set File's Date and Time | AH = 57h AL = 01h BX = file handle CX = new time
|
CF = 0 if successful CF = 1 if unsuccessful AX =
|
Modifies the date and time information of a file to given values. | This function can only be called after the file has been created or opened using one of the handle functions. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
58h/00h | Get Allocation Strategy | AH = 58h AL = 00h |
CF = 0 if successful AX =
CF = 1 if unsuccessful AX =
|
Reads the control byte which indicates the current MSDOS method for allocating memory blocks | DOS has three methods of allocating memory blocks: First fit: DOS begins searching the available memory blocks at the start of the memory and allocates the first block which is large enough. Best fit: DOS searches all available memory blocks and allocates the smallest memory block which meets the requested size. Last fit: DOS begins searching the available memory at the end of the memory and allocates the first block which is large enough. The default strategy is the last fit. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
58h/01h | Set Allocated Strategy | AH = 58h AL = 01h BX =
|
CF = 0 if successful CF = 1 if unsuccessful AX =
|
Write the control byte which indicates the current MSDOS strategy for allocating memory blocks. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
58h/02h | Get Upper-Memory Link | AH = 58h AL = 02h |
AL =
|
Defines whether use of Upper Memory Blocks is enabled or disabled. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
58h/03h | Set Upper-Memory Link | AH = 58h AL = 03h BX =
|
? | Sets the indicator that enables/disables use of UMBs | Before using this function, you must save the indicator of aloocation of UMBs and before termination of process, restore it. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
59h | Get Extended Error Information | AH = 59h BX = 00h |
AX =
BH=
BL =
CH =
ES:DI = ASCIIZ volume label of disk to insert if AX = 022h |
Gets information about errors that occur after an unsuccessful INT 21 function call. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
5Ah | Create Temporary | AH = 5Ah CX = file attribute (bits may be combined) DS:DX = segment:offset of ASCIIZ path ending with at least 13 zero bytes |
CF = 0 if successful AX = handle DS:DX = segment:offset of complete ASCIIZ pathname CF = 1 if unsuccessful AX =
|
Creates a temporary file with a unique name using the current date and time. | The ASCIIZ pathname may contain a drive specification and a path designatin. If the pathname does not include either a drive specification or a path designation, this function creates a temporary file in the current directory of the default drive. This function is used by COMMAND.COM for creating a temporary "piping" file, used for redirection of input/output. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
5Bh | Create New File | AH = 5Bh CX =
DS:DX = segment:offset of ASCIIZ pathname |
CF = 0 if successful AX = handle CF = 1 if unsuccessful AX =
|
Creates a file in the specified or default directory if it does not already exist. | An error occurs when: Any element of the path does not exist. A filename already exists in the specified directory. The file is to be created in the root directory, but this is already full. When a file is created, it usually has a normal read/write attribute (0). |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
5Ch | Lock or Unlock File Region | AH = 5Ch AL =
BX = file handle CX = high word of region offset DX = low word of region offset SI = high word of region length DI = low word of region length |
CF = 0 if successful CF = 1 if unsuccessful AX =
|
Prevents or allows access to the specified region of a file. | Every call to a lock region must be followed by a call to unlock the same region. A child process created by an EXEC system call does not inherit access to the locked region of a file which has been locked by its parent. If a program is terminated by INT 23h or INT 24h, you must release the locked regions of the open file, otherwise the result is undefined. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
5Eh/00h | Get Machine Name | AH = 5Eh AL = 00h DS:DX = segment:offset of buffer (16 bytes) with computer name |
CF = 0 if successful CH =
CL = netBIOS name number (if CH <> 0) DS:DX = segment:offset of computer name (if CH <> 0) CF = 1 if unsuccessful AX =
|
Returns the ASCIIZ name of a local computer within a Microsoft Network. | The computer name is a 16-byte ASCIIZ string. Spaces are added to make it this length. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
5Eh/01h | Set Redirection Mode | AH = 5Eh AL = 01h DS:DX = segment:offset of buffer (16 bytes) with computer name |
CF = 0 function is successful CH = 00h name not defiend <> name is defined CL = netBIOS name number (if CH <> 0) CF = 1 function is unsuccessful |
Sets current redirection mode (printer/disk). | The computer type is a 16-byte ASCIIZ string. Spaces are added to make it this length. Also see INT21H/5EH. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
5Eh/02h | Set Printer Setup String | AH = 5Eh AL = 02h BX = redirection list index CX = length of setup string DS:DI = segment:offset of setup string |
CF = 0 if successful CF = 1 if unsuccessful AX =
|
Specifies the printer setup string which precedes all output to a network printer. This string allows network users to specify their own individual mode to the network printer. | System redirection list assigns local names to network printers, files and directories. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
5Eh/03h | Get Printer Setup String | AH = 5Eh AL = 03h BX = redirection list index ES:DI = segment:offset 9f 64-byte setup string |
CF = 0 if successful CX = print setup string length ES:DI = segment:offset of buffer with Setup String CF = 1 if unsuccessful AX =
|
Gets the printer setup string used by a network printer which is running in the Microsoft Network. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
5Fh/00h | Get Redirection Mode | AH = 5Fh AL = 00h BL =
|
CF = 0 if successful BH =
CF = 1 if unsuccessful AX = error code |
Gets the current redirection mode (printer/disk). | This function is available when Microsoft Network is installed. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
5Fh/01h | Set Redirection Mode | AH = 5Fh AL = 00h BL =
BH =
|
CF = 0 if successfull CF = 1 if unsuccessful AX = error code |
Sets the current redirection mode (printer/disk). | This function is available when Microsoft Network is installed. If redirection is off, then local device is used. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
5Fh/02h | Get Redirection List Entry | AH = 5Fh AL = 02h BX = redirection list index DS:SI = 16-byte buffer for ASCIIZ device name ES:DI = 128-byte buffer for ASCIIZ network name |
CF = 0 if succssful BH =
BL =
CX = parameter value stored in memory DX = destroyed BP = destroyed DS:SI = segment: offset of ASCIIZ local device name ES:DI = segment:offset of ASCIIZ network name CF = 1 if unsuccessful AX =
|
Reads the system redirection list. This list assigns local names to network files, directories or printers. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
5Fh/03h | Redirect Device | AH = 5Fh AL = 03h BL =
DS:DI = segment:offset of ASCIIZ local device name ES:SI = segment:offset of ASCIIZ network name and ASCIIZ password |
CF = 0 if successful CF = 1 if unsuccessful AX =
|
Redirects a specified device to a specific network name. | Device names can be drive specifiers (such as "D:"), printer names (LPT1, PRN, LPT2 or LPT3) or null string. If the the device name is a null string and password, then DOS attempts to gain access to the network directory with the specified password. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
5Fh/04h | Cancel Device Redirection | AH = 5Fh AL = 04h DS:DI of ASCIIZ local device name |
CF = 0 if successful CF = 1 if unsuccessful AX =
|
Cancels the current redirection for the specified local device with a network of printers, files or directories | This function is available when Microsoft Network is running. Device names can be specifiers such as ("D:"), printer names (LPT1, LPT22, LPT3 or PRN) or a string beginning with two back slashes which terminates the connection between the local computer and the network directory. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
60h | RESERVED | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
61h | RESERVED | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
62h | Get Current PSP Address | AH = 62h | BX = segment of PSP for current process | Reads the segment address of the PSP for the current program. | This function is identical to the undocumented function 51h. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
63h | RESERVED | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
64h | RESERVED | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
65h | Get Extended Country Information | AH = 65h AL =
BX = code page (-1 = active CON device) CX = size of buffer to receive information DX = country ID (-1 = default) ES:DI = address of buffer to receive information |
CF = 0 if successful CX = size of country information returned ES:DI = address of country information CF = 1 if unsuccessful AX = error code |
Reads country-dependent information | This function returns an extended version of the information which is returned by INT 21h function 38h. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
65/20-22h | Country Dependent Character Capitalization | AH = 65h AL =
|
CF = 0 if successful DL = capitalized character if AL = 20h CF = 1 if unsuccessful AX = error code |
Capitalizes a text in a country dependent fashion. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
65/23 | Determine if Character Represents Yes/No REsponse | AH = 65h AL = 23h |
CF = 0 if successful
CF = 1 if unsuccessful |
Determines a typed character is a "yes/no" response for current country. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
66h | Get or Set Code Page | AH = 66h AL =
BX = select code page (if AL = 02h) |
CF = 0 if successful if AL = 01h BX = active code page DX = default code page CF = 1 if unsuccessful AX = error code |
DOS reads or sets the current code page. | MSDOS, via the function COUNTRY.SYS, supplies a new code page if AL = 02, but the device must be prepared for this by the directive DEVICE in CONFIG.SYS and NLSFUNC and MODE CP PREPARE commands in AUTOEXEC.BAT | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
67h | Set Handle Count | AH = 67h BX = number of desired handles |
CF = 0 if successful CF = 1 if unsuccessful AX = error code |
Sets the maximum number of handles currently available to the calling programs. | The default table of the PSP for the current process can control only 20 handles. An error occures if the number of handles in the BX register is greater than 20 and there is no free memory available to allocate a block for the enlarged table. If the number of requested files in the BX register is greater than the available number of entries controlled by the FILES entry in CONFIG.SYS file, no error occurs. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
68h | Commit File | AH = 68h handle |
CF = 0 if successful CF = 1 if unsuccessful AX = error code |
Forces all data in DOS buffers associated with a specific handle to be written immediately to the specified device. If the handle points to a file which has been updated, the file's directory is also updated. | This function closes and reopens a file or duplicates a handle and then closes it. This function maintain control of the file in multitasking and networking applications. Although this function does not perform any actions when it accesses a character device, it sets the Carry Flag. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
69h | Get/Set Disk Serial Number | AH = 69h AL =
BL = drive (0 = default, 1=A,2=B, etc DS:DX = segment:offset disk serial number info |
CF = 0 if successful AX = destroyed AL =
CF = 1 if unsuccessful AX =
|
Reads or writes the volume label and serial number of the specified disk. | This function does not generate critical errors. This function does not work on network drivers. The format on disk serial number info has the following format:
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
6Ch | Extended Open/Create Number | AH = 6Ch AL = 00h BL =
BH =
CX =
DX =
DS:SI = segment:offset of ASCIIZ filename |
CF = 0 if successful AX = file handle CX =
CF = 1 if unsuccessful AX = error code |
Combines functions "create", "open", and "commit" into a common function. | Also see INT 21H 3CH and 3DH. |
This page is based on material from:
It should be noted that not all of this references provide material on the latest versions of DOS, and, as a result, do not always agree.