INT 21H (0x21) Function 1CH (0x1C or 28) Get drive data 21H (0x21 or 33) Random read 22H (0x22 or 34) Random write 23H (0x23 or 35) Get file size 24H (0x24 or 36) Set relative record number 25H (0x25 or 37) Set interrupt vector 26H (0x26 or 38) Create new Program Segment Prefix (PSP) 27H (0x27 or 39) Random block write read 28H (0x28 or 40)

Files Recovery Software
Home Contact Details Customer Support Download Demo Products  

 
 

INT 21H (0x21)

Function 1CH (0x1C or 28) --> Get drive data

Call with: AH = 1CH
DL = Drive Code

Returns: If function is successful
AL = sectors per cluster
DS: BX = segment: offset of media ID byte
CX = size of physical sector in bytes
DX = number of clusters for default or
specified drive

If function is unsuccessful and invalid drive or critical error
AL = FFH

Comments:

This function obtains allocation information about the specified disk drive and a pointer to the media identification byte from its file allocation table. Refer the media descriptor ID byte table, given in INT 21H, Function 1BH, for Media ID information.

INT 21H (0x21)

Function 1DH (0x1D or 29) --> Reserved

INT 21H (0x21)

Function 1EH (0x1E or 30) --> Reserved

INT 21H (0x21)

Function 1FH (0x1F or 31) --> Reserved

INT 21H (0x21)

Function 20H (0x20 or 32) --> Reserved

INT 21H (0x21)

Function 21H (0x21 or 33) --> Random read

Call with: AH = 21H

DS: DX = segment: offset of previously opened
file control block

Returns: AL = 00H if read successful
01H if end of file
02H if segment wrap, read canceled
03H if partial record read at end of
file

Comments:

This function reads a selected record from a file into memory. The record is read into memory at the current disk transfer area address, specified by the most recent call to INT 21H Function 1AH.

INT 21H (0x21)

Function 22H (0x22 or 34) --> Random write

Call with: AH = 22H
DS: DX = segment: offset of previously opened
file control block

Returns: AL = 00H if write successful
01H if disk full
02H if segment wrap, write canceled

Comments:

This function writes the data from memory into a selected record in a file.

INT 21H (0x21)

Function 23H (0x23 or 35) --> Get file size

Call with: AH = 23H
DS: DX = segment: offset of unopened file
control block

Returns: If function is successful and matching filename found
AL = 00H
And FCB relative-record field (offset 21H) set to the number of records in the file, rounded up if necessary to the next complete record

If function is unsuccessful and no matching file found
AL = FFH

Comments:

This function searches for a matching file in the current directory; if one is found, updates the FCB with the size of the file in terms of number of records. There is no default record size for this function therefore an appropriate value must be placed in the FCB record size field (offset 0EH) before calling this function.

INT 21H (0x21)

Function 24H (0x24 or 36) --> Set relative record number

Call with: AH = 24H
DS: DX = segment: offset of previously opened
file control block

Returns: AL is destroyed (other register not affected)
FCB relative-record field (offset 21H) updated

Comments:

This function 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.

INT 21H (0x21)

Function 25H (0x25 or 37) --> Set interrupt vector

Call with: AH = 25H
AL = interrupt number
DS: DX = segment: offset of interrupt handling
routine

Returns: Nothing

Comments:

This function Initialize a CPU interrupt vector to point to an interrupt handling routine. It should be used in preference to direct editing of the interrupt-vector table by well-behaved applications.

INT 21H (0x21)

Function 26H (0x26 or 38) --> Create new Program Segment Prefix (PSP)

Call with: AH = 26H
DX = segment: of new program segment
prefix (PSP)

Returns: Nothing

Comments:

This function copies the program segment prefix (PSP) of the currently executing program to a specified segment address in free memory, then updates the new PSP to make it usable by another program.

INT 21H (0x21)

Function 27H (0x27 or 39) --> Random block read

Call with: AH = 27H
CX = number of records to read
DS: DX = segment: offset of previously opened
file control block

Returns: AL = 00H if all requested records read
01H if end of file
02H if segment wrap
03H if partial record read at end of
file
CX = actual number of records read

Comments:

This function reads one or more sequential records from a file into memory, starting at a designated file location. If the size and location of the buffer are such that a segment overflow or wraparound would occur, the function fails with a return code of 02H and if a partial record is read at the end of file, the remainder of the record is padded with zeros.

INT 21H (0x21)

Function 28H (0x28 or 40) --> Random block write

Call with: AH = 28H
CX = number of records to write
DS: DX = segment: offset of previously opened
file control block

Returns: AL = 00H if all requested records written
01H if disk full
02H if segment wrap
CX = actual number of records written

Comments:

This function writes one or more sequential records from memory to a file, starting at a designated file location. If the size and location of the buffer are such that a segment overflow or wraparound would occur, the function fails with a return code 02H.


Previous page

page 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20

 
 

page 21 | 22 | 23 | 24 | 25 | 26

Next page
 
 
Data Recovery Book
 
Chapter 1 An Overview of Data Recovery
Chapter 2 Introduction of Hard Disks
Chapter 3 Logical Approach to Disks and OS
Chapter 4 Number Systems
Chapter 5 Introduction of C Programming
Chapter 6 Introduction to Computer Basics
Chapter 7 Necessary DOS Commands
Chapter 8 Disk-BIOS Functions and Interrupts Handling With C
Chapter 9 Handling Large Hard Disks
Chapter 10 Data Recovery From Corrupted Floppy
Chapter 11 Making Backups
Chapter 12 Reading and Modifying MBR with Programming
Chapter 13 Reading and Modifying DBR with Programming
Chapter 14 Programming for “Raw File” Recovery
Chapter 15 Programming for Data Wipers
Chapter 16 Developing more Utilities for Disks
Appendix Glossary of Data Recovery Terms
 
 
Pro Data Doctor

Home

Products

Contact Details

Customer Support

Download Demo

Terms and Conditions

 
Pro Data Doctor