n 0 and 3 (if D=0) or a number between 0 and 6 (if D=1). If D=0, then Method = (0, 1, 2, 4, 5, 6)mod 4, where 0, 1, 2, 4, 5, 6 indicate methods T0, T1, T2, T4, T5, and T6 of specifying a target. Thus, Method indicates the kind of index or frame number required to specify the target, without indicating whether the target is specified by a primary or secondary method. If D=1, then Method = 0, 1, 2, 4, 5, corresponding to methods F0, F1, F2, F4, F5 of specifying a frame. Here, Method indicates the kind (if any) of index required to specify the frame. The THRED field contains a number between 0 and 3, inclusive, and associates a thread number to the frame or target defined by the Thread field. The Index field contains a segment index, group index, or external index depending on the specification in the Method field. If Method specifies F4 or F5, this field will not be present. Fixup The Fixup field has the following format: ┌───────────┬─────┬────///────┬────///────┬────///────┐ │ │ │ │ │ │ │ LOCAT │ FIX │ Frame │ Target │ Target │ │ │ DAT │ Datum │ Datum │ Dis- │ │ │ │ │ │ Placement │ │ │ │ │ │ │ └───────────┴─────┼────///────┼────///────┼────///────│ │ │ │ │ └────────────conditional────────────┘ The LOCAT field is a byte pair with the following format: ┌───┬───┬───┬───────────┬───────────────────────────────────────┐ │ │ │ │ │ │ │ 1 │ M │ 0 │ LOC │ D a t a R e c o r d O f f s e t │ │ │ │ │ │ │ ├───┴───┴───┴───────────┴───────┬───────────────────────────────┤ │ │ │ └────────────lo byte────────────┴────────────hi byte────────────┘ M is a 1-bit field that specifies the mode of the fixups: self-relative (if M=0) or segment-relative (if M=1). ────────────────────────────────────────────────────────────────────────── Note Self-relative fixups may not be applied to LIDATA records. ────────────────────────────────────────────────────────────────────────── LOC is a 3-bit field indicating that the byte(s) in the preceding data record to be fixed up are a lobyte (if LOC=0), an offset (if LOC=1), a base (if LOC=2), a pointer (if LOC=3), a hibyte (if LOC=4), or a "loader-resolved" offset (if LOC=5). Any other values in LOC are invalid. The Data Record Offset field contains a number between 0 and 1023, inclusive, that gives the relative position of the lowest order byte of location (the actual bytes being fixed up) within the preceding data record. The Data Record Offset value is relative to the first byte in the data fields in the data records. ────────────────────────────────────────────────────────────────────────── Note If the preceding data record is an LIDATA record, it is possible for the Data Record Offset value to designate a location within a Repeat Count field or a Block Count field of the Iterated Data Block field. Such a reference is an error. The linker's action on such a malformed record is undefined. ────────────────────────────────────────────────────────────────────────── The FIX DAT field is a byte with the following format: ┌───┬───────────┬───┬───┬───────┐ │ │ │ │ │ │ │ F │ Frame │ T │ P │ TARGT │ │ │ │ │ │ │ └───┴───────────┴───┴───┴───────┘ F is a 1-bit subfield that specifies whether the frame for this fixup is specified by a thread (if F=1) or explicitly (if F=0). The Frame field contains a number that is interpreted in one of two ways, as indicated by the F bit. If F is zero, the Frame field contains a number between 0 and 5, inclusive, corresponding to methods F0,...,F5 for specifying a frame. If F=1, then the Frame field contains a thread number (0-3). It specifies the frame most recently defined by a Thread field that defined a frame thread with the same thread number. (Notice that the Thread field may appear in the same FIXUPP record, or in an earlier one.) T is a 1-bit field that specifies whether the target specified for this fixup is defined by reference to a thread (T=1), or is given explicitly in the Fixup field (T=0). P is a 1-bit field that indicates whether the Target is specified by a primary method (requires a target displacement, if P=0) or by a secondary method (requires no target displacement, if P=1). Since a target thread does not have a primary/secondary attribute, the P bit is the only field that contains the target specification attribute. TARGT is interpreted as a 2-bit field. When T=0, it provides a number between 0 and 3, inclusive, corresponding to methods T0, T1, T2 or T4, T5, T6, depending on the value of P (where P is interpreted as the high-order bit of T0, T1, T2, T4, T5, or T6). When a thread specifies the target (if T=1), then the TARGET field specifies a thread number (0-3). The Frame Datum field is the "referent" portion of a frame specification, and is a segment index, group index, or external index. The Frame Datum field is present only when the frame is not specified by a thread (if F=0) or explicitly by methods F4, F5, or F6. The Target Datum field is the "referent" portion of a target specification, and is a segment index, group index, or external index. The Target Datum field is present only when a thread does not specify the target (if T=0). The Target Displacement field is the 2-byte displacement required by primary methods of specifying targets. This field is present if P=0. ────────────────────────────────────────────────────────────────────────── Note All these methods are described in Section 7.3, "Conceptual Framework for Fixups." ────────────────────────────────────────────────────────────────────────── 7.5.15 Module End Record (MODEND) ┌─────┬───────────┬─────┬────///────┬─────┐ │ │ │ │ │ │ │ REC │ Record │ MOD │ START │ CHK │ │ TYP │ Length │ TYP │ ADDRS │ SUM │ │ 8AH │ │ │ │ │ │ │ │ │ │ │ └─────┴───────────┴─────┼────///────┼─────┘ │ │ └conditional┘ The MODEND record serves two purposes. It denotes the end of a module and indicates whether or not the module that just ended specifies an entry point to begin execution. If it does not, the linker specifies the execution address. MOD TYP The MOD TYP field specifies the attributes of the module. The bit allocation and associated meanings are as follows: ┌───────┬───┬───┬───┬───┬───┬───┐ │ │ │ │ │ │ │ │ │ MATTR │ 0 │ 0 │ 0 │ 0 │ 0 │ 1 │ │ │ │ │ │ │ │ │ └───────┴───┴───┴───┴───┴───┴───┘ MATTR is a 2-bit field that specifies the following module attributes: MATTR Module Attribute ────────────────────────────────────────────────────────────────────────── 0 Non-main module with no START ADDRS 1 Non-main module with START ADDRS 2 Main module with no START ADDRS 3 Main module with START ADDRS ────────────────────────────────────────────────────────────────────────── The START ADDRS field (present only if MATTR is 1 or 3) has the following format: ┌─────┬────///────┬────///────┬───────────┐ │ │ │ │ │ │ END │ Frame │ Target │ Target │ │ DAT │ Datum │ Datum │ Dis- │ │ │ │ │ Placement │ │ │ │ │ │ └─────┼────///────┴────///────┴───────────│ │ │ └────────────conditional────────────┘ The starting address of a module has all the attributes of any other logical reference found in a module. The mapping of a logical starting address to a physical starting address is done in the same manner as mapping any other logical address to a physical address, as specified in the discussion of fixups and the FIXUPP record. The fields of the START ADDRS field have the same semantics as the FIX DAT, Frame Datum, Target Datum, and Target Displacement fields in the FIXUPP record. Only primary fixup methods are allowed. Frame method F4 is not allowed. 7.5.16 Comment Record (COMENT) ┌─────┬───────────┬───────────┬────///────┬─────┐ │ │ │ │ │ │ │ REC │ Record │ Comment │ │ CHK │ │ TYP │ Length │ Type │ Comment │ SUM │ │ 88H │ │ │ │ │ │ │ │ │ │ │ └─────┴───────────┴───────────┴────///────┴─────┘ The COMENT record allows translators to include comments in object text. Comment Type The Comment Type field indicates the type of comment that this record carries, allowing you to structure comments for processes that selectively act on comments. The format of the Comment Type field is as follows: ┌───┬───┬───┬───┬───┬───┬───┬───┬──────────────────────┐ │ N │ N │ │ │ │ │ │ │ Comment │ │ P │ L │ 0 │ 0 │ 0 │ 0 │ 0 │ 0 │ Class │ └───┴───┴───┴───┴───┴───┴───┴───┴──────────────────────┘ The NP (NOPURGE) bit, if set to 1, indicates that this comment cannot be purged by object file utility programs that can delete Comment records. The NL (NOLIST) bit, if set to 1, indicates that the text in the Comment field should not appear in the listing file of object file utility programs that can list object Comment records. The Comment Class field is a byte defined as follows: ╓┌─┌──────────────────┌──────────────────────────────────────────────────────╖ Value Meaning ────────────────────────────────────────────────────────────────────────── 0 Language Translator Comment (obsolete) If the Comment field contains one of the strings "MS PASCAL" or "FORTRAN 77," then the Comment record enables the dsallocation switch on the Microsoft linker. Value Meaning ────────────────────────────────────────────────────────────────────────── linker. 156(9CH) DOS Version The Comment field contains a 2-byte integer that specifies the DOS level number. 157(9DH) Memory Model Indicates the memory model of the object module. The Comment field contains a single byte with the values S, M, L, or H, for SMALL, MEDIUM, LARGE, or HUGE, respectively. This Comment record is used only by the Microsoft XENIX linker. 158(9EH) Force Segment Ordering Causes the linker to use a special segment ordering for executable files. This Comment record has the same Value Meaning ────────────────────────────────────────────────────────────────────────── executable files. This Comment record has the same effect as giving the dosseg switch to Microsoft language versions of the linker. 159(9FH) Library Specifier 129(81H) Library Specifier (obsolete) Specifies a library to add to the Microsoft linker's library search list. The Comment field contains the name of the library. Notice that, unlike all other name specifications, the library name is not prefixed with its length but is determined by the record length. The nodefaultlibrarysearch switch causes the linker to ignore these Comment records. The 159(9FH) class record is ignored by XENIX versions of the Microsoft linker. 161(A1H) Microsoft Extensions Value Meaning ────────────────────────────────────────────────────────────────────────── Indicates that the object module contains extensions to the original Microsoft adaptation of the Intel Relocatable Object Module Format, such as the COMDEF ────────────────────────────────────────────────────────────────────────── Comment The Comment field provides the commentary information. 7.6 Microsoft Type Representations for Communal Variables ────────────────────────────────────────────────────────────────────────── Note Object modules not containing the COMENT record from the Microsoft Extensions class can represent communal variable definitions only with the obsolete method described here. Also, Microsoft language linkers earlier than version 3.05 can recognize this method only. The newer method uses the Communal Variable Definitions (COMDEF) record. ────────────────────────────────────────────────────────────────────────── A communal variable is defined in the object text by an EXTDEF record and the TYPDEF record to which it refers. The TYPDEF record of a communal variable has the following format: ┌─────┬────────┬───┬─────///────┬─────┐ │ REC │ Record │ │ Eight │ CHK │ │ TYP │ Length │ 0 │ Leaf │ SUM │ │ 8EH │ │ │ Descriptor │ │ └─────┴────────┴───┴─────///────┴─────┘ The Eight Leaf Descriptor field has the following format: ┌───┬────///─────┐ │ E │ Leaf │ │ N │ Descriptor │ └───┴────///─────┘ The EN bitfield specifies whether the next eight leaves in the Leaf Descriptor field are EASY (if EN = 0) or NICE (if EN = l). This byte is always zero for TYPDEFs of communal variables. The Leaf Descriptor field has one of the following two formats. The format for communal variables in the default data segment (NEAR variables) is as follows: ┌──────┬─────┬────///───┬─///────┐ │ NEAR │ VAR │ Length │ VAR │ │ 62H │ TYP │ In │ SUBTYP │ │ │ │ Bits │ │ └──────┴─────┴────///───┼──///───┤ │ │ └────────┘ (optional) The VARTYP (Variable Type) field may be either SCALAR (7BH), STRUCT (79H), or ARRAY (77H). The linker ignores the VAR SUBTYP field (if one exists). The format for communal variables not in the default data segment (FAR variables) is as follows: ┌─────┬─────┬────///───┬───///───┐ │ FAR │ VAR │ Number │ Element │ │ 61H │ TYP │ of │ Type │ │ │ 77H │ Elements │ Index │ └─────┴─────┴────///───┴───///───┘ The VARTYP field must be ARRAY (77H). The Length in Bits field specifies the Number of Elements, and the Element Type Index is an index to a previously defined TYPDEF record whose format is that of a NEAR communal variable. The format for the Length in Bits or Number of Elements fields is the same as the format of the Communal Length field of the COMDEF record. Link-Time Semantics All EXTDEF records referencing a TYPDEF record of one of the previously described formats are treated as communal variables. All others are treated as externally defined symbols for which a matching PUBDEF record is expected. For more information, see "Link-Time Semantics" in Section 7.5.8, "Communal Names Definition Record (COMDEF)." ──────────────────────────────────────────────────────────────────────────── Chapter 8 Programming Hints 8.1 Introduction 8.2 Interrupts 8.3 System Calls 8.4 Device Management 8.5 Memory Management 8.6 Process Management 8.7 File and Directory Management 8.7.1 Locking Files 8.8 Miscellaneous 8.1 Introduction This chapter describes recommended MS-DOS 4.0 programming procedures. By using these programming hints, you can ensure compatibility with future versions of MS-DOS. The hints are organized in the following categories: ■ Interrupts ■ System Calls ■ Device Management ■ Memory Management ■ Process Management ■ File and Directory Management ■ Miscellaneous 8.2 Interrupts ■ Never explicitly issue Interrupt 22H (Terminate Process Exit Address). Only the DOS should do this. To change the terminate address, use Function 35H (Get Interrupt Vector) to get the current address and save it, then use Function 25H (Set Interrupt Vector) to change the Interrupt 22H entry in the vector table to point to the new terminate address. ■ Use Interrupt 24H (Critical-Error-Handler Address) with care. The Interrupt 24H handler must preserve the ES register. An Interrupt 24H handler can issue only the system calls 01H-0CH. Making any other calls destroys the MS-DOS stack and prevents successful use of the Retry or Ignore options. When using the Retry or Ignore options, you must preserve the SS, SP, DS, BX, CX, and DX registers. ■ When an Interrupt 24H (Critical-Error-Handler Address) is received, always IRET back to MS-DOS with one of the standard responses. Programs that do not IRET from Interrupt 24H leave the system in an unpredictable state until a function call other than 01H-0CH is made. The Ignore option may leave incorrect or invalid data in internal system buffers. ■ Avoid trapping Interrupt 23H (CONTROL+C Handler Address) and Interrupt 24H (Critical-Error-Handler Address). Don't rely on trapping errors via Interrupt 24H as part of a copy protection scheme. These methods might not be included in future releases of MS-DOS. ■ A user program must never issue Interrupt 23H (CONTROL+C Handler Address). Only MS-DOS may issue Interrupt 23H. ■ Save any registers that your program uses before issuing Interrupt 25H (Absolute Disk Read) or Interrupt 26H (Absolute Disk Write). These interrupts destroy all registers except for the segment registers. Avoid writing or reading an interrupt vector directly to or from memory. ■ Use Functions 25H and 35H (Set Interrupt Vector and Get Interrupt Vector) to set and get values in the interrupt table. 8.3 System Calls ■ Use new system calls. Avoid using system calls that have been superseded by new calls unless the program must maintain backward compatibility with MS-DOS versions before 2.0. See Section 1.9, "Old System Calls," for a list of these new calls. ■ Avoid using functions 01H-0CH and 26H (Create New PSP). Use the new "tools" approach for reading and writing on standard input and output. Use Function 4B00H or 4B03H (Load and Execute Program or Overlay) instead of 26H to execute a child process. ■ Use file-sharing calls if more than one process is in effect. For more information, see "File Sharing" in Section 1.5.2, "File-Related Function Requests." ■ Use networking calls where appropriate. Some forms of IOCtl can only be used with Microsoft Networks. For more information and a list of these calls, see Section 1.6, "Microsoft Networks." ■ When selecting a disk with Function 0EH (Select Disk), treat the value returned in AL with care. The value in AL specifies the maximum number of logical drives; it does not specify which drives are valid. 8.4 Device Management ■ Use installable device drivers. MS-DOS provides a modular device driver structure for the BIOS, allowing you to configure and install device drivers at boot time. Block device drivers transmit a block of data at a time, while character device drivers transmit a byte of data at a time. Examples of both types of device drivers are given in Chapter 2, "MS-DOS Device Drivers." ■ Use buffered I/O. The device drivers can handle streams of data up to 64 kilobytes. To improve performance when sending a large amount of output to the screen, you can send it with one system call. ■ Programs that use direct console I/O via Function 06H and 07H (Direct Console I/O and Direct Console Input) and that want to read CONTROL+C as data should ensure that CONTROL+C checking is off. The program should ensure that CONTROL+C checking is off by using Function 33H (CONTROL+C Check). ■ Be compatible with international support. To provide support for international character sets, MS-DOS recognizes all possible byte values as significant characters in filenames and data streams. MS-DOS versions earlier than 2.0 ignored the high bit in the MS-DOS filename. 8.5 Memory Management ■ Use memory management. MS-DOS keeps track of allocated memory by writing a memory control block at the beginning of each area of memory. Programs should use Functions 48H (Allocate Memory), 49H (Free Allocated Memory), and 4AH (Set Block) to release unneeded memory. This allows for future compatibility. For more information, see Section 1.3, "Memory Management." ■ Use only allocated memory. Don't directly access memory that was not provided as a result of a system call. Do not use fixed addressing, use only relative references. A program that uses memory that has not been allocated to it may destroy other memory control blocks or cause other applications to fail. 8.6 Process Management ■ Use Function 4B00H or 4B03H (Load and Execute Program or Overlay, also known as EXEC) to load and execute programs. EXEC is the preferred call to use when loading programs and program overlays. Using the EXEC call instead of hard-coding information about how to load a .exe file (or always assuming that your file is a .com file) isolates your program from changes in .exe file formats and future releases of MS-DOS. ■ Use Function 31H (Keep Process), instead of Interrupt 27H (Terminate But Stay Resident). Function 31H allows programs that are greater than 64 kilobytes to terminate and stay resident. ■ Programs should terminate using Function 4CH (End Process). Programs that terminate by one of the following must ensure that the CS register contains the segment address of the PSP: ■ A long jump to offset 0 in the PSP ■ Issuing an Interrupt 20H with CS:0 pointing at the PSP ■ Issuing an Interrupt 21H with AH=0, CS:0 pointing at the PSP ■ A long call to location 50H in the PSP with AH=0 8.7 File and Directory Management ■ Use the MS-DOS file management system. Using the MS-DOS file system ensures program compatibility with future MS-DOS versions through compatible disk formats and consistent internal storage. ■ Use file handles instead of FCBs. A handle is a 16-bit number that MS-DOS returns when a file is opened or created using Functions 3CH, 3DH, 5AH, or 5BH (Create Handle, Open Handle, Create Temporary File, or Create New File). The MS-DOS file-related function requests that use handles are listed in Table 1.5 in Chapter 1, "System Calls." Although the default maximum number of open files is 20, this limit can be raised to 64K by Function 67H (Set Handle Count). For more information on this system call, see Chapter 1, "System Calls." You should use these calls instead of the old file-related functions that use FCBs (file control blocks). This is because a file operation can simply pass its handle rather than maintaining FCB information. If you must use FCBs, be sure the program closes them and does not move them around in memory. ■ Close files that have changed in length before issuing an Interrupt 20H (Program Terminate), Function 00H (Terminate Program), Function 4CH (End Process), or Function 0DH (Reset Disk). If you do not close a changed file, its length will not be recorded correctly in the directory. ■ Close files when they are no longer needed. Closing unneeded files increases efficiency in a networking environment. ■ If a program does use FCBs, that program should not close an FCB file and then continue writing to it. This practice will not work in a network environment and is not recommended under any circumstances. ■ Change disks only if all files on the disk are closed. If you don't close all the files, any information in internal system buffers may be written incorrectly to a changed disk. 8.7.1 Locking Files ■ Programs should not rely on being denied access to a locked region. To determine the status of a region, first attempt to lock it, then examine its error code. ■ Programs should not close a file with a locked region or terminate with an open file that contains a locked region. The result of this procedure is undefined. Programs that might be terminated by an Interrupt 23H or Interrupt 24H (CONTROL+C Handler Address or Critical-Error-Handler Address) should trap these interrupts and unlock any locked regions before exiting. 8.8 Miscellaneous ■ Avoid timing dependencies. Various machines use CPUs of different speeds. Also, programs that rely upon the speed of the clock for timing are not dependable in a networking environment. ■ Use the documented interface to the operating system. If either the hardware or media change, the operating system can use the features without modification. Don't use the ROM support provided by the OEM (Original Equipment Manufacturer). Don't directly address the video memory. Don't use undocumented function calls, interrupts, or features. These items may change or may not exist in future MS-DOS versions. If you do use these features, you will make your program highly non-portable. ■ Use the .exe format rather than the .com format. .Exe files are relocatable; .com files are direct memory images that load at a specific place and have no room for additional control information. .Exe files have headers that can be expanded for compatibility with future MS-DOS versions. ■ Use the environment to pass information to applications. The environment allows a parent process to pass information to a child process. The command.com file is usually the parent process to every application, so it can easily pass default drive and path information to the application. ──────────────────────────────────────────────────────────────────────────── Index Numbers 80186 microprocessor 80286 microprocessor 8086 microprocessor 8086 object language 8086 object module format. See Object Module Formats (OMF) A Absolute Disk Read (Interrupt 25H) Absolute Disk Write (Interrupt 26H) Absolute segment, LSEG ACBP byte, SEG ATTR Address mode Alignment attribute Alignment subfield, SEG ATTR Allocate Memory (Function 48H) Application Frame Number, protected-mode Archive bit Array, character ASCII character set ASCIZ string Assign list Attribute primary secondary Target Attribute byte Attribute field Attribute, LSEG Alignment Combination SEG ATTR field, SEGDEF AUTOEXEC file Auxiliary Input (Function 03H) Auxiliary Output (Function 04H) B base, definition Big subfield, SEG ATTR BIN format file Binary line number BIOS Parameter ^Block (BPB) BIOS Parameter Block (BPB) Bit 8 Bit 9 Bitfield Block Count subfield, Iterated Data Block Block devices device drivers disk drives example installation Boot sector BPB pointer Buffered Keyboard Input (Function 0AH) BUILD BPB Build BPB Busy bit Byte, representation C C language CALL instruction Cancel Assign-List Entry (Function 5FH, Code 04H) Canonic Frame Canonic Frame, definition Carry flag Case-Mapping Call Change Current Directory (Function 3BH) Change Directory Entry (Function 56H) Character array Character device driver, example Character devices Character set definition Check Keyboard Status (Function 0BH) CHKSUM field, SAMREC Class Name, definition CLOCK device Close File (Function 10H) Close Handle (Function 3EH) Cluster Code page definition Code segment, CS Combination attribute Combination subfield, SEG ATTR COMDEF record field CHKSUM Communal Length, repeated Communal Name, repeated Data Segment Type, repeated Record Length RECTYP Type Index, repeated length fields, format order with respect to COMENT purpose schematic COMENT record field CHKSUM Comment Comment Type Record Length RECTYP order with respect to COMDEF order with respect to LOCSYM purpose schematic subfield of Comment Type Comment Class Command code field Command processor Command.com Commands, utility, NLS Comment class subfield, Comment Type Comment field, COMENT Comment record Comment Record (COMENT) Comment Type field, COMENT bit settings definition format Commit File (Function 68H) Common blocks, FORTRAN Communal Length field, COMDEF Communal Name field, COMDEF Communal Name, ordering with External Name Communal names definition record. See COMDEF record Communal Names Definition Record (COMDEF) Communal variable FAR HUGE NEAR similarity to FORTRAN common block uninitialized public variable Compatibility, ensuring Complete Name, definition Computer language C FORTRAN COMSPEC Con device config.sys config.sys file Content subfield, Iterated Data Block Control blocks Control information CONTROL+C Address (Interrupt 23H) CONTROL+C Check (Function 33H) CONTROL+C Handler Address (Interrupt 23H) Country code definition Country code, current Country-dependent information case conversion tables collating sequence, character sorting currency date DBCS environmental vector keyboard support time valid single-byte characters Country-dependent information, NLS Country.sys file Create Directory (Function 39H) Create File (Function 16H) Create Handle (Function 3CH) Create New File (Function 5BH) Create New PSP (Function 26H) Create Temporary File (Function 5AH) Critical Error Handler Address (Interrupt 24H) CS register D DAT field, LEDATA Data Record Data segment DS ES FAR NEAR Data Segment Type field, COMDEF Delete Directory Entry (Function 41H) Delete File (Function 13H) Descriptor, Group Component, GRPDEF Device control Device drivers block creating example installable installing non-resident preserving registers resident Device Handles Device header Device interrupt routine Device management, programming hints Device strategy routine Device-related function requests Direct Console Input (Function 07H) Direct Console I/O (Function 06H) Directory Entry Directory-Related Function Requests Directory-related function requests Disk allocation Disk Directory Disk formats IBM standard MS-DOS Disk Transfer Address (DTA) Dispatch table Display Character (Function 02H) Display String (Function 09H) Done bit DS register Duplicate File Handle (Function 45H) E Eight Leaf Descriptor field, TYPDEF format subfield EN Leaf Descriptor Element Type Index subfield, Leaf Descriptor EN subfield, Eight Leaf Descriptor End address End Process (Function 4CH) Enumerated Data Offset field, LEDATA Error bit Error codes Error Handling Error handling ES register EXE device drivers .exe files exe files EXE format file EXE loader EXTDEF record field CHKSUM External Name, repeated Record Length RECTYP Type Index, repeated purpose schematic Extended error codes Extended FCB Extensions class, Microsoft External Index External indices External Name mapping referenced in FIXUPP record External Name field, EXTDEF External names definition record. See EXTDEF record External Names Definition Record (EXTDEF) F FAR data segment FAR subfield, Leaf Descriptor FAR variable format, Leaf Descriptor FAT FAT ID byte FAT ID byte FBVAL, definition FCB File Allocation Table File and directory management, programming hints File attributes File Control Block definition extended fields format opened unopened File locking, programming hints Filename separators Filename terminators File-related function requests File-sharing function requests Find First File (Function 4EH) Find Next File (Function 4FH) FIX DAT subfield, Fixup internal structure schematic Fixup definition Frame Location segment-relative self-relative Target Fixup field, FIXUPP data type Frame Location Mode Target definition schematic subfield LOCAT Fixup mode segment-relative self-relative FIXUP record FIXUPP record External Name referenced in field CHKSUM Fixup, repeated Frame Datum, conditional Record Length RECTYP Target Datum, conditional Thread, repeated purpose schematic subfield of FIX DAT, Fixup F Frame P T TARGT subfield of Fixup Frame Datum, conditional Target Datum, conditional Target Displacement, conditional subfield of LOCAT, Fixup Data Record Offset LOC M (mode) subfield of Thread Index, conditional TRD DAT subfield of TRD DAT, Thread D Method THRED FIXUPP Record (FIXUPP) Flush Flush Buffer, Read Keyboard (Function 0CH) Force Duplicate File Handle (Function 46H) Format FORTRAN, common blocks FORTRAN language FOVAL, definition Frame definition Frame Number nomenclature specifying specifying, FIXUPP Frame Datum field, FIXUPP Frame Datum subfield, Fixup External Index Group Index Segment Index Frame Datum subfield, START ADDRS Frame Number Frame Number, conditional Frame Number, definition Frame Number subfield, Public Base Frame Number subfield, SEG ATTR Frames Thread Number, FIXUPP Free Allocated Memory (Function 49H) Function Requests alphabetic order calling definition device-related Directory-related directory-related file-related file-sharing Function 00H Function 01H Function 02H Function 03H Function 04H Function 05H Function 06H Function 07H Function 08H Function 09H Function 0AH Function 0BH Function 0CH Function 0DH Function 0EH Function 0FH Function 10H Function 11H Function 12H Function 13H Function 14H Function 15H Function 16H Function 17H Function 19H Function 1AH Function 1BH Function 1CH Function 21H Function 22H Function 23H Function 24H Function 25H Function 26H Function 27H Function 28H Function 29H Function 2AH Function 2BH Function 2CH Function 2DH Function 2EH Function 2FH Function 30H Function 31H Function 33H Function 35H Function 36H Function 38H Function 39H Function 3AH Function 3BH Function 3CH Function 3DH Function 3EH Function 3FH Function 40H Function 41H Function 42H Function 43H Function 44H, Code 08H Function 44H, Code 09H Function 44H, Code 0AH Function 44H, Code 0BH Function 44H, Code 0CH Function 44H, Code 0DH Function 44H, Codes 00H and 01H Function 44H, Codes 02H and 03H Function 44H, Codes 04H and 05H Function 44H, Codes 06H and 07H Function 44H, Codes 0EH and 0FH Function 45H Function 47H Function 48H Function 49H Function 4AH Function 4BH, Code 00H Function 4BH, Code 03H Function 4CH Function 4DH Function 4EH Function 4FH Function 54H Function 56H Function 57H Function 58H Function 59H Function 5AH Function 5BH Function 5CH, Code 00H Function 5CH, Code 01H Function 5EH, Code 00H Function 5EH, Code 02H Function 5FH, Code 02H Function 5FH, Code 03H Function 5FH, Code 04H Function 62H Function 65H Function 66H Function 67H Function 68H Handling errors memory management National Language Support Network-related network-related numeric order process management standard character I/O system-management Function requests definition Function 25H Function 35H Function 46H G Generic IOCtl for devices (Function 44H, Code 0DH) Generic IOCtl for handles (Function 44H, Code 0CH) Generic IOCtl Function Get Assign List Entry (Function 5FH, Code 02H) Get Country Data (Function 38H) Get Current Directory (Function 47H) Get Current Disk (Function 19H) Get Date (Function 2AH) Get Default Drive Data (Function 1BH) Get Disk Free Space (Function 36H) Get Disk Transfer Address (Function 2FH) Get Drive Data (Function 1CH) Get Extended Country Information (Function 65H) Get Extended Error (Function 59H) Get File Size (Function 23H) Get Interrupt Vector (Function 35H) Get Machine Name (Function 5EH, Code 00H) Get MS-DOS Version Number (Function 30H) Get PSP (Function 62H) Get Return Code Child Process (Function 4DH) Get Time (Function 2CH) Get Verify State (Function 54H) Get/Set Allocation Strategy (Function 58H) Get/Set Date/Time of File (Function 57H) Get/Set File Attributes (Function 43H) Get/Set Global Code Page (Function 66H) Get/Set IOCtl Drive Map (Function 44H, Codes 0EH and 0FH) Get/Set Logical Drive Map Function Group Component Descriptor field, GRPDEF Group, definition Group definition record. See GRPDEF record Group Definition Record (GRPDEF) Group Index Group Index subfield, Line Number Base Group Index subfield, Public Base Group Name Index field, GRPDEF GRPDEF record definition field CHKSUM Group Component Descriptor, repeated Group Name Index Record Length RECTYP schematic H Handles definition device Handling errors Header hibyte, definition Hidden files High-Level Language HUGE communal variable I IBM disk format Index definition Index fields Index Number Index subfield, Thread External Index Group Index Segment Index Indices Indices, external Init INIT code Installable device drivers Instruction CALL JUMP SHORT-JUMP Instruction Pointer (IP) Internal stack Interrupt entry point Interrupt handlers Interrupt routines Interrupt-handling routine Interrupts 21H Address of handlers alphabetic order definition Interrupt 20H Interrupt 21H Interrupt 22H Interrupt 23H Interrupt 24H Interrupt 25H Interrupt 26H Interrupt 27H issuing numeric order programming hints Vector table I/O Control for Devices (Function 44H) IOCtl IOCtl bit IOCtl Block (Function 44H, Codes 4 and 5) IOCtl Character (Function 44H, Codes 2 and 3) IOCtl Data (Function 44H, Codes 0 and 1) IOCtl Is Changeable (Function 44H, Code 08H) IOCtl Is Redirected Block (Function 44H, Code 09H) IOCtl Is Redirected Handle (Function 44H, Code 0AH) IOCtl Retry (Function 44H, Code 0BH) IOCtl Status (Function 44H, Codes 6 and 7) io.sys file IP. See Instruction Pointer (IP) Iterated Data Block field, LIDATA Iterated Data Offset field, LIDATA J JUMP instruction K Keep Process (Function 31H) Keyboard layouts, national, NLS L Language C FORTRAN Leaf Descriptor subfield, Eight Leaf Descriptor format FAR variable NEAR variable subfield NEAR VARTYP LEDATA field CHKSUM Record Length RECTYP purpose LEDATA record field DAT, repeated Enumerated Data Offset Segment Index schematic Length fields, COMDEF, format Length in Bits subfield, Leaf Descriptor Length of Record Field LHEADR record field CHKSUM L-module Name Record Length RECTYP schematic LIDATA record field CHKSUM Iterated Data Block, repeated Iterated Data Offset Record Length RECTYP Segment Index purpose schematic subfield of Iterated Data Block Block Count Content Repeat Count Line Number Base field, LINNUM Line number, binary Line Number field, LINNUM Line Number Offset field, LINNUM Line Numbers Record (LINNUM) LINK Linker, Microsoft Linker, Microsoft Link-time semantics LINNUM record field CHKSUM Line Number Base Line Number Offset, repeated Line Number, repeated Record Length RECTYP purpose schematic subfield of Line Number Base Group Index Segment Index List of Names Record (LNAMES) L-module Header Record (LHEADR) L-module Name LNAMES record field CHKSUM Name, repeated Record Length RECTYP schematic Load and Execute Program (Function 4BH, Code 00H) Load module Load Overlay (Function 4BH, Code 03H) Loadsize lobyte, definition Local Base field, LOCSYM Local buffering Local Name field, LOCSYM Local Offset field, LOCSYM Local symbol Local Symbols Record (LOCSYM) LOCAT subfield, Fixup internal structure schematic Location types base hibyte lobyte offset pointer Lock (Function 5CH, Code 00H) LOCSYM record field CHKSUM Local Base Local Name, repeated Local Offset, repeated Record Length RECTYP Type Index, repeated order with respect to COMENT purpose schematic Logical Enumerated Data Record (LEDATA) Logical Iterated Data Record (LIDATA) Logical sector Logical sector numbers Logical Segment. See LSEG LSEG absolute Combination attribute Alignment attribute absolute segment relocatable segment canonic Frame Class name Combination attribute absolute segment relocatable segment combining Complete name definition Overlay Name relocatable byte-aligned Combination attribute page-aligned paragraph-aligned word-aligned Segment Name M Make Assign-List Entry (Function 5FH, Code 03H) Mapping logical to physical starting address MAS. See Memory Address Space (MAS) MATTR subfield, MOD TYP Maxalloc Media Check Media descriptor byte Media, determining Memory address Memory Address Space (MAS) Memory control block Memory image, 8086 Memory image, LSEGs in Memory image, relocatable Memory management function requests Memory management, programming hints Memory model huge large medium small Microprocessor 80186 80286 8086 Microsoft Extensions class Microsoft linker Microsoft linker Microsoft Networks Microsoft Networks Manager's Guide Microsoft Networks User's Guide Minalloc MOD TYP field, MODEND MATTR subfield module attributes Mode fixup segment-relative self-relative Mode, address MODEND record field CHKSUM MOD TYP Record Length RECTYP START ADDRS, conditional purpose schematic subfield of START ADDRS Frame Datum, conditional Target Datum, conditional Target Displacement, conditional Module record ordering in Module, definition Module End Record (MODEND) Module header record, definition Move File Pointer (Function 42H) MS-DOS, 8086 object language MS-DOS initialization MS-DOS memory map MS-DOS User's Reference msdos.sys file Multitasking N Name field Name field, SAMREC Name Indices National keyboard layouts, NLS National Language Support Function Requests National Language Support (NLS) restrictions unsupported features National Language Support system calls NEAR data segment NEAR subfield, Leaf Descriptor NEAR variable format, Leaf Descriptor Network-related Function Requests Network-related function requests Non IBM format bit Non-destructive Read No Wait NUL device Number field, SAMREC Number of Elements subfield, Leaf Descriptor O Object language, 8086 Object module restrictions Object Module Formats Object Module Formats (OMF) offset, definition Offset subfield, SEG ATTR Old system calls OMF. See Object Module Formats (OMF) Open File (Function 0FH) Open Handle (Function 3DH) Opened FCB Operating system MS-DOS PC-DOS XENIX Overlay Name, definition P Parameter block Parse File Name (Function 29H) Path command PC-DOS, 8086 object language Physical Segment. See PSEG Pointer to Next Device field Predefined device handles Print Character (Function 05H) Printer Setup (Function 5EH, Code 02H Process management function requests Process management, programming hints Processor. See Microprocessor Program End Process (Interrupt 20H) Program segment Program Segment Prefix Programming hints device management file and directory management file locking interrupts memory management miscellaneous process management recommendations system calls Programming interfaces, NLS Prompt command Protected-mode application Frame Number PSEG definition PUBDEF record field Public Base, repeated Public Name, repeated Public Offset, repeated Record Length RECTYP Type Index, repeated purpose schematic subfield of Public Base Frame Number, conditional subfield, Public Base Frame Number, conditional Group Index Segment Index Public Base field, PUBDEF Public Name field, PUBDEF Public names definition record. See PUBDEF record Public Names Definition Record (PUBDEF) Public Offset field, PUBDEF Public symbol Public variable R Random Block Read (Function 27H) Random Block Write (Function 28H) Random Read (Function 21H) Random Write (Function 22H) Read Handle (Function 3FH) Read Keyboard and Echo (Function 01H) Read Keyboard (Function 08H) Read Only Memory Read or Write Record COMDEF COMENT comment Data EXTDEF FIXUP FIXUPP GRPDEF LEDATA LHEADR LIDATA LINNUM LNAMES LOCSYM MODEND PUBDEF RECTYP(record type) SAMREC (sample record) SEGDEF symbol definition COMDEF EXTDEF PUBDEF THEADR TYPDEF Record format abbreviation bitfields conditional field repeated field sample (SAMREC) SAMREC (sample record) CHKSUM field Name field Number field Record Length field SAMREC(sample record) RECTYP field title Record formats Record Length field, SAMREC Record order definition semantic rules syntax Record Size RECTYP(record type)field Reference segment-relative Reference self-relative References WIRTH CACM, Nov. 1977) Register CS DS ES SS Registers, treatment of Relocatable memory image Relocatable segment, LSEG Relocation information Relocation item offset value to a word in the load Relocation table Remove Directory (Function 3AH) Rename File (Function 17H) Repeat Count subfield, Iterated Data Block request header Request packet Reset Disk (Function 0DH) Resident device drivers ROM Root directory S SAMREC (sample record) schematic Search for First Entry (Function 11H) Search for Next Entry (Function 12H) Sector count SEG ATTR field, SEGDEF SEGDEF record definition field CHKSUM Class Name Index Overlay Name Index Record Length RECTYP SEG ATTR Segment Name Index schematic subfield of SEG ATTR Alignment Big Combination Offset, conditional SEGDEF recrod field Segment Length Segment absolute, LSEG attribute Alignment Combination logical (LSEG) physical (PSEG) relocatable, LSEG Segment addressing Segment definition record. See SEGDEF record Segment Definition Record (SEGDEF) Segment Index Segment Index field, LEDATA Segment Index field, LIDATA Segment Index subfield, Group Component Descriptor Segment Index subfield, Line Number Base Segment Index subfield, Public Base Segment Length field, SEGDEF Segment Name, definition Segment Name Index field, SEGDEF Segment-relative fixup Segment-relative reference Select Disk (Function 0EH) Self-relative fixup Self-relative reference Semantic rules, record ordering Semantics, link-time Sequential Read (Function 14H) Sequential Write (Function 15H) Set Block (Function 4AH) Set command Set Country Data (Function 38H) Set Date (Function 2BH) Set Disk Transfer Address (Function 1AH) Set Handle Count(Function 67H) Set Interrupt Vector (Function 25H) Set Relative Record (Function 24H) Set Time (Function 2DH) Set/Reset Verify Flag (Function 2EH) SHORT-JUMP instruction SS register Stack segment, SS Standard character I/O function requests START ADDRS field, MODEND Format Start sector Start segment value the relocation item offset static request header Status Status field Strategy entry point Strategy routines Subfield Comment Type Comment Class Eight Leaf Descriptor EN Leaf Descriptor Fixup Frame Datum Target Datum Target Displacement Frame Number, conditional Group Component Descriptor Segment Index Iterated Data Block Block Count Content Repeat Count Leaf Descriptor Element Type Index FAR Length in Bits NEAR Number of Elements VAR SUBTYP VARTYP Line Number Base, LINNUM Group Index Segment Index MOD TYP MATTR Public Base Group INdex SEG ATTR Alignment Big Combination Segment Index START ADDRS Frame Datum Target Datum Target Displacement Thread Index TRD DAT Subfield OFFH Superseded system calls Symbol local public Symbol definition Symbol definition record COMDEF EXTDEF PUBDEF Syntax, record ordering Sysinit System call National Language Support: System Calls superseded calls System calls definition programming hints replacements for old types of System files System prompt System-management function requests T Target definition nomenclature specification attribute specifying specifying, FIXUPP Thread Number, FIXUPP Target Datum field, FIXUPP Target Datum subfield, Fixup External Index Group Index Segment Index Target Datum subfield, START ADDRS Target Displacement subfield, Fixup Target Displacment subfield, START ADDRS Terminate But Stay Resident (Interrupt 27H) Terminate Process Exit Address (Interrupt 22H) Terminate Program (Function 00H) THEADR record field CHKSUM Record Length RECTYP T-module Name schematic Thread Data subfield. See TRD DAT subfield, Thread Thread field, FIXUPP data type Frame Target definition Thread Number, THRED T-module, definition T-module Header Record (THEADR) T-Module Name Transfer address TRD DAT subfield, Thread D subfield internal structure Method subfield schematic THRED subfield TYPDEF record communal variable field CHKSUM Eight Leaf Descriptor Record Length RECTYP subfield of Eight Leaf Descriptor EN subfield of Leaf Descriptor Element Type Index FAR Length in Bits NEAR Number of Elements VAR SUBTYP, optional VARTYP Type Index field, COMDEF Type Index field, EXTDEF Type Index field, LOCSYM Type Index field, PUBDEF Type-ahead buffer U Unit code field Unlock (Function 5CH, Code 01H) Unopened FCB User Stack User stack Utility commands, NLS V VAR SUBTYP subfield, Leaf Descriptor Variable communal FAR HUGE" NEAR public VARTYP subfield, Leaf Descriptor ARRAY SCALAR STRUCT Vector table Volume ID Volume label W Wildcard characters Write Handle (Function 40H) X XENIX, 8086 object language