Program Segment Prefix (PSP)
Offset Size Contens
────────────────────────────────────────────────────────────────────
00-01 Code CP/M exit (always contain INT 20)
02-03 Word Memory size in paragraphs
04 Reserved
05-09 Code Far call to DOS (internal)
0A-0D DWord Terminate address of previos program (old INT 22)
0E-11 DWord Break address of previos program (old INT 23)
12-15 DWord Critical error address of previos program (old INT 24)
16-17 Word Parent psp segment (PSP of caller - usualy
command.com - internal)
18-2B Bytes Handle entries (internal)
18: Handle 0
19: Handle 1
.
.
Contains the number of an internal DOS handle -
00=AUX, 01=CON, 02=PRN, 04=NUL, FF=not open
2C-2D Word Enviroment segment
2E-31 DWord SS:SP on entry to last INT 21 call (Internal)
32-33 Word Max open files (Internal - see below)
34-37 DWord Handle-entries address (Internal - see below)
38-4F Reserved
50-52 Code CP/M function call (always contain INT 21 + RETF)
53-5B Reserved
5C-6B Unopened Standart FCB 1
6C-7F Unopened Standart FCB 2 (overwritten if FCB 1
is opened)
80 Byte Number of characters on command-line (excl. filename
and trailing blanks but including leading blanks)
81-FF Bytes Command-line (terminated by a 0Dh)
Note (max. handles): On pre DOS 3.30 systems, PSP:0032 and
PSP:0034 can be used to set the maximum number of files that
can be opened, by the program owning the PSP (create a new buffer,
and copy the first 20 entries from PSP:0018 and fill the rest
with FFh).
The method descriped above should be avoidet (if possible),
since DOS 3.30 provides a call to set the maximum number of handles
(INT 21h, 67h).