Pages

Tuesday, June 21, 2011

What's the difference between .COM and .EXE formats?

- What's the difference between .COM and .EXE formats?
 
 To oversimplify: a .COM file is a direct image of how the program will
 look in main memory, and a .EXE file will undergo some further
 relocation when it is run (and so it begins with a relocation header). A
 .COM file is limited to 64K for all segments combined, but a .EXE file
 can have as many segments as your linker will handle and be as large as
 RAM can take.
 
 The actual file extension doesn't matter. DOS knows that a file being
 loaded is in .EXE format if its first two bytes are MZ or ZM; otherwise
 it is assumed to be in .COM format. For instance, DR-DOS 6.0's
 COMMAND.COM is in .EXE format as is COMMAND.COM in recent versions of
 MS-DOS.
 

2 comments:

Unknown said...

Thanks Gmage.

Anonymous said...

Thanks

Post a Comment