How does 32bit applications run on 64bit Mac?
I am trying to gather some details about how开发者_JS百科 its possible that 32 bit applications work/run on 64 bit Mac and thus will assembly code written considering 64 bit work?
Your question is very vague. I'll try to clear things up somewhat:
Any recent Mac has a processor that supports both 32-bit and 64-bit execution modes.
The OS X kernel can run in either 32- or 64-bit mode on such a processor. In 10.6 and earlier, the default was for the kernel to run in 32-bit mode. In 10.7, the kernel runs in 64-bit mode by default.
An application and its related libraries can support running in either 32-bit, 64-bit or both. This is completely separate from whether or not the kernel is running in 64-bit (that is: you can run 64-bit applications on a 32-bit kernel, and you can run 32-bit applications on a 64-bit kernel).
The net effect of this is that you can write your code for either 32-bit or 64-bit, and it will work, regardless of what the kernel is doing. That said, your application must be in sync with itself; you cannot mix 32-bit and 64-bit code within a single process.
精彩评论