80x86 Architecture

Logical memory:
memory as viewed by the programmer through the software

Physical memory:
memory as viewed by the hardware designer


Logical Memory Map:  00000H -> FFFFFH (1 MB, 20 bits)


16 MB of physical memory, 1 GB of virtual memory

Real Mode:
identical to 8086

Protected Virtual Mode:

Virtual memory machine:
a system that maps a larger memory space into a much smaller memory space

used to address a 64 kB memory segment in protected model; a segment register that holds the current descriptor number; 16 bits in length

define the use of memory space
(Global, Local, and Interrupt) - 64 bits in length

Types of Descriptors


Important Note: 80386 includes Intel 80386, 80486, Pentium, Pentium Pro/II/III/4/D/M, Core, Core 2, Celeron; and AMD K5, K6, K6-2, Athlon, Turion, Opteron, Duron, Sempron processors

4 GB of physical memory (32-bit),
64 TB of virtual memory
(16,384 segments @ 4 GB per segment)

Descriptors:  32-bit base address and 20-bit limit

Virtual 8086 Mode:

This allows the entire DOS environment to be placed in one protected mode segment multitasking of DOS environments by merely switching from one segment to another with a task switch.

Each task segment can be running a different application, simultaneously, through time-slicing.

Descriptor Fields

Access Rights (Segment Descriptors)

P=Present P=1 Segment Present
DPL (2-bits) Descriptor Privilege Level
S=Segment S=1 Code or data segment
S=0 System or gate descriptor
E=Executable E=0 Data descriptor
E=1 Code descriptor
C=Code Segment C=0 Privilege ignored for code segment
C=1 Privilege observed for code segment
ED=Direction ED=0 Data segment expands upward
ED=1 Data segment expands downward
W=Write W=0 Data segment may not be written
W=1 Data segment may be written
R=Read R=0 Code segment may not be read
R=1 Code segment may be read
A=Accessed A=0 Segment has not been accessed
A=1 Segment has been accessed

The Memory Paging Mechanism

Logical memory page:
a page that is addressed with a selector and an offset

Physical memory page:
a page that exists at some actual physical memory location

Each page in the 80386 paging scheme is 4K bytes in length.

Page Directory:
stored in physical memory; up to 1,024 entries that are each 4 bytes in length:

Name Function
D=Dirty bit 1=Page modified (page table only)
A=Accessed bit 1 when '386 accesses the page directory and subsequent table
R/W=Read/Write bit 0=Read-only, 1=Read/write
U/S=User/ Supervisor bit 1=the '386 can still write to the page directory entry even if it is marked Read-only by the R/W bit
P=Present bit 1=page directory entry is present

Interrupts and Exceptions

Function IRQ


Instruction(s) Which Can Cause Exception
Divide Error 0 DIV, IDIV
Debug Exception 1 any instruction
NMI Interrupt 2 INT 2 or NMI
One Byte Interrupt 3 INT
Interrupt on Overflow 4 INTO
Array Bounds Check 5 BOUND
Invalid OP-Code 6 An illegal instruction that is not defined in the instruction set is executed.
Device Not Available 7 ESC, WAIT
Double Fault 8 A type A, B, C, or D interrupt at the same time that an interrupt other than a type E is detected.
Coprocessor Segment Overrun 9 Operand address wraps around from FFFFH to 0000H in virtual 8086 mode or real mode or from FFFFFFFFH to 00000000H in protected mode.
Invalid TSS A The selector, code segment or stack segment is outside the table limit, stack is not writable, or if the RPL is not equal to the TSS DPL.
Segment Not Present B The P bit of the descriptor is not set.
Stack Fault C The SS descriptor addresses a segment that is not present or if any stack operation causes a limit violation
General Protection Fault D Exceeding segment limit; writing to a read-only code or data segment; loading a selector with a system descriptor; reading an execute only code segment; switching to a busy task; violating DPL for a data segment; PG = 1 and PE = 0
Page Fault E If PG=1 and the privilege level is incorrect or the page table or directory contains a zero.
Coprocessor Error 10 80387 ERROR pin set.
Intel Reserved 11-20 Reserved by Intel for future projects.
Two Byte Interrupt 00-FF  

Back to the CTEC1863 page