Note: This API call is for DOS and Win16 personality only. Use Family API for portability.

INT 21H

Version

1 and higher

Brief

DOS API Dispatcher

Family API

Family API functions

Win16 API

Dos3Call, NoHookDosCall

Input

AH	Description	Version	Implemented in DOSKRNL	osFree MacroLib API	FamilyAPI	Win16 API
00H	Program terminate	1.0+	@Exit	DosExit	—
01H	Character input	1.0+	Yes	—	KbdCharIn	—
02H	Character output	1.0+	Yes	@DispCh	VioWrtTTY	—
03H	Auxiliary input	1.0+	Yes	—	DosDevIOCtl	—
04H	Auxiliary output	1.0+	Yes	—	DosDevIOCtl	—
05H	Printer output	1.0+	Yes	@PrtCh	DosDevIOCtl	—
06H	Direct console I/O	1.0+	Yes	—	KbdCharIn, VioWrtTTY	—
07H	Direct console input without echo	1.0+	Yes	—	KbdCharIn	—
08H	Console input without echo	1.0+	Yes	—	KbdCharIn	—
09H	Display string	1.0+	Yes	@DispStr	VioWrtCharStr	—
0AH	Buffered keyboard input	1.0+	Yes	@GetStr	KbdStringIn	—
0BH	Get input status	1.0+	Yes	—	KbdPeek	—
0CH	Flush input buffer and input	1.0+	Yes	—	KbdFlushBuffer	—
0DH	Disk reset	1.0+	—	DosBufReset	—
0EH	Set default drive	1.0+	@SetDrv	DosSelectDisk	—
0FH	Open file (FCB)	1.0+	—	—	—
10H	Close file (FCB)	1.0+	—	—	—
11H	Find first file (FCB)	1.0+	—	—	—
12H	Find next file (FCB)	1.0+	—	—	—
13H	Delete file (FCB)	1.0+	—	—	—
14H	Sequential read (FCB)	1.0+	—	—	—
15H	Sequential write (FCB)	1.0+	—	—	—
16H	Create or truncate file (FCB)	1.0+	—	—	—
17H	Rename file (FCB)	1.0+	—	—	—
19H	Get default drive	1.0+	@GetDrv	DosQCurDisk	—
1AH	Set disk transfer address	1.0+	@SetDTA	—	—
1BH	Get allocation info for default drive	1.0+	—	DosQFSInfo	—
1CH	Get allocation info for specified drive	1.0+	—	DosQFSInfo	—
1FH	Get disk parameter block for default drive	1.0+	—	—	—
21H	Random read (FCB)	1.0+	—	—	—
22H	Random write (FCB)	1.0+	—	—	—
23H	Get file size in records (FCB)	1.0+	—	—	—
24H	Set random record number (FCB)	1.0+	—	—	—
25H	Set interrupt vector	1.0+	@SetInt	—	—
26H	Create PSP	1.0+	—	—	—
27H	Random block read (FCB)	1.0+	—	—	—
28H	Random block write (FCB)	1.0+	—	—	—
29H	Parse filename (FCB)	1.0+	—	—	—
2AH	Get date	1.0+	@GetDate	DosGetDateTime	—
2BH	Set date	1.0+	@SetDate	DosSetDateTime	—
2CH	Get time	1.0+	@GetTime	DosGetDateTime	—
2DH	Set time	1.0+	@SetTime	DosSetDateTime	—
2EH	Set verify flag	1.0+	—	DosSetVerify	—
2FH	Get disk transfer address	2.0+	@GetDTA	—	—
30H	Get DOS version	2.0+	@GetVer	DosGetVersion	GetVersion
31H	Terminate and stay resident	2.0+	@TSR	—	—
32H	Get disk parameter block for specified drive	2.0+	—	—	—
33H	Extended functions	2.0+	Yes	—	—	—
3300H	Get current extended break state	2.0+	Yes	—	—	—
3301H	Set state of extended Ctrl+C/Ctrl+Break checking	2.0+	Yes	—	—	—
3302H	Get and set extended Control-Break checking state	3.0+	Yes	—	—	—
3303H	Get current CPSW state	3.4/4.0	No	—	—	—
3304H	Set CPSW state	3.4/4.0	No	—	—	—
3305H	Get boot drive	4.0+	Yes	—	—	—
3306H	Get true version number	5.0+	Yes	—	—	—
34H	Get InDOS flag pointer	2.0+	—	—	—
35H	Get interrupt vector	2.0+	@GetInt	—	—
36H	Get free disk space	2.0+	@ChkDrv	DosQFSInfo	GetFreeSpace
37H	Extended functions	2.0+	—	—	—
3700H	Get switch character	2.0+	—	—	—
3701H	Set switch character	2.0+	—	—	—
3702H	Get availdev flag	2.x and 3.3+	—	—	—
3703H	Set availdev flag	2.x and 3.3+	—	—	—
38H	Get or set country info	2.0+	—	DosGetCtryInfo	—
3800H	Get current country info	2.0+	—	DosGetCtryInfo	—
3801H	Get/set specified country info	3.0+	—	DosGetCtryInfo	—
39H	Create subdirectory	2.0+	@MkDir	DosMkDir	CreateDirectory
3AH	Remove subdirectory	2.0+	@RmDir	DosRmDir	RemoveDirectory
3BH	Change current directory	2.0+	@ChDir	DosChDir	SetCurrentDirectory
3CH	Create or truncate file	2.0+	@MakFil	DosOpen	_lcreat
3DH	Open file	2.0+	@OpenFil	DosOpen	_lopen
3EH	Close file	2.0+	@ClosFil	DosClose	_lclose
3FH	Read file or device	2.0+	@Read	DosRead	_lread
40H	Write file or device	2.0+	@Write	DosWrite	_lwrite
41H	Delete file	2.0+	@DelFil	DosDelete	—
42H	Move file pointer	2.0+	@MovePtrAbs / @MovePtrRel / @GetFilSz	DosChgFilePtr	_llseek
43H	Extended functions	2.0+	—	DosQFileMode / DosSetFileMode	—
4300H	Get file attributes	2.0+	—	DosQFileMode	—
4301H	Set file attributes	2.0+	—	DosSetFileMode	—
44H	Extended functions	2.0+	—	DosDevIOCtl	—
4400H	Get device information	2.0+	—	DosDevIOCtl	—
4401H	Set device information	2.0+	—	DosDevIOCtl	—
4402H	Read from character device control channel	2.0+	—	DosDevIOCtl	—
4403H	Write to character device control channel	2.0+	—	DosDevIOCtl	—
4404H	Read from block device control channel	2.0+	—	DosDevIOCtl	—
4405H	Write to block device control channel	2.0+	—	DosDevIOCtl	—
4406H	Get input status	2.0+	—	DosDevIOCtl	—
4407H	Get output status	2.0+	—	DosDevIOCtl	—
4408H	Check if block device removable	3.0+	—	DosDevIOCtl	GetDriveType
4409H	Check if block device remote	3.1+	—	DosDevIOCtl	GetDriveType
440AH	Check if handle is remote	3.1+	—	DosDevIOCtl	—
440BH	Set sharing retry count	3.1+	—	DosDevIOCtl	—
440CH	Generic character device request	3.2+	—	DosDevIOCtl	—
440DH	Generic block device request	3.2+	—	DosDevIOCtl	—
440EH	Get logical drive map	3.2+	—	DosDevIOCtl	—
440FH	Set logical drive map	3.2+	—	DosDevIOCtl	—
4410H	Query generic IOCTL capability (handle)	5.0+	—	DosDevIOCtl	—
4411H	Query generic IOCTL capability (drive)	5.0+	—	DosDevIOCtl	—
45H	Duplicate handle	2.0+	XDUP	DosDupHandle	—
46H	Redirect handle	2.0+	XDUP2	DosDupHandle	—
47H	Get current directory	2.0+	@GetDir	DosQCurDir	GetCurrentDirectory
48H	Allocate memory	2.0+	@GetBlok	DosAllocSeg	GlobalAlloc
49H	Release memory	2.0+	@FreeBlok	DosFreeSeg	GlobalFree
4AH	Reallocate memory	2.0+	@ModBlok	DosReallocSeg	GlobalReAlloc
4BH	Execute program	2.0+	@Exec	DosExecPgm	WinExec
4CH	Terminate with return code	2.0+	@Exit	DosExit	—
4DH	Get program return code	2.0+	@GetRet	—	—
4EH	Find first file	2.0+	@GetFirst	DosFindFirst	—
4FH	Find next file	2.0+	@GetNext	DosFindNext	—
50H	Set current PSP	2.0+	Yes	—	—	—
51H	Get current PSP	2.0+	Yes	GET_PSP	DosGetInfoSeg (косвенно)	—
52H	Get DOS internal pointers (SYSVARS)	2.0+	—	—	—
53H	Create disk parameter block	2.0+	—	—	—
54H	Get verify flag	2.0+	—	DosQVerify	—
55H	Create program PSP	2.0+	—	—	—
56H	Rename file	2.0+	@MoveFil	DosMove	—
57H	Extended functions	2.0+	—	DosQFileInfo / DosSetFileInfo	—
5700H	Get file's last-written date and time	2.0+	—	DosQFileInfo	—
5701H	Set file's last-written date and time	2.0+	—	DosSetFileInfo	—
58H	Get or set allocation strategy	2.11+	—	—	—
5800H	Get memory allocation strategy	2.11+	—	—	—
5801H	Set memory allocation strategy	2.11+	—	—	—
5802H	Get UMB link state	5+	—	—	—
5803H	Set UMB link state	5+	—	—	—
59H	Get extended error info	3.0+	GET_ERROR	DosErrClass	GetLastError
5AH	Create unique file	3.0+	CREATE_TEMP	DosOpen	GetTempFileName
5BH	Create new file	3.0+	CREATE_NEW	DosOpen	_lcreat
5CH	Lock or unlock file	3.0+	LOCK_FILE / UNLOCK	DosFileLocks	LockFile<br/>UnlockFile
5C00H	Lock region of file	3.0+	LOCK_FILE	DosFileLocks	LockFile
5C01H	Unlock region of file	3.0+	UNLOCK	DosFileLocks	UnlockFile
5DH	File sharing functions	3.0+	—	—	—
5D07H	Get redirected printer mode	3.1+	—	—	—
5D08H	Set redirected printer mode	3.1+	—	—	—
5D09H	Flush redirecter printer output	3.1+	—	—	—
5D0AH	Set extended error information	3.1+	—	—	—
5EH	Network functions	3.0+	GET_MACHINE_NAME / PRINTER_SETUP	—	WNetAddConnection<br/>WNetCancelConnection
5E00H	Get machine name	3.1+	GET_MACHINE_NAME	—	GetComputerName
5E01H	Set machine name	3.1+	—	—	—
5E02H	Set network printer setup string	3.1+	PRINTER_SETUP	—	—
5E03H	Get network printer setup string	3.1+	—	—	—
5E04H	Set printer mode	3.1+	—	—	—
5E05H	Get printer mode	3.1+	—	—	—
5FH	Network redirection functions	3.0+	GET_LIST / REDIR / CANCEL_REDIR	—	WNetGetConnection
5F00H	Get redirection mode	3.1+	—	—	—
5F01H	Set redirection mode	3.1+	—	—	—
5F02H	Get redirection list entry	3.1+	GET_LIST	—	WNetGetConnection
5F03H	Redirect device	3.1+	REDIR	—	WNetAddConnection
5F04H	Cancel redirection	3.1+	CANCEL_REDIR	—	WNetCancelConnection
5F05H	Get extended redirection list entry	4+	—	—	—
5F07H	Enable drive	5+	—	—	—
5F08H	Disable drive	5+	—	—	—
60H	Qualify filename	3.0+	—	—	—
61H	OS/2 File System Join/Subst	OS/2 1.0+	—	—	—
62H	Get current PSP	3.0+	Yes	GET_PSP	DosGetInfoSeg (косвенно)	—
63H	Get DBCS lead byte table pointer	3.0+	—	DosGetDBCSEv	—
64H	Set wait for external event flag / OS/2 VDM API	3.2+ / OS/2 2.0+	—	—	—
65H	Get extended country info	3.3+	—	DosGetCtryInfo	—
6500H	Set general internationalization info	7.1+	—	DosGetCtryInfo	—
6501H	Get general internationalization info	3.3+	—	DosGetCtryInfo	—
6502H	Get pointer to uppercase table	3.3+	—	DosGetCtryInfo	—
6503H	Get pointer to lowercase table	6.2+	—	DosGetCtryInfo	—
6504H	Get pointer to filename uppercase table	3.3+	—	DosGetCtryInfo	—
6505H	Get pointer to filename terminator table	3.3+	—	DosGetCtryInfo	—
6506H	Get pointer to collating sequence table	3.3+	—	DosGetCollate	—
6507H	Get pointer to Double-Byte Character Set table	4+	—	DosGetDBCSEv	—
6520H	Capitalize character	4+	—	DosCaseMap	AnsiUpper
6521H	Capitalize string	4+	—	DosCaseMap	AnsiUpperBuff
6522H	Capitalize ASCIZ string	4+	—	DosCaseMap	AnsiUpper
6523H	Determine if character represents Yes/No response	4+	—	—	—
65A0H	Capitalize filename character	4+	—	DosCaseMap	AnsiUpper
65A1H	Capitalize counted filename string	4+	—	DosCaseMap	AnsiUpperBuff
65A2H	Capitalize ASCIZ filename	4+	—	DosCaseMap	AnsiUpper
66H	Get or set code page	3.3+	—	DosGetCP / DosSetCP	—
6601H	Get global code page table	3.3+	—	DosGetCP	—
6602H	Set global code page table	3.3+	—	DosSetCP	—
67H	Set handle count	3.3+	—	DosSetMaxFH	SetHandleCount
68H	Commit file	3.3+	FLUSH	DosBufReset	—
69H	Get or set media id	4.0+	—	—	—
6900H	Get serial number	4.0+	—	—	—
6901H	Set serial number	4.0+	—	—	—
6AH	Commit file	4.0+	—	DosBufReset	—
6CH	Extended open/create file	4.0+ / OS/2 1.0+	—	DosOpen	—
6DH	Extended Make directory	OS/2 1.0+	—	DosMkDir2	—
6EH	DosEnumAttrib	OS/2 1.0+	—	DosFindFirst / DosFindNext	—
6FH	DosQMaxEASize	OS/2 1.0+	—	—	—
71H	Long filename functions	7.0+ (Win95)	—	—	—
73H	FAT32 functions	7.0+ (Win95)	—	—	—

