Presentation is loading. Please wait.

Presentation is loading. Please wait.

Runtime Program Structure Command.com program supplied with MS- DOS and Windows (CMD.EXE for 2000 and XP)is called the command processor. It interprets.

Similar presentations


Presentation on theme: "Runtime Program Structure Command.com program supplied with MS- DOS and Windows (CMD.EXE for 2000 and XP)is called the command processor. It interprets."— Presentation transcript:

1 Runtime Program Structure Command.com program supplied with MS- DOS and Windows (CMD.EXE for 2000 and XP)is called the command processor. It interprets each command typed at a prompt.

2 Procedure for Command Typed at Prompt 1.Is command internal (DIR, REN, or ERASE)? – if so, immediately execute by a memory-resident MS-DOS routine. 2.Is there a matching file with extension of COM? – if file is in current directory, it is executed. 3.Is there a matching file with extension of EXE? If file is in current directory, it is executed. 4.Is there a matching file with extension of BAT? -If file is in current directory, it is executed. BAT are batch files – a text file containing MS_DOS commands to be executed as if commands were typed at the console. 5.If no COM, EXE, or BAT file in the current directory, first directory in current path is searched. If not found, proceeds to next directory in path. Continues until file is found or search is exhausted.

3 Transient Programs (COM and EXE programs) Application programs with extensions of COM and EXE are called transient programs. Generally, loaded into memory long enough to be executed; then the memory they occupy is released. Can leave a portion of their code in menry when they exit; these are called memory- resident programs.

4 Program Segment Prefix (PSP) A special 256-byte block at the beginning of a a program as it is loaded into memory OffsetComments 00-15MS-DOS pointers and vector addresses 16-2BReserved by MS-DOS 2C-2DSegment address of the current environment string 2E-5BReserved by MS-DOS 5C-7F File Control Blocks 1 and 2, used mainly by pre-MS-DOS 2.0 programs 80-FF Default disk transfer area and a copy of the current MS_DOS command tail

5 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). 00000100FFFE CODE CS,DS,ES,SS SP PSPDATA------------------------------------------STACK

6 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 program’s load address. CS and IP set to entry point of code, SS set to beginning of stack segment, SP set to stack size.


Download ppt "Runtime Program Structure Command.com program supplied with MS- DOS and Windows (CMD.EXE for 2000 and XP)is called the command processor. It interprets."

Similar presentations


Ads by Google