is it possible to run 64 bit code in a machine with 32 bit processor?

余生颓废 提交于 2020-01-24 06:24:55

问题


I have searched around to get the answers for these questions. but not much luck.

  1. 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.

  2. 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 guaranteeexecution on the same.

Thanks for helping out


回答1:


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.



来源:https://stackoverflow.com/questions/21099642/is-it-possible-to-run-64-bit-code-in-a-machine-with-32-bit-processor

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!