1 <!DOCTYPE HTML PUBLIC
"-//IETF//DTD HTML 2.0//EN">
4 <TITLE>80386 Programmer's Reference Manual -- Opcode CLTS
</TITLE>
7 <B>up:
</B> <A HREF=
"c17.htm">
8 Chapter
17 --
80386 Instruction Set
</A><BR>
9 <B>prev:
</B><A HREF=
"CLI.htm"> CLI Clear Interrupt Flag
</A><BR>
10 <B>next:
</B><A HREF=
"CMC.htm"> CMC Complement Carry Flag
</A>
14 <H1>CLTS -- Clear Task-Switched Flag in CR0
</H1>
17 Opcode Instruction Clocks Description
19 OF
06 CLTS
5 Clear task-switched flag
31 CLTS clears the task-switched (TS) flag in register CR0. This flag is set by
32 the
80386 every time a task switch occurs. The TS flag is used to manage
33 processor extensions as follows:
35 <LI> Every execution of an ESC instruction is trapped if the TS flag is set.
37 <LI> Execution of a WAIT instruction is trapped if the MP flag and the TS
41 Thus, if a task switch was made after an ESC instruction was begun, the
42 processor extension's context may need to be saved before a new ESC
43 instruction can be issued. The fault handler saves the context and resets
46 CLTS appears in operating system software, not in application programs. It
47 is a privileged instruction that can only be executed at privilege level
0.
49 <H2>Flags Affected
</H2>
51 TS :=
0 (TS is in CR0, not the flag register)
53 <H2>Protected Mode Exceptions
</H2>
55 #GP(
0) if CLTS is executed with a current privilege level other than
0
57 <H2>Real Address Mode Exceptions
</H2>
59 None (valid in Real Address Mode to allow initialization for Protected
62 <H2>Virtual
8086 Mode Exceptions
</H2>
64 Same exceptions as in Real Address Mode
70 <B>up:
</B> <A HREF=
"c17.htm">
71 Chapter
17 --
80386 Instruction Set
</A><BR>
72 <B>prev:
</B><A HREF=
"CLI.htm"> CLI Clear Interrupt Flag
</A><BR>
73 <B>next:
</B><A HREF=
"CMC.htm"> CMC Complement Carry Flag
</A>