Borland C++ reference

getpsp

raw OCR

Gets the program segment prefix.

Defined in header <dos.h>

Syntax

#include <dos.h>
unsigned getpsp(void);

Portability

DOSUNIXWindowsANSI CC++ only
■■

Remarks

getpsp gets the segment address of the program segment prefix (PSP) using DOS call 0x62.

Return value

getpsp returns the address of the Program Segment Prefix (PSP).

See also

Example

#include <stdio.h>
#include <dos.h>
int main(void)
{
   static char command[128] ;
   char far *cp;
   int len, i;
   printfC'The program segment prefix is: %x\n", getpsp ());

   /* _psp is preset to the segment of the Program Segment Prefix  (PSP).
     The remainder of the command line is located at offset 0x80
     from the start of PSP. Try passing this program arguments.  */
   cp = MK_FP(_psp, 0x80);
   len = *cp;
   for (i = 0; i < len; i++)
      command[i] = cp[i+l];
   printf("Command line: ls\n", command);
   return 0;

Differences from modern implementations

Nothing recorded yet.

Modern references

These are search links, not yet checked by hand.