is it possible to run 64 bit code in a machine with 32 bit processor?
32-bit, c, compilation, cpu-registers, processor
Solution
Is it possible to run 32-bit code in a machine with 64-bit processor?
Yes. This is handled in Windows via WOW64, for example.
Now my question is vice-versa, Is it possible to run 64-bit code in a machine with 32-bit processor?
No. 64bit code would require a 64 bit instruction set, which won't be available on a 32 bit processor.
According this, it is possible to compile 64-bit code on a 32-bit machine.
You can compile code for other architectures, but not execute it. This lets you build code for different platforms than the currently executing platform, but executing it will not work.
Problem
I have searched around to get the answers for these questions. but not much luck. Is it possible to run `32-bit` code in a machine with `64-bit processor`? The answer seems to be yes. but there is a debate on performance issues, since `32-bits` are left unused on the processor. Now my question is vice-versa, Is it possible to run `64-bit` code in a machine with `32-bit` processor? from my little understanding, the answer is NO, because the code designed to run on `64-bit` will be using `64-process registars` but the `32-bit` machine offers only 32. On the otherhand, I found this link. According this, it is possible to compile 64-bit code on a 32-bit machine. But I am not clear on how this is done plus if compiling on a `32-bit` machine will also guarantee` execution` on the same. Thanks for helping out