How can I create an executable to run on a certain processor architecture (instead of certain OS)?

Posted by CrazyJugglerDrummer on Stack Overflow See other posts from Stack Overflow or by CrazyJugglerDrummer
Published on 2009-08-28T01:47:17Z Indexed on 2010/03/14 14:15 UTC
Read the original article Hit count: 291

Filed under:
|
|
|
|

So I take my C++ program in Visual studio, compile, and it'll spit out a nice little EXE file. But EXEs will only run on windows, and I hear a lot about how C/C++ compiles into assembly language, which is runs directly on a processor. The EXE runs with the help of windows, or I could have a program that makes an executable that runs on a mac. But aren't I compiling C++ code into assembly language, which is processor specific?

My Insights:

  1. I'm guessing I'm probably not. I know there's an Intel C++ compiler, so would it make processor-specific assembly code? EXEs run on windows, so they advantage of tons of things already set up, from graphics packages to the massive .NET framework. A processor-specific executable would be literally starting from scratch, with just the instruction set of the processor.

  2. Would this executable be a file-type? We could be running windows and open it, but then would control switch to processor only? I assume this executable would be something like an operating system, in that it would have to be run before anything else was booted up, and have only the processor instruction set to "use".

© Stack Overflow or respective owner

Related posts about processor

Related posts about compile