1 <!DOCTYPE HTML PUBLIC
"-//IETF//DTD HTML 2.0//EN">
4 <TITLE>80386 Programmer's Reference Manual -- Section
13.3</TITLE>
7 <B>up:
</B> <A HREF=
"c13.htm">
8 Chapter
13 -- Executing
80286 Protected-Mode Code
</A><BR>
9 <B>prev:
</B> <A HREF=
"s13_02.htm">13.2 Two ways to Execute
80286 Tasks
</A><BR>
10 <B>next:
</B> <A HREF=
"c14.htm">Chapter
14 --
80386 Real-Address Mode
</A>
14 <H1>13.3 Differences From
80286</H1>
15 The few differences that do exist primarily affect operating system code.
17 <H2>13.3.1 Wraparound of
80286 24-Bit Physical Address Space
</H2>
18 With the
80286, any base and offset combination that addresses beyond
16M
19 bytes wraps around to the first megabyte of the
80286 address space. With
20 the
80386, since it has a greater physical address space, any such address
21 falls into the
17th megabyte. In the unlikely event that any software
22 depends on this anomaly, the same effect can be simulated on the
80386 by
23 using paging to map the first
64K bytes of the
17th megabyte of logical
24 addresses to physical addresses in the first megabyte.
26 <H2>13.3.2 Reserved Word of Descriptor
</H2>
27 Because the
80386 uses the contents of the reserved word (last word) of
28 every descriptor,
80286 programs that place values in this word may not
29 execute correctly on the
80386.
31 <H2>13.3.3 New Descriptor Type Codes
</H2>
32 Operating-system code that manages space in descriptor tables often uses an
33 invalid value in the access-rights field of descriptor-table entries to
34 identify unused entries. Access rights values of
80H and
00H remain invalid
35 for both the
80286 and
80386. Other values that were invalid on for the
36 80286 may be valid for the
80386 because of the additional descriptor types
39 <H2>13.3.4 Restricted Semantics of LOCK
</H2>
40 The
80286 processor implements the bus lock function differently than the
41 80386. Programs that use forms of memory locking specific to the
80286 may
42 not execute properly when transported to a specific application of the
45 The
<A HREF=
"LOCK.htm">LOCK
</A>
46 prefix and its corresponding output signal should only be used to
47 prevent other bus masters from interrupting a data movement operation.
48 <A HREF=
"LOCK.htm">LOCK
</A>
49 may only be used with the following
80386 instructions when they modify
50 memory. An undefined-opcode exception results from using
51 <A HREF=
"LOCK.htm">LOCK
</A> before any
54 <LI> Bit test and change:
<A HREF=
"BTS.htm">BTS
</A>,
55 <A HREF=
"BTR.htm">BTR
</A>,
56 <A HREF=
"BTC.htm">BTC
</A>.
58 <A HREF=
"XCGH.htm">XCHG
</A>.
59 <LI> One-operand arithmetic and logical:
60 <A HREF=
"INC.htm">INC
</A>,
61 <A HREF=
"DEC.htm">DEC
</A>,
62 <A HREF=
"NOT.htm">NOT
</A>, and
63 <A HREF=
"NEG.htm">NEG
</A>.
64 <LI> Two-operand arithmetic and logical:
65 <A HREF=
"ADD.htm">ADD
</A>,
66 <A HREF=
"ADC.htm">ADC
</A>,
67 <A HREF=
"SUB.htm">SUB
</A>,
68 <A HREF=
"SBB.htm">SBB
</A>,
69 <A HREF=
"AND.htm">AND
</A>,
70 <A HREF=
"OR.htm">OR
</A>,
71 <A HREF=
"XOR.htm">XOR
</A>.
73 A locked instruction is guaranteed to lock only the area of memory defined
74 by the destination operand, but may lock a larger memory area. For example,
75 typical
8086 and
80286 configurations lock the entire physical memory space.
76 With the
80386, the defined area of memory is guaranteed to be locked
77 against access by a processor executing a locked instruction on exactly the
78 same memory area, i.e., an operand with identical starting address and
81 <H2>13.3.5 Additional Exceptions
</H2>
82 The
80386 defines new exceptions that can occur even in systems designed
86 Exception #
6 -- invalid opcode
88 This exception can result from improper use of the
89 <A HREF=
"LOCK.htm">LOCK
</A> instruction.
91 Exception #
14 -- page fault
93 This exception may occur in an
80286 program if the operating system
94 enables paging. Paging can be used in a system with
80286 tasks as long
95 as all tasks use the same page directory. Because there is no place in
96 an
80286 TSS to store the PDBR, switching to an
80286 task does not
97 change the value of PDBR. Tasks ported from the
80286 should be given
98 80386 TSSs so they can take full advantage of paging.
103 <B>up:
</B> <A HREF=
"c13.htm">
104 Chapter
13 -- Executing
80286 Protected-Mode Code
</A><BR>
105 <B>prev:
</B> <A HREF=
"s13_02.htm">13.2 Two ways to Execute
80286 Tasks
</A><BR>
106 <B>next:
</B> <A HREF=
"c14.htm">Chapter
14 --
80386 Real-Address Mode
</A>