Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

"com" vs "exe" files

Posted on 2000-02-14
7
Medium Priority
?
695 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 150 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
Free Backup Tool for VMware and Hyper-V

Restore full virtual machine or individual guest files from 19 common file systems directly from the backup file. Schedule VM backups with PowerShell scripts. Set desired time, lean back and let the script to notify you via email upon completion.  

 
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

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Question has a verified solution.

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

Does your iMac really need a hardware upgrade? Will upgrading RAM speed-up your computer? If yes, then how can you proceed? Upgrading RAM in your iMac is not as simple as it may seem. This article will help you in getting and installing right RA…
New style of hardware planning for Microsoft Exchange server.
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…

715 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