1. A data processing unit, comprising: means for designating a working register set and a shadow register set from any combination of a first register set including first environment registers and a first register file and a second register set including second environment registers and a second register file after decoding of an instruction; means for performing a first task using said working register set; means for storing said working register set corresponding to said first task in said shadow register set upon a switch to a second task; means for determining whether said shadow register set is modified; and means for restoring said shadow register set upon a switch from said second task to said first task when said shadow register set is unmodified.