Int 21H [1.0] Function 26H (38) Create new PSP

Copies the program segment prefix (PSP) of the currently executing program to a specified segment address in free memory, then updates the new PSP to make it usable by another program.

Call with:

AH = 26H

DX = segment of new program segment prefix

Returns:

Nothing

Notes:

After the executing program's PSP is copied into the new segment, the memory size information in the new PSP is updated appropriately and the current contents of the termination (Int 22H), Ctrl-C handler (Int 23H), and critical-error handler (Int 24H) vectors are saved starting at offset 0AH.

This function does not load another program or in itself cause one to be executed.

[2.0+] Int 21H Function 4BH (EXEC), which can be used to load and execute programs or overlays in either .COM or .EXE format, should be used in preference to this function.

Example:

Create a new program segment prefix 64 KB above the currently executing program. This example assumes that the running program was loaded as a .COM file so that the CS register points to its PSP throughout its execution. If the running program was loaded as a .EXE file, the address of the PSP must be obtained with Int 21H Function 62H (under MS-DOS 3.0 or later) or by saving the original contents of the DS or ES registers at entry.

.

.

.

mov ah,26h ; function number

mov dx,cs ; PSP segment of

; this program

add dx,1000h ; add 64 KB as

; paragraph address

int 21h ; transfer to MS-DOS

.

.

.