Solved

"com" vs "exe" files

Posted on 2000-02-14
7
684 Views
Last Modified: 2012-06-21
What is the difference between .com and .exe files
0
Comment
Question by:r_bal
7 Comments
 

Author Comment

by:r_bal
ID: 2518274
Adjusted points to 50
0
 
LVL 12

Accepted Solution

by:
roverm earned 50 total points
ID: 2518387
Com files are small, up to (a I recall correcly) 64kb, EXE can be very large.
U can set the LOAD address of a COM to a specific location, a EXE u cannot.
COM is faster !
0
 

Expert Comment

by:rkumar121699
ID: 2518422
Both Com and Exe are executable files.

Whereas  a com file (Command File) has size restriction  compared to an Exe (Binary File ) file.

If you r having 2 file of same name with .Com and .Exe extensions

the sequence of execution (while giving the file name without Extension) as follows
1. .Com
2. .Exe

It means .. it will first search for a Com file and then for a Exe file if you are not mentioning the Extionsion.

Hope its clear.

Kumar

0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 3

Expert Comment

by:GlennDean
ID: 2533963
This is from the "olden" days, but a .com executable has no relocatable segments where a .exe can have any number of them.  SO, for a .com the loader doesn't have to worry about where the stack segment is or the data segment or the code segment is (obviously this is Intel stuff).  I have never analyzed a .exe image that didn't have atleast 1 relocatable segment.
0
 
LVL 2

Expert Comment

by:Edio
ID: 2537108
    I must agree with GlennDean that is old stuff, but i guess I am old as well.
      Them Com file style was made up to be compatibel with the previous operating system wide accepted, the CP/M(CP/M used to run on Apple II, Radio Shack TRS-80).
      The CP/M was based upon the microprocessor Z-80 from Zilog (it use to run at 4MHZ).
      The CP/M reserved 256 bytes of inicial program memory to interrupt vetors to the hardware and to the software (like DOS int21 for exemplo).
      So the COM file does the same and it always start at address 100H, and to be compatible code,data and stack segments are set to the same value at entering.
      The EXE file is the first native 16 bits 8086 file format, so you can have several segments.
      The first 512 bytes of an EXE file is the PSP(Programm Segment Prefix). which have several information about the program, including the entry point that may vary, you tell the compiler the name of the main procedure and it does the job.
      You may never heard about CP/M and this may be old stuff, but ug.. CP/M standards still lives inside WINDOWS2000.
0
 
LVL 3

Expert Comment

by:GlennDean
ID: 2537364
Edio:
   I didn't know the loader always loaded a .com at 100H, but thanxs for the info.
   The code/data/stack segment registers are all the same in a .com file.  When I use to write .com programs in assembly (along time ago "in a galaxy far far away") we would almost always mix data and code together!  It was quite common for the first instruction of the .com file to do a jump pass the data you needed.
   Like Edio mentioned, the PSP contains how many relocatable segments exists for a .com/.exe.  For a .com it must be 0.  
   Glenn
   
0
 

Author Comment

by:r_bal
ID: 2544734
Thanx for the explanation.
0

Featured Post

New! My Passport Wireless Pro Wi-Fi Mobile Storage

Portable wireless storage to offload, edit, and stream anywhere.

High-capacity, wireless mobile storage designed to accompany professional photographers and videographers in the field to easily offload, edit and stream captured photos and high-definition videos.

Join & Write a Comment

I use more than 1 computer in my office for various reasons. Multiple keyboards and mice take up more than just extra space, they make working a little more complicated. Using one mouse and keyboard for all of my computers makes life easier. This co…
Great sound, comfort and fit, excellent build quality, versatility, compatibility. These are just some of the many reasons for choosing a headset from Sennheiser.
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now