INT 21 - DOS 2+ - LOAD OR EXECUTE (EXEC)                   

Input

DOS1 N DOS2 Y

DOS3

Y DOS5 Y

Output

AX

4Bh Subfunction Error Code AX

 

        BX

CX

        CX

DS:DX

 File Name     DX

ES:BX

Parameter Block Set if Error CF
Subfunction:    0 = Load and execute program
                1 = Load but do not execute (internal, DOS 3.x, DesqView)
                2 = Load but do not execute (internal, DOS 2.x only)
                3 = Load overlay; do not create PSP

Parameter Block:

    AL = 0

        00h     WORD    Segment of environment (0 = use current)
        02h     DWORD   Command line
        06h     DWORD   FCB 1
        0Ah     DWORD   FCB 2

    AL = 1

        Process ID set to new program's PSP; get with function 62h

        00h     WORD    Segment of environment (0 = use current)
        02h     DWORD   Command line
        06h     DWORD   FCB 1
        0Ah     DWORD   FCB 2
        0Eh     DWORD   Will hold SS:SP on return
        12h     DWORD   Will hold program entry point (CS:IP) on return

    AL = 2

        New program's initial stack and entry point returned in registers

        00h     WORD    Segment of environment (0 = use current)
        02h     DWORD   Command line
        06h     DWORD   FCB 1
        0Ah     DWORD   FCB 2

    AL = 3

        00h     WORD   Segment load address
        02h     WORD   Segment relocation factor

Note:   DOS 2.x destroys all registers, including SS:SP

See Also 3Dh 4Ah 4Dh 59h FCB PSP EXE File Header Error Codes


Copyright © 1985 to 2022 Beta Systems                            Last modified: Wednesday, January 05, 2022 .