Executable-code relation

This is a discussion on Executable-code relation within the C Programming forums, part of the General Programming Boards category; I'm interested in the nature of the executables produced by compilers, and I wonder of their makup in DOS, windows ...

  1. #1
    Registered User
    Join Date
    Jan 2005
    Posts
    70

    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
    Location
    Oregon, USA
    Posts
    3,175
    This might be a place to start: http://www.wotsit.org/search.asp?s=binary

    Or maybe you could even just do a simple google search:
    http://www.google.com/search?hl=en&q...=Google+Search
    If you understand what you're doing, you're not learning anything.

  3. #3
    Registered User
    Join Date
    Jan 2005
    Posts
    847
    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 Cprogramming.com
    Replies: 28
    Last Post: 05-14-2007, 08:23 AM
  2. Values changing without reason?
    By subtled in forum C Programming
    Replies: 2
    Last Post: 04-19-2007, 11: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 Cprogramming.com
    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, 06:06 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21