Patent ID: 8521504

Claim:
A method of emulating guest instructions using binary translation in a virtual computer system that executes within a host computer system, the virtual computer system having a binary translation mode and a direct execution mode, the host computer system permitting only indirect memory addressing when saving registers to memory, the host computer system having a first trappable register for which an attempted access may be trapped, the method comprising: during direct execution mode, setting up a trap that is activated upon guest software attempting to access the first trappable register and, upon activation of the trap, emulating the first trappable register so that the guest software does not have access to the first trappable register, but the guest software is executed as if it had access to the first trappable register; upon switching from direct execution mode to binary translation mode, using the first trappable register for address indirection to save a third register to memory; and during binary translation mode, executing a block of translated code and using the third register as a scratch register during the execution of the block of translated code.