Sei sulla pagina 1di 3

UNIT 2: THE MICROPROCESSOR AND ITS

ARCHITECTURE (CONT.)

Introduction to Protected Mode Memory Addressing


Protected-mode memory addressing (80286) allows access to data & programs located
above first 1MB of memory &
within first 1MB of memory.
In place of segment-address, segment-register contains a selector that selects a descriptor
from a descriptortable. (The extended memory system is accessed via a segment-address plus an
offset-address, just as in the real mode. The difference is that the segment-address is not held in
the segment-register. In the protected-mode, the segment starting-address is stored in a descriptor
that is selected by the segment-register).
Descriptor describes
memory-segment's location
length &
access rights
Another difference in the 80386 is that the offset-address can be a 32-bit number instead of a
16-bit number.

Selectors & Descriptors


Selector (located in the segment-register) selects one of 8192 descriptors from one of 2 tables
of descriptors.
Descriptor describes the location, length and access rights of the segment of memory.
There are 2 descriptor-tables: 1) Global descriptor table & 2) Local descriptors
table.
Global-descriptors contain segment-definitions that apply to all programs
whereas local-descriptors are usually unique to an application.
Each descriptor-table contains 8192 descriptors, so a total of 16384 total descriptors are
available to an application at any time.
A descriptor contains
1) Base-address locates starting-address of memory-segment
2) Segment-limit contains last offset-address found in a segment (For example, if a segment
begins at memory location F00000H and ends at location F000FFH, the base-address is
F00000H and the limit is FFH).
3) Access rights byte defines how the memory-segment is accessed via a program.
For 80286 microprocessor, the base-address is a 24-bit address, so segments begin at any
location in its 16MB of memory.
In 80386, if G (granularity) =0, the limit specifies a segment-limit of 00000H to FFFFFH. If
G=1, the value of the limit is multiplied by 4KB.
In the 64-bit descriptor, if L=1, 64-bit address in a Pentium4 with 64-bit extensions is
selected. if L=0, 32-bit compatibility mode is selected
The AV bit is used by some operating-systems to indicate that the segment is available
(AV=1) or not available (AV=0).
D bit indicates how 80386 instructions access register & memory-data in protected- or real-
mode.
If D=0, the instructions are 16-bit instructions, compatible with the 8086 microprocessor.
(This means that the instructions use 16-bit offset addresses and 16-bit register by default).
If D=1, the instructions are 32-bit instructions.
Figure 2-6: The 80286 through Core2 64-bit descriptors

Figure 2-9: Using DS register to select a descriptor from the global descriptor table

Potrebbero piacerti anche