Differences
This shows you the differences between two versions of the page.
en:docs:dos:api:int21:4b [2021/05/02 04:50] – created prokushev | en:docs:dos:api:int21:4b [2024/05/03 02:15] (current) – prokushev | ||
---|---|---|---|
Line 40: | Line 40: | ||
===== Notes ===== | ===== Notes ===== | ||
- | DOS 2.x destroys all registers, including SS:SP | + | DOS 2.x destroys all registers, including SS:SP |
- | under ROM-based DOS, if no disk path characters (colons or slashes) | + | |
- | | + | under ROM-based DOS, if no disk path characters (colons or slashes) are included in the program name, the name is searched for in the ROM module headers (see #01595) before searching on disk |
- | | + | |
- | for functions 00h and 01h, the calling process must ensure that there | + | for functions 00h and 01h, the calling process must ensure that there is enough unallocated memory available; if necessary, by releasing memory with AH=49h or AH=4Ah |
- | | + | |
- | | + | for function 01h, the AX value to be passed to the child program is put on top of the child' |
- | for function 01h, the AX value to be passed to the child program is put | + | |
- | | + | for function 03h, DOS assumes that the overlay is being loaded into memory allocated by the caller |
- | for function 03h, DOS assumes that the overlay is being loaded into | + | |
- | | + | function 01h was undocumented prior to the release of DOS 5.0 |
- | function 01h was undocumented prior to the release of DOS 5.0 | + | |
- | some versions (such as DR DOS 6.0) check the parameters and parameter | + | some versions (such as DR DOS 6.0) check the parameters and parameter block and return an error if an invalid value (such as an offset of FFFFh) is found |
- | | + | |
- | | + | background programs under European MS-DOS 4.0 must use the new executable format |
- | background programs under European MS-DOS 4.0 must use the new | + | |
- | | + | this function ignores the filename extension, instead checking the first two bytes of the file to determine whether there is a valid .EXE header (see #01594); if not, the file is assumed to be in .COM format. |
- | this function ignores the filename extension, instead checking the | + | |
- | | + | .COM-format executables begin running with the following register |
- | | + | |
- | | + | |
- | | + | |
- | .COM-format executables begin running with the following register | + | |
- | | + | |
AL = 00h if first FCB has valid drive letter, FFh if not | AL = 00h if first FCB has valid drive letter, FFh if not | ||
AH = 00h if second FCB has valid drive letter, FFh if not | AH = 00h if second FCB has valid drive letter, FFh if not | ||
Line 69: | Line 65: | ||
SP = offset of last word available in first 64K segment | SP = offset of last word available in first 64K segment | ||
(note: AX is always 0000h under DESQview) | (note: AX is always 0000h under DESQview) | ||
- | old-format executables begin running with the following register | + | |
- | | + | old-format executables begin running with the following register values: |
AL = 00h if first FCB has valid drive letter, FFh if not | AL = 00h if first FCB has valid drive letter, FFh if not | ||
AH = 00h if second FCB has valid drive letter, FFh if not | AH = 00h if second FCB has valid drive letter, FFh if not | ||
Line 76: | Line 73: | ||
SS:SP as defined in .EXE header | SS:SP as defined in .EXE header | ||
(note: AX is always 0000h under DESQview) | (note: AX is always 0000h under DESQview) | ||
- | new executables begin running with the following register values | + | |
+ | new executables begin running with the following register values | ||
AX = environment segment | AX = environment segment | ||
BX = offset of command tail in environment segment | BX = offset of command tail in environment segment | ||
Line 83: | Line 82: | ||
DS = automatic data segment | DS = automatic data segment | ||
SS:SP = initial stack | SS:SP = initial stack | ||
- | | + | |
- | | + | the command tail corresponds to an old executable' |
- | | + | |
- | under the FlashTek X-32 DOS extender, only function 00h is supported | + | under the FlashTek X-32 DOS extender, only function 00h is supported and the pointers are passed in DS:EDX and ES:EBX |
- | | + | |
- | DR DOS 6 always loads .EXE-format programs with no fixups and | + | DR DOS 6 always loads .EXE-format programs with no fixups and .COM-format programs starting with 9Ch 55h (PUSHF/PUSH BP) above the 64K mark to avoid the EXEPACK bug, by extending the memory block containing the program' |
- | | + | |
- | | + | DR DOS 3.41 and 5.0 check for a valid filename before testing the subfunction number, so the otherwise invalid subfunction 02h will only return error code 01h if the given filename actually exists; otherwise, errors 02h, 03h, or 05h are returned |
- | | + | |
- | | + | BUGS: DOS 2.00 assumes that DS points at the current program' |
- | DR DOS 3.41 and 5.0 check for a valid filename before testing the | + | |
- | | + | Load Overlay (subfunction 03h) loads up to 512 bytes too many if the file contains additional data after the actual overlay |
- | | + | |
- | | + | Load but Do Not Execute (subfunction 01h) is reported to corrupt the top word of the caller' |
- | BUGS: DOS 2.00 assumes that DS points at the current program' | + | |
- | Load Overlay (subfunction 03h) loads up to 512 bytes too many if the | + | |
- | | + | |
- | Load but Do Not Execute (subfunction 01h) is reported to corrupt the | + | |
- | | + | |
- | | + | |
===== See also ===== | ===== See also ===== | ||
- | | + | AX=[[en: |
===== Note ===== | ===== Note ===== |