[comp.sys.ibm.pc.misc] Need technical explanation of why .COM/.EXE being binary/Hex

v087mxgb@ubvmsa.cc.buffalo.edu (Shawn E Thompson) (03/14/91)

Hi,

could someone please explain to me why .COM files are
binary and why .EXE files are hex....and why they both
work (ie...is the Hex EXE files translated on the fly into 
biinary???)

also,,, when programming in assy, do I make binary files
or hex files ???



Ive done quite a bit of programming, at the high-level
(as opposed to machine level assembly languages), so
technical answers are what I really need.



thanks in advance

st

richard@murna.asis.unimelb.edu.au (Richard Begg) (03/15/91)

v087mxgb@ubvmsa.cc.buffalo.edu (Shawn E Thompson) writes:
>Hi,

>could someone please explain to me why .COM files are
>binary and why .EXE files are hex....and why they both
>work (ie...is the Hex EXE files translated on the fly into 
>biinary???)

[stuff deleted]

>thanks in advance

>st

Er... Um... correct me if I am wrong here, but aren't binary and hex (or
even decimal for that matter) just different means of displaying a given
number.  It all depends on how you choose to look at the data.

---
Richard.

  +--------------------------------------------------------------------------+
  |              Richard Begg (richard@ariel.ucs.unimelb.edu.au)             |
  |              Programmer with ASIS, University of Melbourne.              |

kabra437@pallas.athenanet.com (Ken Abrams) (03/16/91)

In article <65157@eerie.acsu.Buffalo.EDU> v087mxgb@ubvmsa.cc.buffalo.edu writes:
>
>could someone please explain to me why .COM files are
>binary and why .EXE files are hex..
>also,,, when programming in assy, do I make binary files

Since you asked for "technical" answers, I hope mine is not too simple ;-).

The fact of the matter is that EVERYTHING that is stored in the computer
is really binary.  The translation only occurs on output so that dumb
humans can make some use of the data in a (relatively) convenient manner.
HEX is just a handy (?) method of representing the binary data.  It can
also be represented in Octal, etc. but the source file is still binary.
Even text is really stored in binary and is translated into readable
characters upon output using a "numbering system" or translator called
ASCII.
But you probably knew all that already..........
The answer that you are probably really looking for is that the operating
system program that loads COM and EXE files and executes them is slightly
different; in effect, a different translator.  This does NOT mean, however,
that COM files are binary and EXE files are HEX.

-- 
========================================================
Ken Abrams                     uunet!pallas!kabra437
Illinois Bell                  kabra437@athenanet.com
Springfield                    (voice) 217-753-7965