- Asked 2/14
- 2070 Bhadra · 4 marks
- 2069 Bhadra · 4 marks
EXE and COM programs
Differentiate between EXE and COM programs.
Both are executable programs of DOS. A .COM file is an exact memory image of the program that fits in one 64 KB segment; an .EXE file has a header with relocation information and can use many segments.
| Point | .COM program | .EXE program |
|---|---|---|
| Size | Max 64 KB (one segment) | Larger than 64 KB possible |
| Segments | Code, data and stack share one segment | Separate code, data and stack segments |
| File format | Pure binary image, no header | Has a header (starts with "MZ") with relocation table |
| Origin | Must start with ORG 100H (after the 256-byte PSP) | No ORG needed |
| Stack | Set up automatically by DOS (SP = FFFEH) | Defined by programmer (.STACK) |
| Data segment init | Not required, DS = CS | Programmer loads DS (MOV AX,@DATA, MOV DS,AX) |
| Loading | Fast, loaded as is | Slower, relocation applied by loader |
| Disk space | Smaller | Larger because of the header |
| Creation | LINK then EXE2BIN, or TLINK /t | LINK / TLINK |
| Memory use | Occupies whole segment | Uses only what it needs |
COM programs suit small utilities; EXE programs suit large applications with several segments.
✓ Answer checked by Claude Opus 5.5 (high effort)
Related questions
- COM vs EXE; assembling, linking, executing · Microprocessor, chapter 3