Program Segment Prefix

This is an old revision of this page, as edited by AlistairMcMillan (talk | contribs) at 19:10, 1 May 2006 (Link DWord). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

The Program Segment Prefix (PSP) is a data structure used in DOS systems to store the state of a program. It has the following structure:

OffsetSizeContents
00-01CodeCP/M exit (always contain INT 20)
02-03WordMemory size in paragraphs
04 Reserved
05-09CodeFar call to CP/M compatibility code within DOS
0A-0DDWordTerminate address of previous program (old INT 22)
0E-11DWordBreak address of previous program (old INT 23)
12-15DWordCritical error address of previous program (old INT 24)
16-17WordParent psp segment (PSP of caller - usually command.com - internal)
18-2BBytesJob File Table(JFT) (internal)
2C-2DWordEnvironment segment
2E-31DWordSS:SP on entry to last INT 21 call (Internal)
32-33WordMax open files (Internal - see below)
34-37DWordHandle-entries address (Internal - see below)
38-4F Reserved
50-52CodeFar call to DOS (always contain INT 21 + RETF)
53-5B Reserved
5C-6B Unopened Standard FCB 1
6C-7F Unopened Standard FCB 2 (overwritten if FCB 1 is opened)
80ByteNumber of characters on command-line (excl. filename and trailing blanks but including leading blanks)
81-FFBytesCommand-line (terminated by a 0Dh)