Program Segment Prefix: Difference between revisions

Content deleted Content added
MS-DOS 4.0 has the HEX value 00 00 in this field. The first DOS Version that has an entry is MS-DOS 5.0 it shows 05 00, MS-DOS 6 is 06 00, MS-DOS 6.2 = 06 14, MS-DOS 6.22 = 06 16, FreeDOS 1.3 = 07 0A (for MS-DOS 7.1 the last version of Win9x/ME)
Cvpines (talk | contribs)
m Fixed broken links
 
(One intermediate revision by one other user not shown)
Line 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 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 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 to the stack at program start (since the DS register is loaded with the PSP segment) along with a zero word to the stack at program start and terminating the program with a RETF instruction, which would pop the saved segment value off the stack and jump to address 0 of the PSP, which contained an INT 20h instruction.
 
<syntaxhighlight lang="nasm">