Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Peter Norton Programmer's Guide - Norton Guide http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]

  When DOS loads a program, it sets aside a 256-byte block of memory for the
  program: the program segment prefix (PSP). The PSP contains a hodgepodge
  of information that DOS uses to help run the program. A PSP is associated
  with every DOS program, no matter what language the program is written in.
  However, for programming purposes, the information stored in the PSP is
  more relevant to programs written in assembly language than to programs
  written in high-level languages. This is because with high-level
  languages, the language is normally in charge of the program's working
  environment, memory usage, and file control--all the information that the
  PSP is concerned with. Therefore, you can normally make good use of the
  PSP only if your program is assembly-language based.

  Before we describe the different elements of the PSP, we need to look at
  the relationship between the PSP and the program it supports.

  DOS always builds a program's PSP in memory just below the memory area
  allocated to the program itself. When the program receives control from
  DOS, segment registers DS and ES point to the beginning of the PSP.
  Because it sometimes needs to locate PSP information, DOS keeps a copy of
  the PSP segment value internally.

  The best way to explain how the PSP and the program work together is to
  jump right into the PSP's internal structure. We will reveal the purpose
  and potential use of each element as we explain it.

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson