mov bl, Drive ;0 = default, 1 = A, 2 = B, etc.
mov cx, MaxBytes ;maximum number of bytes to send
mov dx, seg Buffer
mov ds, dx
mov dx, offset Buffer ;ds:dx points to buffer containing data
mov ax, 4405h ;Send Control Data to Block Device
int 21h
jc error_handler ;carry set means error
mov ActualBytes, ax ;number of bytes sent
Send Control Data to Block Device (Function 4405h) writes control information of any length and format to a block-device driver. The format of the information is device-specific and does not follow any standard.
Drive
Specifies the drive to send information to (0 = default drive, 1 = A, 2 = B, etc.).
MaxBytes
Specifies the number of bytes to write.
Buffer
Points to the buffer that contains the data to write to the device.
If the function is successful, the carry flag is clear and the AX register contains the number of bytes sent. Otherwise, the carry flag is set and the AX register contains an error value, which may be one of the following:
Value | Name |
0001h | ERROR_INVALID_FUNCTION |
0005h | ERROR_ACCESS_DENIED |
0006h | ERROR_INVALID_HANDLE |
000Dh | ERROR_INVALID_DATA |
Function 4402h Receive Control Data from Character Device
Function 4403h Send Control Data to Character Device
Function 4404h Receive Control Data from Block Device