## ALP Programming Guide and Reference

[prev][next][parent][TOC]

### Description

The CLTS instruction clears the task-switched (TS) flag in the CR0 register . This flag is set by the processor every time a task switch occurs. The TS flag is used to manage processor extensions as follows:

Every processing of an ESC instruction is trapped if the TS flag is set.

Processing of a WAIT instruction is trapped if the MP flag and the TS flag are both set.

Thus, if a task switch was made after an ESC instruction was begun, the floating-point unit's context may need to be saved before a new ESC instruction can be issued. The fault handler saves the context and clears the TS flag.

The CLTS instruction appears in operating system software, not in application programs. It is a privileged instruction that can only be run at privilege level 0.