Return

Depends on function number

Macro

Notes

See Also

osFree Macro Library

Family API functions

Win16 KERNEL API

Note

DOS API
Process manager	INT 20H, INT 21H: 00H, 25H, 26H, 31H, 34H, 35H, 4BH, 4CH, 4DH, 50H, 51H, 52H, 55H, 62H, INT 22H, INT 27H, INT 28H
File manager	INT 25H, INT 26H, INT 21H: 0DH, 0EH, 0FH, 10H, 11H, 12H, 13H, 14H, 15H, 16H, 17H, 19H, 1AH, 1BH, 1CH, 21H, 22H, 23H, 24H, 27H, 28H, 29H, 2EH, 2FH, 32H, 3305H, 36H, 39H, 3AH, 3BH, 3CH, 3DH, 3EH, 3FH, 40H, 41H, 42H, 4300H, 4301H, 45H, 45H, 46H, 4EH, 4FH, 54H, 56H, 5700H, 5701H, 5AH, 5BH, 5c00H, 5c01H, 60H, 67H, 68H, 6900H, 6901H, 6AH, 6CH
Character Device I/O	INT 29H, INT 21H: 01H, 02H, 03H, 04H, 05H, 06H, 07H, 08H, 09H, 0AH, 0BH, 0AH, 0CH, 5D07H, 5D08H, 5D09H, 5D0AH
Signals	INT 23H, INT 24H, INT 21H: 3300H, 3301H, 3302H
Memory manager	INT 21H: 48H, 49H, 4AH, 5800H, 5801H, 5802H, 5803H
Date and Time	INT 21H: 2AH, 2BH, 2CH, 2DH
Misc	INT 21H: 30H, 3306H, 3700H, 3701H, 3702H, 3703H, 59H
NLS	INT 21H: 3303H, 3304H, 3800H, 3801H, 6300H, 6301H, 6301H, 6500H, 6501H, 6502H, 6503H, 6504H, 6505H, 6506H, 6507H, 6520H, 6521H, 6522H, 6523H, 65A0H, 65A1H, 65A2H, 6601H, 6602H
Devices	INT 21H: 4400H, 4401H, 4402H, 4403H, 4404H, 4405H, 4406H, 4407H, 4408H, 4409H, 440AH, 440BH, 440CH, 440DH, 440EH, 440FH, 4410H, 4411H, 53H
Network	INT 21H: 5E00H, 5E01H, 5E02H, 5E03H, 5E04H, 5E05H, 5F00H, 5F01H, 5F02H, 5F03H, 5F04H, 5F05H, 5F07H, 5F08H
osFree Macro Library
Video I/O	@SetMode @SetCurSz @SetCurPos @GetCur @SetPage @ScrollUp @ScrollDn @Scroll @GetChAtr @PutChAtr @PutCh @SetPalet @SetColor @SetDot @GetDot @WrtTTY @VideoState @GetMode @GetDisplay @GetVideoState @GetEGAInfo @Cls
Hardware info	@Equipment @MemSize
Serial I/O	@AuxInit @AuxSendChar @AuxRecieveChar @AuxStatus
Tape I/O	@TapeOn @TapeOff @TapeRead @TapeWrite
Keyboard I/O	@KbdStatus @CharIn @CharPeek
Printer I/O	@PrnPrint @PrnInit @PrnStatus
Disk I/O	@DskReset @DskStatus @DskRead @DskWrite @DskVerify @DskFormat
Date and Time	@SetTime @GetTime
Mouse	@MouInit @MouShowPointer @MouStatus @MouSetPos @MouSetMickey @MouRegion
Memory manager	@ModBlok SET_BLOCK