www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1995/10/26/09:58:49

Date: Thu, 26 Oct 1995 07:59:09 -0400
From: kagel AT quasar DOT bloomberg DOT com
To: kawakami AT mita DOT nel DOT co DOT jp
Cc: djgpp AT sun DOT soe DOT clarkson DOT edu
Subject: Re: .exe file format
Reply-To: kagel AT ts1 DOT bloomberg DOT com

   From: kawakami AT mita DOT nel DOT co DOT jp
   Date: Thu, 26 Oct 95 20:07:21 +0900

   In Message-Id: <173B73316E AT fs2 DOT mt DOT umist DOT ac DOT uk> 
   "A.Appleyard" <A DOT APPLEYARD AT fs2 DOT mt DOT umist DOT ac DOT uk> wrote: 

   >Aaron Ucko <UCKO AT VAX1 DOT ROCKHURST DOT EDU> wrote (Subject: Re: GNAT-ADA-DOS bugs?):-
   >
   >> ... DOS actually treats COMs and EXEs equally, trying to parse an EXE header
   >> if the first two bytes are 'M' and 'Z' (not necessarily in that order!) and
   >> just executing the contents of the file as raw code otherwise.
   >
   >Where anywhere at all can I find information on the internal format and layout
   >of .COM and .EXE etc files?
   >
   >If a .COM file did start with `MZ' or `ZM', would that correspond with any
   >legal or likely PC instructions?

   `M' and `Z' are `dec bp' and `pop dx' in x86 instruction.  I have no
   idea to write a program which starts with these instructions.
   --------
   KAWAKAMI Akira <kawakami AT mita DOT nel DOT co DOT jp>
   NTT Electronics Technology Corporation, Japan.

If memory serves...  It does not matter to what instructions 'MZ' or 'ZM'
equate, .COM programs jump to address 100 to start and .EXEs start after the
.EXE header records (which include the 'MZ' string.  Those first few bytes, at
least, in a DOS/Windows executeable are never look at as instructions.

-- 
Art S. Kagel, kagel AT ts1 DOT bloomberg DOT com

Variety is the soul of pleasure.  --  Aphra Behn

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019