INT 21H (0x21)
Function 43H (0x43 or 67) --> Get or set file
attributes
Call with: AH = 43H
AL = 00H to get attributes
01H to set attributes
CX = file attribute, if AL=01H. Bits can be combined
DS: DX = segment: offset of ASCIIZ pathname
Returns: If function successful
Carry flag = clear
CX = file attribute
If function unsuccessful
Carry flag = set
AX = error code
Comments:
This function obtains or alters the attributes of file (read-only, hidden, system, or archive) or directory. For the significance of bits for different attributes refer Bits significance table given before.
INT 21H (0x21)
Function 44H (0x44 or 68) --> Input/Output Control (I/O Ctrl)
This function provides a direct path of communication between an application program and a device driver. It allows a program to obtain hardware-dependent information and to request operations that are not supported by other MS-DOS function calls.
The sub functions of Input and output Control have been given in the following table:
Sub function |
Operation Name |
00H |
Get Device Information |
01H |
Set Device Information |
02H |
Receive Control Data from Character Device Driver |
03H |
Send Control Data to Character Device Driver |
04H |
Receive Control Data from Block Device Driver |
05H |
Send Control Data to Block Device Driver |
06H |
Check Input Status |
07H |
Check Output Status |
08H |
Check If Block Device Is Removable |
09H |
Check If Block Device Is Remote |
0AH (10) |
Check If Handle Is Remote |
0BH (11) |
Change Sharing Retry Count |
0CH (12)
|
Generic I/O Control for Character Devices
Value |
Description |
CL = 45H |
Set Iteration Count |
CL = 4AH |
Select Code Page |
CL = 4CH |
Start Code Page Preparation |
CL = 4DH |
End Code Page Preparation |
CL = 5FH |
Set Display Information |
CL = 65H |
Get Iteration Count |
CL = 6AH |
Query Selected Code Page |
CL = 6BH |
Query Prepare List |
CL = 7FH |
Get Display Information |
|
0DH (13)
|
Generic I/O Control for Block Devices
Value |
Description |
CL = 40H |
Set Device Parameters |
CL = 41H |
Write Track |
CL = 42H |
Format and Verify Track |
CL = 47H |
Set Access Flag |
CL = 60H |
Get Device Parameters |
CL = 61H |
Read Track |
CL = 62H |
Verify Track |
CL = 67H |
Get Access Flag |
|
0EH (14) |
Get Logical Drive Map |
0FH (15) |
Set Logical Drive Map |
INT 21H (0x21)
Function 44H (0x44 or 68), sub function 00H (0x00)
I/O Ctrl --> get device information
Call with: AH = 44H
AL = 00H
BX = handle
Returns: If function successful
Carry flag = clear
DX = device information word
If function unsuccessful
Carry flag = set
AX = error code
Comments:
This sub function returns a device information word for the file or device associated with the specified handle.
INT 21H (0x21)
Function 44H (0x44 or 68), sub function 01H (0x01) I/O Ctrl --> set device information
Call with: AH = 44H
AL = 01H
BX = handle
DX = device information word
Returns: If function successful
Carry flag = clear
If function unsuccessful
Carry flag = set
AX = error code
Comments:
This sub function of function 44H of INT 21H, sets certain flags for a handle associated with a character device. This sub function may not be used for a handle that is associated with a file.
INT 21H (0x21)
Function 44H (0x44 or 68), Sub function 02H (0x02) I/O Ctrl --> read control data character device driver
Call with: AH = 44H
AL = 02H
BX = handle
CX = number of bytes to read
DS: DX = segment: offset of buffer
Returns: If function is successful
Carry flag = clear
AX = bytes read
And buffer contains control data from driver
If function is unsuccessful
Carry flag = set
AX = error code
Comments:
It reads control data from a character-device driver. The length and contents of the data are specified to each device driver and do not follow any standard format. This function does not necessarily result in any input from the physical device.
INT 21H (0x21)
Function 44H (0x44 or 68), Sub function 03H (0x03) I/O Ctrl --> write control data character-device driver
Call with: AH = 44H
AL = 03H
BX = handle
CX = number of bytes to write
DS: DX = segment: offset of data
Returns: If function successful
Carry flag = clear
AX = bytes transferred
If function unsuccessful
Carry flag = set
AX = error code
Comments:
This sub function transfers control data from an application to a character-device driver. The length and contents of the data are specific to each device driver and do not follow any standard format. This function does not necessarily result if any output to the physical device.
INT 21H (0x21)
Function 44H (0x44 or 68), Sub function 04H (0x04) I/O Ctrl --> Read control data block-device driver
Call with: AH = 44H
AL = 04H
BL = device code (0= default, 1=A,
2=B, etc.)
CX = number of bytes to read
DS: DX = segment: offset of buffer
Returns: If function successful
Carry flag = clear
AX = bytes transferred
And buffer contains control data from device driver
If function unsuccessful
Carry flag = set
AX = error code
Comments:
This sub function transfers control data from a block-device driver directly into an application program’s buffer. The length and contents of the data are specific to each device driver and do not follow any standard format. This function does not necessarily result in input from the physical device.
INT 21H (0x21)
Function 44H (0x44 or 68), Sub function 05H (0x05) I/O Ctrl --> write control data block-device driver
Call with: AH = 44H
AL = 05H
BL = device code (0= default, 1=A,
2=B, etc.)
CX = number of bytes to write
DS: DX = segment: offset of data
Returns: If function successful
Carry flag = clear
AX = bytes transferred
If function unsuccessful
Carry flag = set
AX = error code
Comments:
This sub function transfers control data from an application program directly to a block-device driver. The length and contents of the control data are specific to each device driver and do not follow any standard format. This function does not necessarily result any output to the physical device.
INT 21H (0x21)
Function 44H (0x44 or 68), Sub function 06H (0x06) I/O Ctrl --> check input status
Call with: AH = 44H
AL = 06H
BX = handle
Returns: If function successful
Carry flag = clear
And for a device:
AL = 00H, if device not ready
FFH, if device ready
For a file:
AL = 00H, if file pointer at EOF
FFH, if file pointer not at EOF
If function unsuccessful
Carry flag = set
AX = error code
Comments:
It returns a code indicating whether the device or files associated with a handle is ready for input.
INT 21H (0x21)
Function 44H (0x44 or 68), Sub function 07H (0x07) I/O Ctrl --> check output status
Call with: AH = 44H
AL = 07H
BX = handle
Returns: If function successful
Carry flag = clear
And for a device:
AL = 00H, if device not ready
FFH, if device ready
For a file:
AL = FFH
If function unsuccessful
Carry flag = set
AX = error code
Comments:
It returns a code indicating whether the device associated with a handle is ready for output.
INT 21H (0x21)
Function 44H (0x44 or 68), Sub function 08H (0x08) I/O Ctrl --> check if block device is removable
Call with: AH = 44H
AL = 08H
BL = drive number (0 = default, 1=A,
2=B, etc.)
Returns: If function successful
Carry flag = clear
AL = 00H, if medium is removable
01H, if medium is not removable
If function unsuccessful
Carry flag = set
AX = error code
Comments:
This sub function checks whether the specified block device contains a removable storage medium, such as a floppy disk. If a file is not found as expected on a particular drive, a program can use this sub function to determine whether the user should be prompted to insert another disk.
INT 21H (0x21)
Function 44H (0x44 or 68), Sub function 09H (0x09) I/O Ctrl --> check if block device is remote
Call with: AH = 44H
AL = 09H
BL = drive number (0 = default, 1=A,
2=B, etc.)
Returns: If function successful
Carry flag = clear
DX = device attribute word
bit 12 = 0, if drive is local
= 1, if drive is remote
If function unsuccessful
Carry flag = set
AX = error code
Comments:
This sub function checks whether the specified block device is local (attached to the computer running the program) or remote (redirected to a network server).
INT 21H (0x21)
Function 44H (0x44 or 68), Sub function 0AH (0x0A or 10) I/O Ctrl --> check if handle is remote
Call with: AH = 44H
AL = 0AH
BX = handle
Returns: If function successful
Carry flag = clear
DX = attribute word for file or device
bit 15 = 0 if local
1 if remote
If function unsuccessful
Carry flag = set
AX = error code
Comments:
It checks whether the specified handle refers to a file or device that is local (located on the PC that is running program) or remote (located on a network server).
INT 21H (0x21)
Function 44H (0x44 or 68), Sub function 0BH (0x0B or 11) I/O Ctrl --> change sharing retry count
Call with: AH = 44H
AL = 0BH
CX = delays per retry (default = 1)
DX = number of retries (default = 3)
Returns: If function successful
Carry flag = clear
If function unsuccessful
Carry flag = set
AX = error code
Comments:
This sub function sets the number of times MS-DOS retries a disk operation after a failure caused by a file-sharing violation before it returns an error to the requesting process. This sub function is not available unless the file sharing module is loaded.
|