Content deleted Content added
Citation bot (talk | contribs) Removed parameters. | Use this bot. Report bugs. | Suggested by Whoop whoop pull up | Category:DOS technology | #UCB_Category 28/82 |
m Fixed broken links |
||
(3 intermediate revisions by 3 users not shown) | |||
Line 2:
{{Use dmy dates|date=May 2019|cs1-dates=y}}
{{Use list-defined references|date=December 2021}}
{{TOC right}}
The '''Program Segment Prefix''' (PSP) is a data structure used in [[DOS]] systems to store the state of a [[computer program|program]]. It resembles the [[Zero page (CP/M)|Zero Page]] in the [[CP/M]] operating system. The PSP has the following structure:
Line 11 ⟶ 12:
| 00h–01h
| 2 bytes (code)
| [[CP/M-80]]-like<!-- not CP/M-86! --> exit (always contains [[DOS_API#Interrupt_vectors_used_by_DOS|INT 20h]])<ref name="Taylor_1982_Translators"/><ref name="Paul_2002_COM"/>
|-
| 02h–03h
Line 27 ⟶ 28:
| 0Ah–0Dh
| [[dword]] (4 bytes)
| Terminate address of previous program (old [[DOS_API#Interrupt_vectors_used_by_DOS|INT 22h]])
|-
| 0Eh–11h
| dword
| Break address of previous program (old [[DOS_API#Interrupt_vectors_used_by_DOS|INT 23h]])
|-
| 12h–15h
| dword
| Critical error address of previous program (old [[DOS_API#Interrupt_vectors_used_by_DOS|INT 24h]])
|-
| 16h–17h
Line 71 ⟶ 72:
| 40h–41h
| word
| DOS version to return (DOS
|-
| 42h–4Fh
Line 137 ⟶ 138:
</syntaxhighlight>
In DOS 1.x, it was necessary for the CS (Code Segment) register to contain the same segment as the PSP at program termination, thus standard programming practice involved saving the DS register
<syntaxhighlight lang="nasm">
|