Solved

"com" vs "exe" files

Posted on 2000-02-14
7
693 Views
Last Modified: 2012-06-21
What is the difference between .com and .exe files
0
Comment
Question by:r_bal
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!

 
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

Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article outlines why you need to choose a backup solution that protects your entire environment – including your VMware ESXi and Microsoft Hyper-V virtualization hosts – not just your virtual machines.
This article shows how to use a free utility called 'Parkdale' to easily test the performance and benchmark any Hard Drive(s) installed in your computer. We also look at RAM Disks and their speed comparisons.
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…

623 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