If the NT flag is set, however, the handler is an interrupt task, and the IRET switches back to the interrupted task. Data-access privilege rules apply in the case of JMP or CALL instructions. Exceptions, interrupts, and IRET are permitted to switch tasks regardless of the DPL of the target task gate or TSS descriptor. Checking that the TSS descriptor of the new task is marked present and has a valid limit. Any errors up to this point occur in the context of the outgoing task.
Errors are restartable and can be handled in a way that is transparent to applications procedures.
Saving the state of the current task. The processor finds the base address of the current TSS cached in the task register. The EIP field of the TSS points to the instruction after the one that caused the task switch. The selector is either the operand of a control transfer instruction or is taken from a task gate. Loading the incoming task's state from its TSS and resuming execution.