5.2 Programs and Program Resources

When MS-DOS runs a program, it allocates memory for the program code and data and copies the program from its program file into memory. The system then creates additional data defining the program's environment and passes control to the program's entry point—the instruction identified in the program as the first to be executed.

To run a program, the system uses the program's code, static data, stack, allocated memory, open files, and additional data created by the system for the program's use. In addition to this information, the system uses the following resources to run a program:

Program memory

Program segment prefix (PSP)

Environment block

Command tail

Standard devices

These resources are described in the following sections.