Runtime Program Structure
Runtime Program Structure
Command.com program supplied with MSDOS and Windows (CMD.EXE for 2000 and XP)is called the command processor. It interprets each command typed at a prompt.
16-2B Reserved by MS-DOS 2C-2D Segment address of the current environment string 2E-5B Reserved by MS-DOS 5C-7F 80-FF File Control Blocks 1 and 2, used mainly by pre-MS-DOS 2.0 programs Default disk transfer area and a copy of the current MS_DOS command tail
COM Programs
Unmodified binary image of a machine-language program. Loaded into memory by MS_DOS at the lowest available segment address; a PSP is created at offset 0. Code, data and stack are all stored in the same segment (physical and logical)Uses TINY memory model Program can be as large as 64k (minus 256 for PSP and 2 bytes at end of stack).
0000 0100 FFFE
PSP
CODE
DATA------------------------------------------STACK
CS,DS,ES,SS
SP
EXE Programs
Stored on Disk with an EXE header followed by a load module containing program. Header is not loaded into memory; instead contains info used by MS_DOS to load and execute the program. PS is created at first available address, program is placed in memory above it. DS and ES ared set to programs load address. CS and IP set to entry point of code, SS set to beginning of stack segment, SP set to stack size.