Page 1 of 1 [ 11 posts ] 

UnLoser
Veteran
Veteran

User avatar

Joined: 28 Mar 2012
Gender: Male
Posts: 655

25 Jun 2012, 6:46 pm

(And I mean the word "geek" in the nicest way possible. Yes, I am a geek myself.)

So I was wondering how executable files can run on so many different computers. Don't different processors have different instruction sets? So how does one Windows .exe run on every computer that supports Windows? Is Windows only compatible with a certain series of processors? Or are .exe files actually some sort of intermediate code that needs to be compiled at runtime?

It would be nice if someone could explain this to me.



noname_ever
Veteran
Veteran

User avatar

Joined: 25 Dec 2011
Age: 48
Gender: Male
Posts: 500
Location: Indiana

25 Jun 2012, 7:34 pm

Many processors that run Windows share common instruction sets like the x86 instruction set.

If you're curious about executable file formats, start here.
https://en.wikipedia.org/wiki/EXE

Windows is only compatible with a small number of processors at the moment (the popular ones from Intel and AMD) and those implement the same instruction sets. There used to be PPC and Alpha ports of Windows as well.

Note: That there is Windows CE that have worked on ARM processors all along, but that is yet a different build than the one listed above for desktop processors.



redrobin62
Veteran
Veteran

User avatar

Joined: 2 Apr 2012
Age: 61
Gender: Male
Posts: 13,009
Location: Seattle, WA

25 Jun 2012, 9:25 pm

Processors do have instruction sets (RISC, etc) but I wonder if your question is related to OS and/or the particular program itself. My computer has two OS's, Windows 8 and Ubuntu 12.04. They're using the same CPU but an exe from Windows won't work on Ubuntu. Similarly, the setup files from my Spectare USB TV tuner that worked on m W7 system doesn't work on my current W8.



Fogman
Veteran
Veteran

User avatar

Joined: 19 Jun 2005
Age: 57
Gender: Male
Posts: 3,986
Location: Frå Nord Dakota til Vermont

26 Jun 2012, 10:00 am

UnLoser wrote:
(And I mean the word "geek" in the nicest way possible. Yes, I am a geek myself.)

So I was wondering how executable files can run on so many different computers. Don't different processors have different instruction sets? So how does one Windows .exe run on every computer that supports Windows? Is Windows only compatible with a certain series of processors? Or are .exe files actually some sort of intermediate code that needs to be compiled at runtime?

It would be nice if someone could explain this to me.


Differant processors have differant instruction sets, but the ones from AMD and Intel are all x86 archetecture, so therefore, the instruction set is x86. IA64, OTOH is a 64 bit EPIC processor that is capable of executing x86 instructions in emulation. The now defunct Transmeta processor archetecture was a 32 bit EPIC chip that was designed to execute x86 instructions via hardware level emulation. RISC processors such as MIPS, SPARC, and PowerPC are all capable of executing x86 instructions via either VM software, or emulation software, though there will be a performace hit, due to the overhead of the software.

Conversely, there was emulation software for x86 that was capable of running 1st Gen Playstation games. MAME is a VM capable of running old arcade games coded for the original 68K processors, and I think there are emulators still available to run 68K Mac apps and older PowerPC apps on x86 processors of at least the 486/586 generations.

There was a version of WinNT4 that ran natively on Alpha 64 bit RISC processors briefly in the late '90's, but it's long since gone, as is the Alpha processor.

The real compatibility/ and incompatability issues of software are which processors the software source code is optimised and ultimately compiled for. --If you have no idea of the hardware specifics, then it's hard to optimise and compile code for a specific class of processors. --An example of this is when Be Inc. developed an OS for PPC Macs that had pre-emptive multitasking and multithreading. It ran fine on Older PowerPC Macs, but when Apple started using the G series processors, they refused to give the specifics of the processor archetecture to Be due to the fact that they didn't want people installing what was a vast improvement over the OS that Apple provided. This led to BeOS being ported to x86.


_________________
When There's No There to get to, I'm so There!


Aquais94
Blue Jay
Blue Jay

User avatar

Joined: 12 Oct 2012
Age: 29
Gender: Male
Posts: 99
Location: Canada

01 Jan 2013, 5:49 pm

noname_ever wrote:
Many processors that run Windows share common instruction sets like the x86 instruction set.

If you're curious about executable file formats, start here.
https://en.wikipedia.org/wiki/EXE

