* remove "\r" nonsense
[mascara-docs.git] / i386 / i386.reference / LMSW.htm
blob1cb3d296872dbc6108c05e7ed1b147077fc0d7cc
1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
2 <HTML>
3 <HEAD>
4 <TITLE>80386 Programmer's Reference Manual -- Opcode LMSW</TITLE>
5 </HEAD>
6 <BODY>
7 <B>up:</B> <A HREF="c17.htm">
8 Chapter 17 -- 80386 Instruction Set</A><BR>
9 <B>prev:</B><A HREF="LLDT.htm"> LLDT Load Local Descriptor Table Register</A><BR>
10 <B>next:</B><A HREF="LOCK.htm"> LOCK Assert LOCK# Signal Prefix</A>
11 <P>
12 <HR>
13 <P>
14 <H1>LMSW -- Load Machine Status Word</H1>
16 <PRE>
17 Opcode Instruction Clocks Description
19 0F 01 /6 LMSW r/m16 10/13 Load r/m16 in machine status word
20 </PRE>
22 <H2>Operation</H2>
24 <PRE>
25 MSW := r/m16; (* 16 bits is stored in the machine status word *)
26 </PRE>
28 <H2>Description</H2>
30 LMSW loads the machine status word (part of CR0) from the source
31 operand. This instruction can be used to switch to Protected Mode; if so,
32 it must be followed by an intrasegment jump to flush the instruction
33 queue. LMSW will not switch back to Real Address Mode.
34 <P>
35 LMSW is used only in operating system software. It is not used in
36 application programs.
38 <H2>Flags Affected</H2>
40 None
42 <H2>Protected Mode Exceptions</H2>
44 #GP(0) if the current privilege level is not 0; #GP(0) for an illegal
45 memory operand effective address in the CS, DS, ES, FS, or GS
46 segments; #SS(0) for an illegal address in the SS segment; #PF(fault-code)
47 for a page fault
49 <H2>Real Address Mode Exceptions</H2>
51 Interrupt 13 if any part of the operand would lie outside of the effective
52 address space from 0 to 0FFFFH
54 <H2>Virtual 8086 Mode Exceptions</H2>
56 Same exceptions as in Real Address Mode; #PF(fault-code) for a page
57 fault
59 <H2>Notes</H2>
61 The operand-size attribute has no effect on this instruction. This
62 instruction is provided for compatibility with the 80286; 80386 programs
63 should use <A HREF="MOVRS.htm">MOV</A> CR0, ... instead.
64 <P>
65 <HR>
66 <P>
67 <B>up:</B> <A HREF="c17.htm">
68 Chapter 17 -- 80386 Instruction Set</A><BR>
69 <B>prev:</B><A HREF="LLDT.htm"> LLDT Load Local Descriptor Table Register</A><BR>
70 <B>next:</B><A HREF="LOCK.htm"> LOCK Assert LOCK# Signal Prefix</A>
71 </BODY>