Groups List Use The DOS services are invoked by placing the number of the desired function in register AH, subfunction in AL, setting the other registers to any specific requirements of the function, and invoking int 21h. On return, the requested service will be performed if possible. Most codes will return an error; some return more information. Details are contained in the listings for the individual functions. Extended error return may be obtained by calling function Int\21f\59. Register settings listed are the ones used by DOS. Some functions will return with garbage values in unused registers. Do not test for values in unspecified registers; your program may exhibit odd behavior. DOSs -GENERAL REGISTERS DS:DX pointers are the data segment register (DS) indexed to the DH and DL registers (DX). DX always contains the offset address, DS contains the segment address. The File Control Block services struc -FCB were part of DOS 1.0. Since the release of DOS 2.0, Microsoft has recommended that these services not be used. A set of considerably more enhanced services (handle services) were introduced with DOS 2.0. The handle services provide support for wildcards and subdirectories, and enhanced error detection via function Int\21f\59. The data for the following calls was compiled from various Intel, Microsoft, IBM, and other publications. There are many subtle differences between MSDOS and PCDOS and between the individual versions. Differences between the versions are noted as they occur. There are various ways of calling the DOS functions. For all methods, the function number is loaded into register AH, subfunctions and/or parameters are loaded into AL or other registers, and call int 21 by one of the following methods: A) call interrupt 21h directly (the recommended procedure) B) perform a long call to offset 50h in the program's PSP. 1) This method will not work under DOS 1.x 2) Though recommended by Microsoft for DOS 2.0, this method takes more time and is no longer recommended. C) place the function number in CL and perform an intrasegment call to location 05h in the current code segment. This location contains a long call to the DOS function dispatcher. 1) IBM recommends this method be used only when using existing programs written for different calling ng conventions. (such as converting CP/M programs). This method should be avoided unless you have some specific use for it. 2) AX is always destroyed by this method. 3) This method is valid only for functions 00h-24h. There are also various ways of exiting from a program. (assuming it is not intended to be a TSR). All methods except call Int\21f\4C must ensure that the segment register contains the segment address of the PSP. A) Int\21f\4C (Terminate with Result Code). This is the "official" recommended method of returning to DOS. B) Int\21f\00 (Exit Program). This is the early style int 21 function call. It simply calls Int\20. C) Int\20 (Exit). D) A INTEL\80x86op -JMP to offset 00h (Int\20 vector) in the Program Segment Prefix. This is just a roundabout method to call int 20h. This method was set up in DOS 1.0 for ease of conversion for CP/M programs. It is no longer recommended for use. E) A INTEL\80x86op -JMP to offset 05h (Int\21 vector) in the Program Segment Prefix, with AH set to 00h or 4Ch. This is a CP/M type function.
|file: /Techref/INT/21.htm, 3KB, , updated: 1999/4/21 07:54, local time: 2023/12/9 03:52,
|©2023 These pages are served without commercial sponsorship. (No popup ads, etc...).Bandwidth abuse increases hosting cost forcing sponsorship or shutdown. This server aggressively defends against automated copying for any reason including offline viewing, duplication, etc... Please respect this requirement and DO NOT RIP THIS SITE. Questions?|
<A HREF="http://www.massmind.org/techref/INT/21.htm"> IBM Personal Computers - DOS Function Calls</A>
|Did you find what you needed?|
Welcome to massmind.org!
Welcome to www.massmind.org!