
80386
cal space of the machine, 4 Gbytes (232 bytes). In Real Address Mode, the maximum segment size is fixed at 64 Kbytes (216 bytes).
The six segments addressable at any given moment are defined by the segment registers CS, SS, OS, ES, FS and GS. The selector in CS indicates the current code segment; the selector in SS indicates the current stack segment; the selectors in OS, ES, FS and GS indicate the current data segments.
2.3.5 Segment Descriptor Registers
The segment descriptor registers are not program- mer visible, yet it is very useful to understand their content. Inside the 80386, a descriptor register (pro- grammer invisible) is associated with each program-
4.Each descriptor register holds a
When a selector value is loaded into a segment reg- ister, the associated descriptor register is automati- cally updated with the correct information. In Real Address Mode, only the base address is updated directly (by shifting the selector value four bits to the left), since the segment maximum limit and attributes are fixed in Real Mode. In Protected Mode, the base address, the limit, and the attributes are all updated per the contents of the segment descriptor indexed by the selector.
2.3.6 Control Registers
The 80386 has three control registers of 32 bits, CRO, CR2 and CR3, to hold machine state of a glob- al nature (not specific to an individual task). These registers, along with System Address Registers de- scribed in the next section, hold machine state that affects all tasks in the system. To access the Con- trol Registers, load and store instructions are de- fined.
CRO: Machine Control Register (includes 80286 Machine Status Word)
CRO, shown in Figure
The defined CRO bits are described below.
PG (Paging Enable, bit 31)
the PG bit is set to enable the
Whenever a memory reference occurs, the segment | ET (Processor Extension Type, bit 4) | |
descriptor register associated with the segment be- | ET indicates the processor extension type (ei- | |
ing used is automatically involved with the memory | ||
ther 80287 or 80387) as detected by the level | ||
reference. The | ||
of the ERROR# input following 80386 reset. | ||
comes a component of the linear address calcula- | ||
The ET bit may also be set or reset by loading | ||
tion, the | ||
CRO under program control if desired. If ET is | ||
tion, and the attributes are checked against the type | ||
set, the | ||
of memory reference requested. | ||
used. If ET is reset, | ||
| ||
| protocol is used. | |
| Note that for strict 80286 compatibility, ET is | |
| not affected by the LMSW instruction. When | |
| the MSW or CRO is stored, bit 4 accurately re- | |
| flects the current state of the ET bit. |
~~ | ~} | |
| MSW |
|
NOTE: f':;~~\Iindicates Intel reserved: Do not define; SEE SECTION 2.3.10
Figure 2-5. Control Register 0
11