Kate
Kate

Reputation: 945

Why would a x86 compiled application work on 64 bit windows machine?

screenshot

I installed windows 7 64 bit and then I installed visual studio 2015 then created C# application using windows forms and I compiled this application as x86 (as shown in screenshot) to creat the exe file . After that I installed the .exe file on another 64 bit windows 7 and the application worked fine!

My question is: why this x86 complied application would work on 64 bit machine. I read that if I compile application as x86 it would only work on x86 machines.

Can anyone explain why it worked on 64 bit machine? thank you

Upvotes: 1

Views: 80

Answers (1)

lvoo
lvoo

Reputation: 561

The reason is because your 64bit CPU is specically designed for this as well as the operating system you're using. In short, the OS detect that you're trying to run a x86 application and put the CPU in x86 compatibility mode before executing your application.

Upvotes: 1

Related Questions