+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+ MS-DOS 2.0\r
+\r
+ System Calls Reference\r
+\f\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+\r
+| |\r
+| C A V E A T P R O G R A M M E R |\r
+| |\r
+| Certain structures, constants and system calls below |\r
+| are private to the DOS and are extremely |\r
+| version-dependent. They may change at any time at the |\r
+| implementors' whim. As a result, they must not be |\r
+| documented to the general public. If an extreme case |\r
+| arises, they must be documented with this warning. |\r
+| |\r
+| Those structures and constants that are subject to the |\r
+| above will be marked and bracketed with the flag: |\r
+| |\r
+| C A V E A T P R O G R A M M E R |\r
+| |\r
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+\r
+\f\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+ Section 1\r
+\r
+ Extensions to existing call structure\r
+\f\r
+\r
+ Name: * Alloc - allocate memory\r
+\r
+ Assembler usage:\r
+ MOV BX,size\r
+ MOV AH,Alloc\r
+ INT 21h\r
+ ; AX:0 is pointer to allocated memory\r
+ ; if alloc fails, BX is the largest block available\r
+\r
+ Description:\r
+ Alloc returns a pointer to a free block of memory\r
+ that has the requested size in paragraphs.\r
+\r
+ Error return:\r
+ AX = error_not_enough_memory\r
+ The largest available free block is smaller\r
+ than that requested or there is no free block.\r
+ = error_arena_trashed\r
+ The internal consistency of the memory arena\r
+ has been destroyed. This is due to a user\r
+ program changing memory that does not belong\r
+ to it.\r
+\f\r
+\r
+ Name: * CharOper - change incompatible configuration\r
+ parameters\r
+\r
+ Assembler usage:\r
+ MOV AH, CharOper\r
+ MOV AL, func\r
+ MOV DL, data\r
+ INT 21h\r
+ ; on read functions, data is returned in DL\r
+\r
+ Description:\r
+ CharOper allows a program to change system\r
+ parameters to allow for switch indicators and whether\r
+ devices are available at every level of the directory\r
+ tree.\r
+\r
+ A function code is passed in AL:\r
+\r
+ AL Function\r
+ -- --------\r
+ 0 DL, on return, will contain the DOS switch\r
+ character. On most systems this will default to\r
+ '-'.\r
+ 1 Set the switch character to the character in DL.\r
+ 2 Read the device availability byte into DL. If\r
+ this byte is 0, then devices must be accessed in\r
+ file I/O calls by /dev/device. If this byte is\r
+ non-zero, then the devices are available at every\r
+ node of the directory tree (i.e. CON is the\r
+ console device not the file CON). This byte is\r
+ generally 0.\r
+ 3 Set the device availability byte to the value in\r
+ DL.\r
+\r
+ Error returns:\r
+ AL = FF\r
+ The function code specified in AL is not in\r
+ the range 0:3\r
+\f\r
+\r
+ Name: * CurrentDir - return text of current directory\r
+\r
+ Assembler usage:\r
+ MOV AH,CurrentDir\r
+ LDS SI,area\r
+ MOV DL,drive\r
+ INT 21h\r
+ ; DS:SI is a pointer to 64 byte area that contains\r
+ ; drive current directory.\r
+\r
+ Description:\r
+ CurrentDir returns the current directory for a\r
+ particular drive. The directory is root-relative and\r
+ does not contain the drive specifier. The drive code\r
+ passed in DL is 0=default, 1=A, 2=B, etc.\r
+\r
+ Error returns:\r
+ AX = error_invalid_drive\r
+ The drive specified in DL was invalid.\r
+\f\r
+\r
+ Name: * Dealloc - free allocated memory\r
+\r
+ Assembler usage:\r
+ MOV ES,block\r
+ MOV AH,dealloc\r
+ INT 21h\r
+\r
+ Description:\r
+ Dealloc returns a piece of memory to the system\r
+ pool that was allocated by alloc.\r
+\r
+ Error return:\r
+ AX = error_invalid_block\r
+ The block passed in ES is not one allocated\r
+ via Alloc.\r
+ = error_arena_trashed\r
+ The internal consistency of the memory arena\r
+ has been destroyed. This is due to a user\r
+ program changing memory that does not belong\r
+ to it.\r
+\f\r
+\r
+ Name: * FileTimes - get/set the write times of a\r
+ handle\r
+\r
+ Assembler usage:\r
+ MOV AH, FileTimes\r
+ MOV AL, func\r
+ MOV BX, handle\r
+ ; if AL = 1 then then next two are mandatory\r
+ MOV CX, time\r
+ MOV DX, date\r
+ INT 21h\r
+ ; if AL = 0 then CX/DX has the last write time/date\r
+ ; for the handle.\r
+\r
+ Description:\r
+ FileTimes returns or sets the last-write time for\r
+ a handle. These times are not recorded until the file\r
+ is closed.\r
+\r
+ A function code is passed in AL:\r
+\r
+ AL Function\r
+ -- --------\r
+ 0 Return the time/date of the handle in CX/DX\r
+ 1 Set the time/date of the handle to CX/DX\r
+\r
+ Error returns:\r
+ AX = error_invalid_function\r
+ The function passed in AL was not in the range\r
+ 0:1.\r
+ = error_invalid_handle\r
+ The handle passed in BX was not currently\r
+ open.\r
+\f\r
+\r
+ Name: * FindFirst - find matching file\r
+\r
+ Assembler usage:\r
+ MOV AH, FindFirst\r
+ LDS DX, pathname\r
+ MOV CX, attr\r
+ INT 21h\r
+ ; DMA address has datablock\r
+\r
+ Description:\r
+ FindFirst takes a pathname with wildcards in the\r
+ last component (passed in DS:DX), a set of attributes\r
+ (passed in CX) and attempts to find all files that\r
+ match the pathname and have a subset of the required\r
+ attributes. A datablock at the current DMA is written\r
+ that contains information in the following form:\r
+\r
+ find_buf STRUC\r
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+\r
+| C A V E A T P R O G R A M M E R |\r
+| |\r
+ find_buf_sattr DB ? ; attribute of search\r
+ find_buf_drive DB ? ; drive of search\r
+ find_buf_name DB 11 DUP (?); search name\r
+ find_buf_LastEnt DW ? ; LastEnt\r
+ find_buf_ThisDPB DD ? ; This DPB\r
+ find_buf_DirStart DW ? ; DirStart\r
+| |\r
+| C A V E A T P R O G R A M M E R |\r
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+\r
+\r
+ find_buf_attr DB ? ; attribute found\r
+ find_buf_time DW ? ; time\r
+ find_buf_date DW ? ; date\r
+ find_buf_size_l DW ? ; low(size)\r
+ find_buf_size_h DW ? ; high(size)\r
+ find_buf_pname DB 13 DUP (?) ; packed name\r
+ find_buf ENDS\r
+\r
+ To obtain the subsequent matches of the pathname,\r
+ see the description of FindNext\r
+\r
+ Error Returns:\r
+ AX = error_file_not_found\r
+ The path specified in DS:DX was an invalid\r
+ path.\r
+ = error_no_more_files\r
+ There were no files matching this\r
+ specification.\r
+\f\r
+\r
+ Name: * FindNext - step through a directory matching\r
+ files\r
+\r
+ Assembler usage:\r
+ ; DMA points at area returned by find_first\r
+ MOV AH, findnext\r
+ INT 21h\r
+ ; next entry is at dma\r
+\r
+ Description:\r
+ FindNext finds the next matching entry in a\r
+ directory. The current DMA address must point at a\r
+ block returned by FindFirst (see FindFirst).\r
+\r
+ Error Returns:\r
+ AX = error_no_more_files\r
+ There are no more files matching this pattern.\r
+\f\r
+\r
+ Name: * GetDMA - get current DMA transfer address\r
+\r
+ Assembler usage:\r
+ MOV AH,GetDMA\r
+ INT 21h\r
+ ; ES:BX has current DMA transfer address\r
+\r
+ Description:\r
+ Return DMA transfer address.\r
+\r
+ Error returns:\r
+ None.\r
+\f\r
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+\r
+| C A V E A T P R O G R A M M E R |\r
+| |\r
+\r
+ Name: * GetDSKPT(DL) - get pointer to drive parameter\r
+ block\r
+\r
+ Assembler usage:\r
+ MOV AH,GetDSKPT\r
+ INT 21h\r
+ ; DS:BX has address of drive parameter block\r
+\r
+ Description:\r
+ Return pointer to default drive parameter block.\r
+\r
+ Error returns:\r
+ None.\r
+\r
+ Assembler usage:\r
+ MOV DL,DrvNUM\r
+ MOV AH,GetDSKPTDL\r
+ INT 21h\r
+ ; DS:BX has address of drive parameter block\r
+\r
+ Description:\r
+ Return pointer to drive parameter block for drive\r
+ designated in DL (0=Default, A=1, B=2 ...)\r
+\r
+ Error returns:\r
+ AL = FF\r
+ The drive given in DL is invalid.\r
+| |\r
+| C A V E A T P R O G R A M M E R |\r
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+\r
+\f\r
+\r
+ Name: * GetFreespace - get Disk free space\r
+\r
+ Assembler usage:\r
+ MOV AH,GetFreespace\r
+ MOV DL,Drive ;0 = default, A = 1\r
+ INT 21h\r
+ ; BX = Number of free allocation units on drive\r
+ ; DX = Total number of allocation units on drive\r
+ ; CX = Bytes per sector\r
+ ; AX = Sectors per allocation unit\r
+\r
+ Description:\r
+ Return Free space on disk along with additional\r
+ information about the disk.\r
+\r
+ Error returns:\r
+ AX = FFFF\r
+ The drive number given in DL was invalid.\r
+\r
+ NOTE: This call returns the same information in the same\r
+ registers (except for the FAT pointer) as the get FAT\r
+ pointer calls did in previous versions of the DOS.\r
+\f\r
+\r
+ Name: * GetInDOSF - get DOS critical-section flag\r
+\r
+ Assembler usage:\r
+ MOV AH,GetInDOSF\r
+ INT 21h\r
+ ; ES:BX has location of the flag\r
+ MOV CritSEG, ES\r
+ MOV CritOFF, BX\r
+ ...\r
+ IntVec:\r
+ MOV AX, DWORD PTR Crit\r
+ CMP AX,0\r
+ JZ DoFunc\r
+ IRET\r
+ DoFunc: ...\r
+\r
+ Description:\r
+ Return location of indos flag. On return ES:BX is\r
+ the address of a byte memory cell inside the DOS. If\r
+ used in an interrupt service routine, it indicates\r
+ whether or not the DOS was interrupted in a critical\r
+ section. If the cell was zero, then the DOS was not\r
+ in a critical section and thus can be called by the\r
+ interrupt routine. If the cell was non-zero, the DOS\r
+ should be considered to be in an uninterruptable state\r
+ and for reliability, no DOS calls should be given.\r
+\r
+ Error returns:\r
+ None.\r
+\f\r
+\r
+ Name: * GetVector - get interrupt vector\r
+\r
+ Assembler usage:\r
+ MOV AH,GetVector\r
+ MOV AL,interrupt\r
+ INT 21h\r
+ ; ES:BX now has long pointer to interrupt routine\r
+\r
+ Description:\r
+ Return interrupt vector associated with an\r
+ interrupt.\r
+\r
+ Error returns:\r
+ None.\r
+\f\r
+\r
+ Name: * GetVerifyFlag - return current setting of the\r
+ verify after write flag.\r
+\r
+ Assembler usage:\r
+ MOV AH,GetVerifyFlag\r
+ INT 21h\r
+ ; AL is the current verify flag value\r
+\r
+ Description:\r
+ The current value of the verify flag is returned\r
+ in AL.\r
+\r
+ Error returns:\r
+ None.\r
+\f\r
+\r
+ Name: * GetVersion - get DOS version number\r
+\r
+ Assembler usage:\r
+ MOV AH,GetVersion\r
+ INT 21h\r
+ ; AL is the major version number\r
+ ; AH is the minor version number\r
+ ; BH is the OEM number\r
+ ; BL:CX is the (24 bit) user number\r
+\r
+ Description:\r
+ Return MS-DOS version number. On return AL.AH\r
+ will be the two part version designation, ie. for\r
+ MS-DOS 1.28 AL would be 1 and AH would be 28. For pre\r
+ 1.28 DOS AL = 0. Note that version 1.1 is the same as\r
+ 1.10, not the same as 1.01.\r
+\r
+ Error returns:\r
+ None.\r
+\f\r
+\r
+ Name: * International - return country dependent\r
+ information\r
+\r
+ Assembler usage:\r
+ LDS DX, blk\r
+ MOV AH, International\r
+ MOV AL, func\r
+ INT 21h\r
+\r
+ Description:\r
+ This call returns in the block of memory pointed\r
+ to by DS:DX, the following information pertinent to\r
+ international applications:\r
+\r
+ +---------------------------+\r
+ | WORD Date/time format |\r
+ +---------------------------+\r
+ | BYTE ASCIZ string |\r
+ | currency symbol |\r
+ +---------------------------+\r
+ | BYTE ASCIZ string |\r
+ | thousands separator |\r
+ +---------------------------+\r
+ | BYTE ASCIZ string decimal |\r
+ | separator |\r
+ +---------------------------+\r
+\r
+ The date/time format has the following values and\r
+ meanings:\r
+\r
+ 0 - USA standard h:m:s m/d/y\r
+ 1 - Europe standard h:m:s d/m/y\r
+ 2 - Japan standard y/m/d h:m:s\r
+\r
+ The value passed in AL is either 0 (for current\r
+ country) or a country code (to be defined later.\r
+ Currently the country code must be zero).\r
+\r
+ Error returns:\r
+ AX = error_invalid_function\r
+ The function passed in AL was not 0\r
+ (currently).\r
+\f\r
+\r
+ Name: * KeepProcess - terminate process and remain\r
+ resident\r
+\r
+ Assembler usage:\r
+ MOV AL, exitcode\r
+ MOV DX, parasize\r
+ MOV AH, KeepProcess\r
+ INT 21h\r
+\r
+ Description:\r
+ This call terminates the current process and\r
+ attempts to set the initial allocation block to a\r
+ specific size in paragraphs. It will not free up any\r
+ other allocation blocks belonging to that process.\r
+ The exit code passed in AX is retrievable by the\r
+ parent via Wait.\r
+\r
+ Error Returns:\r
+ None.\r
+\f\r
+\r
+ Name: * Rename - move a directory entry\r
+\r
+ Assembler usage:\r
+ LDS DX, source\r
+ LES DI, dest\r
+ MOV AH, Rename\r
+ INT 21h\r
+\r
+ Description:\r
+ Rename will attempt to rename a file into another\r
+ path. The paths must be on the same device.\r
+\r
+ Error returns:\r
+ AX = error_file_not_found\r
+ The file name specifed by DS:DX was not found.\r
+ = error_not_same_device\r
+ The source and destination are on different\r
+ drives.\r
+ = error_access_denied\r
+ The path specified in DS:DX was a directory or\r
+ the file specified by ES:DI exists or the\r
+ destination directory entry could not be\r
+ created.\r
+\f\r
+\r
+ Name: * SetBlock - modify allocated blocks\r
+\r
+ Assembler usage:\r
+ MOV ES,block\r
+ MOV BX,newsize\r
+ MOV AH,setblock\r
+ INT 21h\r
+ ; if setblock fails for growing, BX will have the\r
+ ; maximum size possible\r
+\r
+ Description:\r
+ Setblock will attempt to grow/shrink an allocated\r
+ block of memory.\r
+\r
+ Error return:\r
+ AX = error_invalid_block\r
+ The block passed in ES is not one allocated\r
+ via Alloc.\r
+ = error_arena_trashed\r
+ The internal consistency of the memory arena\r
+ has been destroyed. This is due to a user\r
+ program changing memory that does not belong\r
+ to it.\r
+ = error_not_enough_memory\r
+ There was not enough free memory after the\r
+ specified block to satisfy the grow request.\r
+\f\r
+\r
+ Name: * SetCtrlCTrapping - turn on/off broad ^C\r
+ checking\r
+\r
+ Assembler usage:\r
+ MOV DL,val\r
+ MOV AH,SetCtrlCTrapping\r
+ MOV AL,func\r
+ INT 21h\r
+ ; If AL was 0, then DL has the current value of the\r
+ ; ^C check\r
+\r
+ Description:\r
+ MSDOS ordinarily checks for a ^C on the\r
+ controlling device only when doing a function 1-12\r
+ operation to that device. SetCtrlCTrapping allows the\r
+ user to expand this checking to include any system\r
+ call. For example, with the ^C trapping off, all disk\r
+ I/O will proceed without interruption while with ^C\r
+ trapping on, the ^C interrupt is given at the system\r
+ call that initiates the disk operation.\r
+\r
+ Error return:\r
+ AL = FF\r
+ The function passed in AL was not in the range\r
+ 0:1.\r
+\f\r
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+\r
+| C A V E A T P R O G R A M M E R |\r
+| |\r
+\r
+ Name: * Set_OEM_Handler - set handler for OEM\r
+ specific INT 21H calls.\r
+\r
+ Assembler usage:\r
+ LDS DX,handler_address\r
+ MOV AH,Set_OEM_Handler\r
+ INT 21H\r
+\r
+ Description:\r
+ Set handler address for 0F9H-0FFH INT 21H system\r
+ calls to DS:DX. To return the 0F9H-0FFH calls to\r
+ the uninitialized state, give DS=DX=-1.\r
+\r
+ Error returns:\r
+ None.\r
+\r
+ Handler entry:\r
+ All registers as user set them when INT 21H\r
+ issued (including SS:SP). INT 21 return is on\r
+ stack, so the correct method for the OEM handler\r
+ to return to the user is to give an IRET. The\r
+ OEM handler is free to make any INT 21H system\r
+ call (including the 0F9H- 0FFH group if the OEM\r
+ handler is re-entrant).\r
+\r
+\r
+ The AH INT 21H function codes 0F8H through 0FFH are\r
+ reserved for OEM extensions to the INT 21H calling\r
+ convention. These calls have two states, initialized\r
+ and uninitialized. There will be one handler for all 7\r
+ (0F9-0FFH) functions. When the DOS is first\r
+ initialized, these calls are uninitialized. The AH=0F8H\r
+ call is the call which will set the handler address for\r
+ the 0F9-0FFH calls. If the 0F9-0FFH calls are\r
+ uninitialized, an attempt to call them results in the\r
+ normal invalid system call number return.\r
+ OEMs should NOT document the 0F8 call.\r
+| |\r
+| C A V E A T P R O G R A M M E R |\r
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+\r
+\f\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+ Section 2\r
+\r
+ XENIX-compatible system calls\r
+\f\r
+\r
+\r
+ Previous to version 2.0, MSDOS had a simple single\r
+ directory structure that sufficed for small (160k to 320K)\r
+ diskettes. As the need for hard disk support grows, and\r
+ as MSDOS 2.0 will support a wide variety of hard disks,\r
+ the need for better disk organization also grows. Merely\r
+ expanding the directory is not an effective solution;\r
+ doing a 'DIR' on a directory with 1000 files is not a\r
+ user-friendly characteristic.\r
+\r
+ People, by nature, think in hierarchical terms:\r
+ organization charts and family trees, for example. It\r
+ would be nice to allow users to organize their files on\r
+ disk in a similar manner. Consider the following:\r
+\r
+ In a particular business, both sales and accounting\r
+ share a computer with a large disk and the individual\r
+ employees use it for preparation of reports and\r
+ maintaining accounting information. One would naturally\r
+ view the organization of files on the disk in this\r
+ fashion:\r
+\r
+ +-disk-+\r
+ / \\r
+ / \\r
+ / \\r
+ sales accounting\r
+ / | | \\r
+ / | | \\r
+ / | | \\r
+ John Mary Steve Sue\r
+ / | (A) | | | \\r
+ / | | | | \\r
+ / | | | | \\r
+ report accts. report accts. report report\r
+ receiv. receiv\r
+\r
+ In MSDOS 2.0 the user can arrange his files in such a\r
+ manner that files that are not part of his current task do\r
+ not interfere with that task. Pre-2.0 versions of MSDOS\r
+ has a single directory that contains files. MSDOS extends\r
+ this concept to allow a directory to contain both files\r
+ and directories and to introduce the notion of the\r
+ 'current' directory.\r
+\r
+ To specify a filename, the user could use one of two\r
+ methods, either specify a path from the root node to the\r
+ file, or specify a path from the current node to the file.\r
+ A path is a series of directory names separated by '/' and\r
+ ending with a filename. A path that starts at the root\r
+ begins with a '/'.\r
+\r
+ There is a special directory entry in each directory,\r
+ denoted by '..' that is the parent of the directory. The\r
+ root directory's parent is itself (who created God?).\r
+\r
+ Using a directory structure like the hierarchy above,\r
+ and assuming that the current directory is at point (D),\r
+ to reference the report under John, the following are all\r
+ equivalent:\r
+\r
+ report\r
+ /sales/John/report\r
+ ../John/report\r
+\r
+ To refer to the report under Mary, the following are\r
+ all equivalent:\r
+\r
+ ../Mary/report\r
+ /sales/Mary/report\r
+\r
+ To refer to the report under Sue, the following are\r
+ all equivalent.\r
+\r
+ ../../accounting/Sue/report\r
+ /accounting/Sue/report\r
+\r
+ There is no restriction in MSDOS 2.0 on the depth of a\r
+ tree (the length of the longest path from root to leaf)\r
+ except in the number of allocation units available. The\r
+ root directory will have a fixed number of entries, 64 for\r
+ the single sided diskettes to XXX for a large hard disk.\r
+ For non-root directories, there is no limit to the number\r
+ of files per directory excepting in the number of\r
+ allocation units available.\r
+\r
+ Old (pre-2.0) disks will appear to MSDOS 2.0 as having\r
+ only a root directory with files in it and no\r
+ subdirectories whatever.\r
+\r
+ Implementation of the tree-structure is simple. The\r
+ root directory is the pre-2.0 directory. Subdirectories\r
+ of the root have a special attribute set indicating that\r
+ they are directories. The subdirectories themselves are\r
+ files, linked through the FAT as usual. Their contents\r
+ are identical in character to the contents of the root\r
+ directory.\r
+\r
+ Pre-2.0 programs that use system calls not described\r
+ below will not be able to make use of files in other\r
+ directories. They will only be able to access files in\r
+ the current directory. This is no great loss of\r
+ functionality as users will aggregate their files into\r
+ sub-directories on basis of functionality; the files that\r
+ are being used will be found in the current directory.\r
+ Those that are not necessary for the current task will be\r
+ placed in other directories. Out of sight, out of mind.\r
+\r
+ There are also new attributes in 2.0. These and the\r
+ old attributes apply to the tree structured directories in\r
+ the following manner:\r
+\r
+ Attribute Meaning/Function Meaning/Function\r
+ for files for directories\r
+\r
+ volume_id Present at the root. Meaningless.\r
+ Only one file may have\r
+ this set.\r
+\r
+ directory Meaningless. Indicates that the\r
+ directory entry is a\r
+ directory. Cannot be\r
+ changed with ChMod.\r
+\r
+ read_only Old fcb-create, new Meaningless.\r
+ Creat, new open (for\r
+ write or read/write)\r
+ will fail.\r
+\r
+ archive Set when file is Meaningless.\r
+ written. Set/reset via\r
+ ChMod.\r
+\r
+ hidden/ Prevents file from Prevents directory\r
+ system being found in search entry from being\r
+ first/search next. found. ChDir to\r
+ New open will fail. directory will still\r
+ work.\r
+\f\r
+\r
+ Name: * ChDir - Change the current directory\r
+\r
+ Assembler usage:\r
+ LDS DX, name\r
+ MOV AH, ChDir\r
+ INT 21h\r
+\r
+ Description:\r
+ ChDir is given the ASCIZ name of the directory\r
+ which is to become the current directory. If any\r
+ member of the specified pathname does not exist, then\r
+ the current directory is unchanged. Otherwise, the\r
+ current directory is set to the string.\r
+\r
+ Error returns:\r
+ AX = error_path_not_found\r
+ The path specified in DS:DX either indicated a\r
+ file or the path was invalid.\r
+\f\r
+\r
+ Name: * ChMod - change write protection\r
+\r
+ Assembler usage:\r
+ LDS DX, name\r
+ MOV CX, attribute\r
+ MOV AL, func\r
+ MOV AH, ChMod\r
+ INT 21h\r
+\r
+ Description:\r
+ Given an ASCIZ name, ChMod will set/get the\r
+ attributes of the file to those given in CX.\r
+\r
+ A function code is passed in AL:\r
+\r
+ AL Function\r
+ -- --------\r
+ 0 Return the attributes of the file in CX\r
+ 1 Set the attributes of the file to those in CX\r
+\r
+ Error returns:\r
+ AX = error_path_not_found\r
+ The path specified was invalid.\r
+ = error_access_denied\r
+ The attributes specified in CX contained one\r
+ that could not be changed (directory, volume\r
+ ID).\r
+ = error_invalid_function\r
+ The function passed in AL was not in the range\r
+ 0:1.\r
+\f\r
+\r
+ Name: * Close - close a file handle\r
+\r
+ Assembler usage:\r
+ MOV BX, handle\r
+ MOV AH, Close\r
+ INT 21h\r
+\r
+ Description:\r
+ In BX is passed a file handle (like that returned\r
+ by Open, Creat or Dup); the Close call will close the\r
+ associated file. Internal buffers are flushed.\r
+\r
+ Error return:\r
+ AX = error_invalid_handle\r
+ The handle passed in BX was not currently\r
+ open.\r
+\f\r
+\r
+ Name: * Creat - create a file\r
+\r
+ Assembler usage:\r
+ LDS DX, name\r
+ MOV AH, Creat\r
+ MOV CX, attribute\r
+ INT 21h\r
+ ; AX now has the handle\r
+\r
+ Description:\r
+ Creat creates a new file or truncates an old file\r
+ to zero length in preparation for writing. If the\r
+ file did not exist, then the file is created in the\r
+ appropriate directory and the file is given the\r
+ read/write protection code of access.\r
+\r
+ CX contains the default attributes to be set for\r
+ the file. Currently, the read-only bit must be off.\r
+\r
+ Error returns:\r
+ AX = error_access_denied\r
+ The attributes specified in CX contained one\r
+ that could not be created (directory, volume\r
+ ID), a file already existed with a more\r
+ inclusive set of attributes, or a directory\r
+ existed with the same name.\r
+ = error_path_not_found\r
+ The path specified was invalid.\r
+ = error_too_many_open_files\r
+ The file was created with the specified\r
+ attributes, but there were no free handles\r
+ available for the process or that the internal\r
+ system tables were full.\r
+\f\r
+\r
+ Name: * Dup - duplicate a file handle\r
+\r
+ Assembler usage:\r
+ MOV BX, fh\r
+ MOV AH, Dup\r
+ INT 21h\r
+ ; AX has the returned handle\r
+\r
+ Description:\r
+ Dup takes an already opened file handle and\r
+ returns a new handle that refers to the same file at\r
+ the same position.\r
+\r
+ Error returns:\r
+ AX = error_invalid_handle\r
+ The handle passed in BX was not currently\r
+ open.\r
+ = error_too_many_open_files\r
+ There were no free handles available in the\r
+ current process or the internal system tables\r
+ were full.\r
+\f\r
+\r
+ Name: * Dup2 - force a duplicate of a handle\r
+\r
+ Assembler usage:\r
+ MOV BX, fh\r
+ MOV CX, newfh\r
+ MOV AH, Dup2\r
+ INT 21h\r
+\r
+ Description:\r
+ Dup2 will cause newfh to refer to the same stream\r
+ as fh. If there was an open file on newfh, then it is\r
+ closed first.\r
+\r
+ Error returns:\r
+ AX = error_invalid_handle\r
+ The handle passed in BX was not currently\r
+ open.\r
+\f\r
+\r
+ Name: * Exec - load / execute a program\r
+\r
+ Assembler usage:\r
+ LDS DX, name\r
+ LES BX, blk\r
+ MOV AH, Exec\r
+ MOV AL, func\r
+ INT 21h\r
+\r
+ Description:\r
+ This call allows a program to load another program\r
+ into memory and (default) begin execution of it.\r
+ DS:DX points to the ASCIZ name of the file to be\r
+ loaded. ES:BX points to a parameter block for the\r
+ load.\r
+\r
+ A function code is passed in AL:\r
+\r
+ AL Function\r
+ -- --------\r
+ 0 Load and execute the program. A program header is\r
+ established for the program and the terminate and\r
+ ^C addresses are set to the instruction after the\r
+ EXEC system call.\r
+\r
+ NOTE: When control is returned, via a ^C or\r
+ terminate, from the program being EXECed ALL\r
+ registers are altered including the stack.\r
+ This is because control is returned from the\r
+ EXECed program, not the system. To regain\r
+ your stack, store an SS:SP value in a data\r
+ location reachable from your CS.\r
+\r
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+\r
+| C A V E A T P R O G R A M M E R |\r
+| |\r
+ 1 Load, create the program header but do not begin\r
+ execution. The CS:IP/SS:SP of the program are\r
+ returned in the area provided by the user.\r
+| |\r
+| C A V E A T P R O G R A M M E R |\r
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+\r
+\r
+ 3 Load, do not create the program header, and do not\r
+ begin execution. This is useful in loading\r
+ program overlays.\r
+\r
+ For each value of AL, the block has the following\r
+ format:\r
+\r
+ AL = 0 -> load/execute program\r
+\r
+ +---------------------------+\r
+ | WORD segment address of |\r
+ | environment. |\r
+ +---------------------------+\r
+ | DWORD pointer to command |\r
+ | line at 80h |\r
+ +---------------------------+\r
+ | DWORD pointer to default |\r
+ | FCB to be passed at 5Ch |\r
+ +---------------------------+\r
+ | DWORD pointer to default |\r
+ | FCB to be passed at 6Ch |\r
+ +---------------------------+\r
+\r
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+\r
+| C A V E A T P R O G R A M M E R |\r
+| |\r
+ AL = 1 -> load program\r
+\r
+ +---------------------------+\r
+ | WORD segment address of |\r
+ | environment. |\r
+ +---------------------------+\r
+ | DWORD pointer to command |\r
+ | line at 80h |\r
+ +---------------------------+\r
+ | DWORD pointer to default |\r
+ | FCB to be passed at 5Ch |\r
+ +---------------------------+\r
+ | DWORD pointer to default |\r
+ | FCB to be passed at 6Ch |\r
+ +---------------------------+\r
+ | DWORD returned value of |\r
+ | SS:SP |\r
+ +---------------------------+\r
+ | DWORD returned value of |\r
+ | CS:IP |\r
+ +---------------------------+\r
+| |\r
+| C A V E A T P R O G R A M M E R |\r
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+\r
+\r
+ AL = 3 -> load overlay\r
+\r
+ +---------------------------+\r
+ | WORD segment address where|\r
+ | file will be loaded. |\r
+ +---------------------------+\r
+ | WORD relocation factor to |\r
+ | be applied to the image. |\r
+ +---------------------------+\r
+\r
+ Note that all open files of a process are\r
+ duplicated in the child process after an Exec. This\r
+ is extremely powerful; the parent process has control\r
+ over the meanings of stdin, stdout, stderr, stdaux and\r
+ stdprn. The parent could, for example, write a series\r
+ of records to a file, open the file as standard input,\r
+ open a listing file as standard output and then Exec a\r
+ sort program that takes its input from stdin and\r
+ writes to stdout.\r
+\r
+ Also inherited (or passed from the parent) is an\r
+ 'environment'. This is a block of text strings (less\r
+ than 32K bytes total) that convey various\r
+ configurations parameters. The format of the\r
+ environment is as follows:\r
+\r
+ (paragraph boundary)\r
+ +---------------------------+\r
+ | BYTE asciz string 1 |\r
+ +---------------------------+\r
+ | BYTE asciz string 2 |\r
+ +---------------------------+\r
+ | ... |\r
+ +---------------------------+\r
+ | BYTE asciz string n |\r
+ +---------------------------+\r
+ | BYTE of zero |\r
+ +---------------------------+\r
+\r
+ Typically the environment strings have the form:\r
+\r
+ parameter=value\r
+\r
+ for example, COMMAND.COM always passes its execution\r
+ search path as:\r
+\r
+ PATH=A:/BIN;B:/BASIC/LIB\r
+\r
+ A zero value of the environment address will cause the\r
+ child process to inherit the parent's environment\r
+ unchanged.\r
+\r
+ Note that on a successful return from EXEC, all\r
+ registers, except for CS:IP, are changed.\r
+\r
+ Error return:\r
+ AX = error_invalid_function\r
+ The function passed in AL was not 0, 1 or 3.\r
+ = error_bad_environment\r
+ The environment was larger than 32Kb.\r
+ = error_bad_format\r
+ The file pointed to by DS:DX was an EXE format\r
+ file and contained information that was\r
+ internally inconsistent.\r
+ = error_not_enough_memory\r
+ There was not enough memory for the process to\r
+ be created.\r
+ = error_file_not_found\r
+ The path specified was invalid or not found.\r
+\f\r
+\r
+ Name: * Exit - terminate a process\r
+\r
+ Assembler usage:\r
+ MOV AL, code\r
+ MOV AH, Exit\r
+ INT 21h\r
+\r
+ Description:\r
+ Exit will terminate the current process,\r
+ transferring control to the invoking process. In\r
+ addition, a return code may be sent. All files open\r
+ at the time are closed.\r
+\r
+ Error returns:\r
+ None.\r
+\f\r
+\r
+ Name: * Ioctl - I/O control for devices\r
+\r
+ Assembler usage:\r
+ MOV BX, Handle\r
+\r
+ (or MOV BL, drive for calls AL=4,5\r
+ 0=default,A=1...)\r
+\r
+ MOV DX, Data\r
+\r
+ (or LDS DX, buf and\r
+ MOV CX, count for calls AL=2,3,4,5)\r
+\r
+ MOV AH, Ioctl\r
+ MOV AL, func\r
+ INT 21h\r
+ ; For calls AL=2,3,4,5 AX is the number of bytes\r
+ ; transferred (same as READ and WRITE).\r
+ ; For calls AL=6,7 AL is status returned, AL=0 if\r
+ ; status is not ready, AL=0FFH otherwise.\r
+\r
+ Description:\r
+ Set or Get device information associated with open\r
+ Handle, or send/receive control string to device\r
+ Handle or device.\r
+\r
+ The following values are allowed for func:\r
+\r
+ Request Function\r
+ ------ --------\r
+ 0 Get device information (returned in DX)\r
+ 1 Set device information (as determined by DX)\r
+ 2 Read CX number of bytes into DS:DX from device\r
+ control channel.\r
+ 3 Write CX number of bytes from DS:DX to device\r
+ control channel.\r
+ 4 Same as 2 only drive number in BL\r
+ 0=default,A=1,B=2,...\r
+ 5 Same as 3 only drive number in BL\r
+ 0=default,A=1,B=2,...\r
+ 6 Get input status\r
+ 7 Get output status\r
+\r
+ Ioctl can be used to get information about device\r
+ channels. It is ok to make Ioctl calls on regular\r
+ files but only calls 0,6 and 7 are defined in that\r
+ case (AL=0,6,7), all other calls return an\r
+ error_invalid_function error.\r
+\r
+ CALLS AL=0 and AL=1\r
+\r
+ The bits of DX are defined as follows for calls\r
+ AL=0 and AL=1. Note that the upper byte MUST be zero\r
+ on a set call.\r
+\r
+ |\r
+ 15 14 13 12 11 10 9 8|7 6 5 4 3 2 1 0\r
+ +--+--+--+--+--+--+-+-+-+-+-+-+-+-+-+-+\r
+ | R| C| |I|E|R|S|I|I|I|I|\r
+ | e| T| |S|O|A|P|S|S|S|S|\r
+ | s| R| Reserved |D|F|W|E|C|N|C|C|\r
+ | | L| |E| | |C|L|U|O|I|\r
+ | | | |V| | |L|K|L|T|N|\r
+ +--+--+--+--+--+--+-+-+-+-+-+-+-+-+-+-+\r
+ |\r
+\r
+ ISDEV = 1 if this channel is a device\r
+ = 0 if this channel is a disk file (Bits 8-15 =\r
+ 0 in this case)\r
+\r
+ If ISDEV = 1\r
+\r
+ EOF = 0 if End Of File on input\r
+ RAW = 1 if this device is in Raw mode\r
+ = 0 if this device is cooked\r
+ ISCLK = 1 if this device is the clock device\r
+ ISNUL = 1 if this device is the null device\r
+ ISCOT = 1 if this device is the console output\r
+ ISCIN = 1 if this device is the console input\r
+ SPECL = 1 if this device is special\r
+\r
+ CTRL = 0 if this device can NOT do control strings\r
+ via calls AL=2 and AL=3.\r
+ CTRL = 1 if this device can process control\r
+ strings via calls AL=2 and AL=3.\r
+ NOTE that this bit cannot be set.\r
+\r
+ If ISDEV = 0\r
+ EOF = 0 if channel has been written\r
+ Bits 0-5 are the block device number for the\r
+ channel (0 = A, 1 = B, ...)\r
+\r
+ Bits 15,8-13,4 are reserved and should not be altered.\r
+\r
+ Calls 2..5:\r
+ These four calls allow arbitrary control strings to be\r
+ sent or received from a device. The Call syntax is\r
+ the same as the READ and WRITE calls, except for 4 and\r
+ 5 which take a drive number in BL instead of a handle\r
+ in BX.\r
+\r
+ An error_invalid_function error is returned if the\r
+ CTRL bit (see above) is 0.\r
+\r
+ An error_access_denied is returned by calls AL=4,5 if\r
+ the drive number is invalid.\r
+\r
+ Calls 6,7:\r
+ These two calls allow the user to check if a file\r
+ handle is ready for input or output. Status of\r
+ handles open to a device is the intended use of these\r
+ calls, but status of a handle open to a disk file is\r
+ OK and is defined as follows:\r
+\r
+ Input:\r
+ Always ready (AL=FF) until EOF reached, then\r
+ always not ready (AL=0) unless current\r
+ position changed via LSEEK.\r
+ Output:\r
+ Always ready (even if disk full).\r
+\r
+ IMPORTANT NOTE:\r
+ The status is defined at the time the system is\r
+ CALLED. On future versions, by the time control is\r
+ returned to the user from the system, the status\r
+ returned may NOT correctly reflect the true current\r
+ state of the device or file.\r
+\r
+ Error returns:\r
+ AX = error_invalid_handle\r
+ The handle passed in BX was not currently\r
+ open.\r
+ = error_invalid_function\r
+ The function passed in AL was not in the range\r
+ 0:7.\r
+ = error_invalid_data\r
+ = error_access_denied (calls AL=4..7)\r
+\f\r
+\r
+ Name: * LSeek - move file read/write pointer\r
+\r
+ Assembler usage:\r
+ MOV DX, offsetlow\r
+ MOV CX, offsethigh\r
+ MOV AL, method\r
+ MOV BX, handle\r
+ MOV AH, LSeek\r
+ INT 21h\r
+ ; DX:AX has the new location of the pointer\r
+\r
+ Description:\r
+ LSeek moves the read/write pointer according to\r
+ method:\r
+\r
+ Method Function\r
+ ------ --------\r
+ 0 The pointer is moved to offset bytes from the\r
+ beginning of the file.\r
+ 1 The pointer is moved to the current location\r
+ plus offset.\r
+ 2 The pointer is moved to the end of file plus\r
+ offset.\r
+\r
+ Offset should be regarded as a 32-bit integer with\r
+ CX occupying the most significant 16 bits.\r
+\r
+ Error returns:\r
+ AX = error_invalid_handle\r
+ The handle passed in BX was not currently\r
+ open.\r
+ = error_invalid_function\r
+ The function passed in AL was not in the range\r
+ 0:2.\r
+\f\r
+\r
+ Name: * MkDir - Create a directory entry\r
+\r
+ Assembler usage:\r
+ LDS DX, name\r
+ MOV AH, MkDir\r
+ INT 21h\r
+\r
+ Description:\r
+ Given a pointer to an ASCIZ name, create a new\r
+ directory entry at the end.\r
+\r
+ Error returns:\r
+ AX = error_path_not_found\r
+ The path specified was invalid or not found.\r
+ = error_access_denied\r
+ The directory could not be created (no room in\r
+ parent directory), the directory/file already\r
+ existed or a device name was specified.\r
+\f\r
+\r
+ Name: * Open - access a file\r
+\r
+ Assembler usage:\r
+ LDS DX, name\r
+ MOV AH, Open\r
+ MOV AL, access\r
+ INT 21h\r
+ ; AX has error or file handle\r
+ ; If successful open\r
+\r
+ Description:\r
+ Open associates a 16-bit file handle with a file.\r
+\r
+ The following values are allowed for access:\r
+\r
+ ACCESS Function\r
+ ------ --------\r
+ 0 file is opened for reading\r
+ 1 file is opened for writing\r
+ 2 file is opened for both reading and writing.\r
+\r
+ DS:DX point to an ASCIZ name of the file to be\r
+ opened.\r
+\r
+ The read/write pointer is set at the first byte of\r
+ the file and the record size of the file is 1 byte.\r
+ The returned file handle must be used for subsequent\r
+ I/O to the file.\r
+\r
+ The DOS, on initialization, will have a maximum\r
+ number of files. See the configuration file document\r
+ for information on changing this default.\r
+\r
+ Error returns:\r
+ AX = error_invalid_access\r
+ The access specified in AL was not in the\r
+ range 0:2.\r
+ = error_file_not_found\r
+ The path specified was invalid or not found.\r
+ = error_access_denied\r
+ The user attempted to open a directory or\r
+ volume-id, or open a read-only file for\r
+ writing.\r
+ = error_too_many_open_files\r
+ There were no free handles available in the\r
+ current process or the internal system tables\r
+ were full.\r
+\f\r
+\r
+ Name: * Read - Do file/device I/O\r
+\r
+ Assembler usage:\r
+ LDS DX, buf\r
+ MOV CX, count\r
+ MOV BX, handle\r
+ MOV AH, Read\r
+ INT 21h\r
+ ; AX has number of bytes read\r
+\r
+ Description:\r
+ Read transfers count bytes from a file into a\r
+ buffer location. It is not guaranteed that all count\r
+ bytes will be read; for example, reading from the\r
+ keyboard will read at most one line of text. If the\r
+ returned value is zero, then the program has tried to\r
+ read from the end of file.\r
+\r
+ All I/O is done using normalized pointers; no\r
+ segment wraparound will occur.\r
+\r
+ Error returns:\r
+ AX = error_invalid_handle\r
+ The handle passed in BX was not currently\r
+ open.\r
+ = error_access_denied\r
+ The handle passed in BX was opened in a mode\r
+ that did not allow reading.\r
+\f\r
+\r
+ Name: * RmDir - Remove a directory entry\r
+\r
+ Assembler usage:\r
+ LDS DX, name\r
+ MOV AH, RmDir\r
+ INT 21h\r
+\r
+ Description:\r
+ RmDir is given an asciz name of a directory. That\r
+ directory is removed from its parent\r
+\r
+ Error returns:\r
+ AX = error_path_not_found\r
+ The path specified was invalid or not found.\r
+ = error_access_denied\r
+ The path specified was not empty, not a\r
+ directory, the root directory or contained\r
+ invalid information.\r
+ = error_current_directory\r
+ The path specified was the current directory\r
+ on a drive.\r
+\f\r
+\r
+ Name: * Unlink - delete a directory entry\r
+\r
+ Assembler usage:\r
+ LDS DX, name\r
+ MOV AH, Unlink\r
+ INT 21h\r
+\r
+ Description:\r
+ Unlink removes a directory entry associated with a\r
+ filename. If the file is currently open on another\r
+ handle, then no removal will take place.\r
+\r
+ Error returns:\r
+ AX = error_file_not_found\r
+ The path specified was invalid or not found.\r
+ = error_access_denied\r
+ The path specified was a directory or\r
+ read-only.\r
+\f\r
+\r
+ Name: * Wait - retrieve the return code of a child\r
+\r
+ Assembler usage:\r
+ MOV AH, Wait\r
+ INT 21h\r
+ ; AX has the exit code\r
+\r
+ Description:\r
+ Wait will return the Exit code specified by a\r
+ child process. It will return this Exit code only\r
+ once. The low byte of this code is that sent by the\r
+ Exit routine. The high byte is one of the following:\r
+\r
+ 0 - terminate/abort\r
+ 1 - ^C\r
+ 2 - Hard error\r
+ 3 - Terminate and stay resident\r
+\r
+ Error returns:\r
+ None.\r
+\f\r
+\r
+ Name: * Write - write to a file\r
+\r
+ Assembler usage:\r
+ LDS DX, buf\r
+ MOV CX, count\r
+ MOV BX, handle\r
+ MOV AH, Write\r
+ INT 21h\r
+ ; AX has number of bytes written\r
+\r
+ Description:\r
+ Write transfers count bytes from a buffer into\r
+ a file. It should be regarded as an error if the\r
+ number of bytes written is not the same as the number\r
+ requested.\r
+\r
+ It is important to note that the write system\r
+ call with a count of zero (CX = 0) will truncate\r
+ the file at the current position.\r
+\r
+ All I/O is done using normalized pointers; no\r
+ segment wraparound will occur.\r
+\r
+ Error Returns:\r
+ AX = error_invalid_handle\r
+ The handle passed in BX was not currently\r
+ open.\r
+ = error_access_denied\r
+ The handle was not opened in a mode that\r
+ allowed writing.\r
+\f\r
+\r
+The following XENIX convention is followed for the new 2.0\r
+system calls:\r
+\r
+ o If no error occurred, then the carry flag will be\r
+ reset and register AX will contain the appropriate\r
+ information.\r
+\r
+ o If an error occurred, then the carry flag will be\r
+ set and register AX will contain the error code.\r
+\r
+The following code sample illustrates the recommended method\r
+of detecting these errors:\r
+\r
+ ...\r
+ MOV errno,0\r
+ INT 21h\r
+ JNC continue\r
+ MOV errno,AX\r
+continue:\r
+ ...\r
+\r
+The word variable errno will now have the correct error code\r
+for that system call.\r
+\r
+The current equates for the error codes are:\r
+\r
+no_error_occurred EQU 0\r
+\r
+error_invalid_function EQU 1\r
+error_file_not_found EQU 2\r
+error_path_not_found EQU 3\r
+error_too_many_open_files EQU 4\r
+error_access_denied EQU 5\r
+error_invalid_handle EQU 6\r
+error_arena_trashed EQU 7\r
+error_not_enough_memory EQU 8\r
+error_invalid_block EQU 9\r
+error_bad_environment EQU 10\r
+error_bad_format EQU 11\r
+error_invalid_access EQU 12\r
+error_invalid_data EQU 13\r
+error_invalid_drive EQU 15\r
+error_current_directory EQU 16\r
+error_not_same_device EQU 17\r
+error_no_more_files EQU 18\r
+\r
+\f\r
+System call assignments:\r
+\r
+ABORT EQU 0 ; 0 0\r
+STD_CON_INPUT EQU 1 ; 1 1\r
+STD_CON_OUTPUT EQU 2 ; 2 2\r
+STD_AUX_INPUT EQU 3 ; 3 3\r
+STD_AUX_OUTPUT EQU 4 ; 4 4\r
+STD_PRINTER_OUTPUT EQU 5 ; 5 5\r
+RAW_CON_IO EQU 6 ; 6 6\r
+RAW_CON_INPUT EQU 7 ; 7 7\r
+STD_CON_INPUT_NO_ECHO EQU 8 ; 8 8\r
+STD_CON_STRING_OUTPUT EQU 9 ; 9 9\r
+STD_CON_STRING_INPUT EQU 10 ; 10 A\r
+STD_CON_INPUT_STATUS EQU 11 ; 11 B\r
+STD_CON_INPUT_FLUSH EQU 12 ; 12 C\r
+DISK_RESET EQU 13 ; 13 D\r
+SET_DEFAULT_DRIVE EQU 14 ; 14 E\r
+FCB_OPEN EQU 15 ; 15 F\r
+FCB_CLOSE EQU 16 ; 16 10\r
+DIR_SEARCH_FIRST EQU 17 ; 17 11\r
+DIR_SEARCH_NEXT EQU 18 ; 18 12\r
+FCB_DELETE EQU 19 ; 19 13\r
+FCB_SEQ_READ EQU 20 ; 20 14\r
+FCB_SEQ_WRITE EQU 21 ; 21 15\r
+FCB_CREATE EQU 22 ; 22 16\r
+FCB_RENAME EQU 23 ; 23 17\r
+GET_DEFAULT_DRIVE EQU 25 ; 25 19\r
+SET_DMA EQU 26 ; 26 1A\r
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+\r
+| C A V E A T P R O G R A M M E R |\r
+| |\r
+GET_DEFAULT_DPB EQU 31 ; 31 1F\r
+| |\r
+| C A V E A T P R O G R A M M E R |\r
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+\r
+FCB_RANDOM_READ EQU 33 ; 33 21\r
+FCB_RANDOM_WRITE EQU 34 ; 34 22\r
+GET_FCB_FILE_LENGTH EQU 35 ; 35 23\r
+GET_FCB_POSITION EQU 36 ; 36 24\r
+SET_INTERRUPT_VECTOR EQU 37 ; 37 25\r
+CREATE_PROCESS_DATA_BLOCK EQU 38 ; 38 26\r
+FCB_RANDOM_READ_BLOCK EQU 39 ; 39 27\r
+FCB_RANDOM_WRITE_BLOCK EQU 40 ; 40 28\r
+PARSE_FILE_DESCRIPTOR EQU 41 ; 41 29\r
+GET_DATE EQU 42 ; 42 2A\r
+SET_DATE EQU 43 ; 43 2B\r
+GET_TIME EQU 44 ; 44 2C\r
+SET_TIME EQU 45 ; 45 2D\r
+SET_VERIFY_ON_WRITE EQU 46 ; 46 2E\r
+; Extended functionality group\r
+GET_DMA EQU 47 ; 47 2F\r
+GET_VERSION EQU 48 ; 48 30\r
+KEEP_PROCESS EQU 49 ; 49 31\r
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+\r
+| C A V E A T P R O G R A M M E R |\r
+| |\r
+GET_DPB EQU 50 ; 50 32\r
+| |\r
+| C A V E A T P R O G R A M M E R |\r
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+\r
+SET_CTRL_C_TRAPPING EQU 51 ; 51 33\r
+GET_INDOS_FLAG EQU 52 ; 52 34\r
+GET_INTERRUPT_VECTOR EQU 53 ; 53 35\r
+GET_DRIVE_FREESPACE EQU 54 ; 54 36\r
+CHAR_OPER EQU 55 ; 55 37\r
+INTERNATIONAL EQU 56 ; 56 38\r
+; XENIX CALLS\r
+; Directory Group\r
+MKDIR EQU 57 ; 57 39\r
+RMDIR EQU 58 ; 58 3A\r
+CHDIR EQU 59 ; 59 3B\r
+; File Group\r
+CREAT EQU 60 ; 60 3C\r
+OPEN EQU 61 ; 61 3D\r
+CLOSE EQU 62 ; 62 3E\r
+READ EQU 63 ; 63 3F\r
+WRITE EQU 64 ; 64 40\r
+UNLINK EQU 65 ; 65 41\r
+LSEEK EQU 66 ; 66 42\r
+CHMOD EQU 67 ; 67 43\r
+IOCTL EQU 68 ; 68 44\r
+XDUP EQU 69 ; 69 45\r
+XDUP2 EQU 70 ; 70 46\r
+CURRENT_DIR EQU 71 ; 71 47\r
+; Memory Group\r
+ALLOC EQU 72 ; 72 48\r
+DEALLOC EQU 73 ; 73 49\r
+SETBLOCK EQU 74 ; 74 4A\r
+; Process Group\r
+EXEC EQU 75 ; 75 4B\r
+EXIT EQU 76 ; 76 4C\r
+WAIT EQU 77 ; 77 4D\r
+FIND_FIRST EQU 78 ; 78 4E\r
+; Special Group\r
+FIND_NEXT EQU 79 ; 79 4F\r
+; SPECIAL SYSTEM GROUP\r
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+\r
+| C A V E A T P R O G R A M M E R |\r
+| |\r
+SET_CURRENT_PDB EQU 80 ; 80 50\r
+GET_CURRENT_PDB EQU 81 ; 81 51\r
+GET_IN_VARS EQU 82 ; 82 52\r
+SETDPB EQU 83 ; 83 53\r
+| |\r
+| C A V E A T P R O G R A M M E R |\r
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+\r
+GET_VERIFY_ON_WRITE EQU 84 ; 84 54\r
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+\r
+| C A V E A T P R O G R A M M E R |\r
+| |\r
+DUP_PDB EQU 85 ; 85 55\r
+| |\r
+| C A V E A T P R O G R A M M E R |\r
++---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+\r
+RENAME EQU 86 ; 86 56\r
+FILE_TIMES EQU 87 ; 87 57\r
+\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0
\ No newline at end of file