5.2.2 Program Segment Prefix

For each program, MS-DOS builds a 256-byte program segment prefix (PSP) that contains such information about the program's environment as the amount of memory the system allocates for the program, the location of the program's environment block, and the command-line arguments supplied to the program. MS-DOS places the PSP in the first 256 bytes of memory allocated for the program. The program code and data immediately follow the PSP.

The form of the PSP corresponds to that of the PSP structure:

PSP STRUC

pspInt20 dw ? ;Int 20h instruction

pspNextParagraph dw ? ;segment addr of next paragraph

db ? ;reserved

pspDispatcher db 5 dup(?) ;long call to MS-DOS

pspTerminateVector dd ? ;Termination Address (Int 22h)

pspControlCVector dd ? ;CTRL+C Handler (Int 23h) addr

pspCritErrorVector dd ? ;Crit-Err Handler (Int 24h) addr

dw 11 dup(?) ;reserved

pspEnvironment dw ? ;segment address of environment

dw 23 dup(?) ;reserved

pspFCB_1 db 16 dup(?) ;default FCB #1

pspFCB_2 db 16 dup(?) ;default FCB #2

dd ? ;reserved

pspCommandTail db 128 dup(?) ;command tail (also default DTA)

PSP ENDS

For a full description of the PSP structure, see Section 5.8, “Structures.”