문제

It seems like given a full reference of instructions for any two platforms, say x86 and ARM, it should be possible to convert a program compiled for the first platform to the second one. Those instructions that one of the platform lacks can be implemented as a series of more primitive instructions. Ultimately, what CPU does are I/O and arithmetic. If so, why people develop emulators that interpret code at a higher level rather than developing instruction translators which would allow to have binaries running at the native speed of the target platform?

도움이 되었습니까?

해결책

It is called binary translation, and it is done in several applications. For example Intel performs binary translation of Android applications compiled for ARM. Some instructions can be translated easily, while others require more complex emulation.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top