Thread: Executable-code relation

  1. #1
    Registered User
    Join Date
    Jan 2005

    Executable-code relation

    I'm interested in the nature of the executables produced by compilers, and I wonder of their makup in DOS, windows and Linux, respectively.

    DOS doesn't have alot of an API so it probably doesn't have it's own executable format either - or does it? Are DOS .EXEs X86 machine code?

    Windows has the (strange?) portable executable (which still isn't very portable for what I understand - there may be problems between different CPUs even if both computers run Windows)

    What about linux's executables?

  2. #2
    Gawking at stupidity
    Join Date
    Jul 2004
    Oregon, USA
    This might be a place to start:

    Or maybe you could even just do a simple google search:
    If you understand what you're doing, you're not learning anything.

  3. #3
    Registered User
    Join Date
    Jan 2005
    DOS dose have it's own EXE format, all valid windows PE format files are also valid DOS exe files that way if you run a windows program from DOS the DOS stub at the start of the file can run and give the message "This program requires windows". The windows PE loader skips the DOS stub and starts execution in the windows code.
    In the PE header is a flag saying which CPU aarchitecture the program was intended for so an x86 program will only run in an x86 environment.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Proposal: Code colouring
    By Perspective in forum A Brief History of
    Replies: 28
    Last Post: 05-14-2007, 07:23 AM
  2. Values changing without reason?
    By subtled in forum C Programming
    Replies: 2
    Last Post: 04-19-2007, 10:20 AM
  3. Updated sound engine code
    By VirtualAce in forum Game Programming
    Replies: 8
    Last Post: 11-18-2004, 12:38 PM
  4. True ASM vs. Fake ASM ????
    By DavidP in forum A Brief History of
    Replies: 7
    Last Post: 04-02-2003, 04:28 AM
  5. Interface Question
    By smog890 in forum C Programming
    Replies: 11
    Last Post: 06-03-2002, 05:06 PM