简体   繁体   English

是否可以在具有32位处理器的计算机上运行64位代码?

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

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 ? 是否可以在具有64-bit processor的计算机上运行32-bit代码?

    The answer seems to be yes. 答案似乎是肯定的。 but there is a debate on performance issues, since 32-bits are left unused on the processor. 但是在性能问题上存在争议,因为处理器上未使用32-bits

  2. Now my question is vice-versa, Is it possible to run 64-bit code in a machine with 32-bit processor? 现在我的问题反之亦然,是否可以在具有32-bit处理器的计算机上运行64-bit代码?

    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. 据我所知,答案是否定的,因为设计为在64-bit上运行的代码将使用64-process registars32-bit计算机仅提供32个。

On the otherhand, I found this link . 另一方面,我找到了此链接 According this, it is possible to compile 64-bit code on a 32-bit machine. 据此,可以在32位计算机上编译64位代码。 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. 但是我不清楚如何做到这一点,再加上在32-bit计算机上进行编译是否也可以保证在同一计算机上execution

Thanks for helping out 感谢您的帮助

Is it possible to run 32-bit code in a machine with 64-bit processor? 是否可以在具有64位处理器的计算机上运行32位代码?

Yes. 是。 This is handled in Windows via WOW64 , for example. 例如,这在Windows中通过WOW64处理。

Now my question is vice-versa, Is it possible to run 64-bit code in a machine with 32-bit processor? 现在我的问题反之亦然,是否可以在具有32位处理器的计算机上运行64位代码?

No. 64bit code would require a 64 bit instruction set, which won't be available on a 32 bit processor. 否。64位代码将需要64位指令集,而32位处理器将无法使用该指令集。

According this, it is possible to compile 64-bit code on a 32-bit machine. 据此,可以在32位计算机上编译64位代码。

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. 这使您可以为当前执行平台以外的平台构建代码,但是无法执行。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM