INT 21H (0x21)
Function 48H (0x48 or 72) --> Allocate memory
block
Call with: AH = 48H
BX = number of paragraphs of memory
needed
Returns: If function successful
Carry flag = clear
Ax = base segment address of allocated
block
If function unsuccessful
Carry flag = set
AX = error code
BX = size of largest available block
(paragraphs)
Comments:
It allocates a block of memory and returns a pointer to the beginning of the allocated area.
INT 21H (0x21)
Function 49H (0x49 or 73) --> Release memory block
Call with: AH = 49H
ES = segment of block to be released
Returns: If function successful
Carry flag = clear
If function unsuccessful
Carry flag = set
AX = error code
Comments:
This function is used to Release a memory block and makes it available for use by other programs. The function will fail or can cause unpredictable system errors if the program release a memory block that does not belong to it or the segment address passed in register ES is not a valid base address for an existing memory block.
INT 21H (0x21)
Function 4AH (0x4A or 74) --> Resize memory block
Call with: AH = 4AH
BX = desired new block size in paragraphs
ES = segment of block to be modified
Returns: If function successful
Carry flag = clear
If function unsuccessful
Carry flag = set
AX = error code
BX = maximum block size available
(paragraphs)
Comments:
This function dynamically shrinks or extends a memory block, according to the needs of an application program.
INT 21H (0x21)
Function 4BH (0x4B or 75) --> Execute program (EXEC)
Call with: AH = 4BH
AL = sub function
00H = Load and Execute Program
03H = Load Overlay
ES: BX = segment: offset of parameter block
DS: DX = segment: offset of ASCIIZ program
pathname
Returns: If function successful
Carry flag = clear
Registers are preserved in the usual fashion.
If function unsuccessful
Carry flag = set
AX = error code
Comments:
This function allows an application program to run another program, regaining control when it is finished. Can also be used to load overlays, although this is use is uncommon.
INT 21H (0x21)
Function 4CH (0x4C or 76) --> Terminate process with Return code
Call with: AH = 4CH
AL = return code
Returns: Nothing
Comments:
This function terminates the current process, passing a return code to the parent process. This is one of several methods that a program can use to perform a final exit.
INT 21H (0x21)
Function 4DH (0x4D or 77) --> Get return code
Call with: AH = 4DH
Returns: AH = exit type
00H, if normal termination by INT 20H, INT 21H
Function 00H, or INT 21H Functions 4CH
01H if termination by user’s entry of Ctrl-C
02H if termination by critical-error handler
03H if termination by INT21H Function 31H or
INT 27H |
AL = return code passed by child process
(0 if child terminated by INT 20H,
INT 21H Function 00H, or INT 27H)
Comments:
This function is used by a parent process, after the successful execution of an EXEC call (INT 21H Function 4BH), to obtain the return code and termination type of a child process.
INT 21H (0x21)
Function 4EH (0x4E or 78) --> Find first file
Call with: AH = 4EH
CX = search attribute (bits may be combined)
DS: DX = segment: offset of ASCIIZ pathname
Returns: If function successful and matching file found
Carry flag = clear
And search results returned in current disk transfer area as follows:
Byte(s) |
Description |
00H-14H |
Reserved (0) |
15H |
Attribute of matched file or directory |
16H-17H
|
File time
bits 00H-04H = 2-second increments (0-29)
bits 05H-0AH = minutes (0-59)
bits 0BH-0FH = hours (0-23) |
18H-19H
|
File date
bits 00H-04H = day (1-31)
bits 05H-08H = month (1-12)
bits 09H-0FH = year (relative to 1980) |
1AH-1DH |
File size |
1EH-2AH |
ASCIIZ filename and extension |
If function is unsuccessful
Carry flag = set
AX = error code
Comments:
This function searches the default or specified directory on the default or specified drive for the first matching file for a given file specification in the form of an ASCIIZ string. For bit significance of attributes, refer bits significance table given before.
INT 21H (0x21)
Function 4FH (0x4F or 79) --> Find next file
Call with: AH = 4FH
Returns: If function is successful and matching file found
Carry flag = clear
If function is unsuccessful
Carry flag = set
AX = error code
Comments:
If there is a previous successful call to INT 21H Function 4EH, this function finds the next file in the default or specified directory on the default or specified drive that matches the original file specification.
INT 21H (0x21)
Function 50H (0x50 or 80) --> Reserved
INT 21H (0x21)
Function 51H (0x51 or 81) --> Reserved
INT 21H (0x21)
Function 52H (0x52 or 82) --> Reserved
INT 21H (0x21)
Function 53H (0x53 or 83) --> Reserved
INT 21H (0x21)
Function 54H (0x54 or 84) --> Get verify flag
Call with: AH = 54H
Returns: AL = current verify flag value
00H if verify off
01H if verify on
Comments:
This function obtains the current value of the system verify (read-after-write) flag.
INT 21H (0x21)
Function 55H (0x55 or 85) --> Reserved
INT 21H (0x21)
Function 56H (0x56 or 86) --> Rename file
Call with: AH = 56H
DS: DX = segment: offset of current ASCIIZ
pathname
ES: DI = segment: offset of new ASCIIZ
pathname
Returns: If function successful
Carry flag = clear
If function unsuccessful
Carry flag = set
AX = error code
Comments:
This function Renames a file and/or moves its directory entry to a different on the same disk. In MS-DOS versions 3.0 and later, this function can also be used to rename directories
If any element of the pathname does not exist or a file with the new pathname already exists or the current pathname specification contains a different disk drive than does the new pathname or the file is being moved to the root directory, and the root directory is full or user has insufficient rights, function to rename files fails.
|