Patent ID: 8719589

Claim:
A microprocessor, comprising: a storage element, comprising a plurality of locations each configured to store decryption key data associated with an encrypted program; a control register, comprising a field for specifying one of the plurality of locations of the storage element associated with a currently executing encrypted program, wherein the microprocessor is configured to restore from memory to the control register a previously saved value of the field in response to executing a return from interrupt instruction; and a fetch unit, configured to fetch encrypted instructions of the currently executing encrypted program and to decrypt them using the decryption key data stored in the one of the plurality of locations of the storage element specified by the restored previously saved value of the field, wherein the fetch unit is configured to decrypt the fetched encrypted instructions by performing a Boolean exclusive-OR (XOR) operation of the fetched encrypted instructions with the decryption key data stored in the one of the plurality of locations of the storage element specified by the restored previously saved field value.