Windows is only compatible with a small number of processors at the moment (the popular ones from Intel and AMD) and those implement the same instruction sets. There used to be PPC and Alpha ports of Windows as well.

Note: That there is Windows CE that have worked on ARM processors all along, but that is yet a different build than the one listed above for desktop processors.


Do you Know, The new version of Windows (Windows 8 ) can run ARM Processor (for Windows RT only).



RazorEddie
Veteran
Veteran

User avatar

Joined: 18 Jan 2012
Age: 53
Gender: Male
Posts: 610

01 Jan 2013, 6:51 pm

UnLoser wrote:
So I was wondering how executable files can run on so many different computers. Don't different processors have different instruction sets? So how does one Windows .exe run on every computer that supports Windows? Is Windows only compatible with a certain series of processors? Or are .exe files actually some sort of intermediate code that needs to be compiled at runtime.

Not all exe files will run on all versions of Windows. The vast majority of Windows installations are on x86 type PCs. The processors have a standardized instruction set so as long as the exe is compiled to use that instruction set it will run. However if you try to run an x86 exe on an ARM version of Windows or vice-versa, it will not run. An exe compiled for 64 bit also won't run on a 32 bit machine. It will work the other way round because 64 bit versions of Windows have a 32 bit compatibility layer. To run these exe files the processor is switched into 32 bit mode and some clever intefacing code allows it to talk to the rest of the 64 bit operating system.

This 32/64 bit compatibility issue is why a large percentage of commercial applications are still 32 bit. Developers don't want to have to support two different versions so they pick the lowest common denominator.


_________________
I stopped fighting my inner demons. We're on the same side now.


ruveyn
Veteran
Veteran

User avatar

Joined: 21 Sep 2008
Age: 87
Gender: Male
Posts: 31,502
Location: New Jersey

01 Jan 2013, 8:44 pm

UnLoser wrote:
(And I mean the word "geek" in the nicest way possible. Yes, I am a geek myself.)

So I was wondering how executable files can run on so many different computers. Don't different processors have different instruction sets? So how does one Windows .exe run on every computer that supports Windows? Is Windows only compatible with a certain series of processors? Or are .exe files actually some sort of intermediate code that needs to be compiled at runtime?

It would be nice if someone could explain this to me.


Those executables are most likely written in pseudo code which is translated into the actual instruction sets for the machines it runs on. Think of pseudo code is a low level language which deals with data at the register and bit livel.

ruvyen



RazorEddie
Veteran
Veteran

User avatar

Joined: 18 Jan 2012
Age: 53
Gender: Male
Posts: 610

01 Jan 2013, 9:01 pm

ruveyn wrote:
UnLoser wrote:
Those executables are most likely written in pseudo code which is translated into the actual instruction sets for the machines it runs on. Think of pseudo code is a low level language which deals with data at the register and bit level.


Most pe format executable files (e.g. exe files, dlls and several other executable files) contain pure binary compiled code. The pe format has been extended to handle .NET and contains the intermediate language code but I don't think even that can be used across different processors.


_________________
I stopped fighting my inner demons. We're on the same side now.


zacb
Veteran
Veteran

User avatar

Joined: 7 May 2012
Age: 29
Gender: Male
Posts: 1,158

01 Jan 2013, 11:49 pm

Usually, there are pieces of code you can embed in your program that "translates" your code across various systems. It is kind of like Java, which is able to be used on various systems, but it is not as elaborate.



bcousins
Veteran
Veteran

User avatar

Joined: 1 May 2011
Age: 29
Gender: Male
Posts: 809
Location: On a failed Tangara set at Blacktown

01 Jan 2013, 11:57 pm

Aquais94 wrote:
Do you Know, The new version of Windows (Windows 8 ) can run ARM Processor (for Windows RT only).


I'll bet it's x86


_________________
Want another alternative to WrongPlanet?
https://aspergers.network/forums/ <- New Version Coming (hopefully) soon.


stands2reason
Tufted Titmouse
Tufted Titmouse

User avatar

Joined: 27 Dec 2012
Age: 32
Gender: Male
Posts: 39

02 Jan 2013, 9:21 am

bcousins wrote:
Aquais94 wrote:
Do you Know, The new version of Windows (Windows 8 ) can run ARM Processor (for Windows RT only).


I'll bet it's x86


How much will you bet? The ARM architecture is completely different. It's not even in the same family as x86; it's RISC and based on MIPS.