Patent ID: 7421570

Claim:
A microprocessor comprising: a memory array having a stack for saving contextual data; and a central processing unit coupled to the memory array, the central processing unit having registers containing contextual data and a stack pointer and being arranged for saving contextual data upon a switch from a first to a second program in a variable number of registers that varies according to a value of at least one flag stored in a register to be saved, wherein the central processing unit is arranged for changing the value of the at least one flag according to the content of an extended addressing register of a program counter of the central processing unit before saving contextual data contained in a variable number of registers that varies according to the value of the at least one flag, wherein the central processing unit is arranged for, when the content of the extended addressing register is equal to a first value, saving all the registers of the central processing unit containing contextual data, except for the extended addressing register.