Microprocessor 80386
Microprocessor 80386
Microprocessor 80386
• CLK2 :The input pin provides the basic system clock timing
for the operation of 80386.
• D0 – D31:These 32 lines act as bidirectional data bus during
different access cycles.
• A31 – A2: These are upper 30 bit of the 32- bit address bus.
• BE0 to BE3: The 32- bit data bus supported by 80386 and the
memory system of 80386 can be viewed as a 4- byte wide
memory access mechanism. The 4 byte enable lines BE0 to
BE3, may be used for enabling these 4 blanks. Using these 4
enable signal lines, the CPU may transfer 1 byte / 2 / 3 / 4 byte
of data simultaneously.
Pin diagram
M. Krishna Kumar MAM/M8/LU18/V1/2004 9
Signal Descriptions of 80386 (cont..)
CLK 2 ADDRESS
2X CLOCK A 2 – A 31
BUS
BE 3#
32 BIT
DATA DATA BE 2#
D 0 – D 31 BUS 32 – BIT
BYTE ADDRESS
BE 1# ENABLI
NES
BE 0#
ADS # W /R #
NA # D / C#
BS 16# M / IO
BUS BUS CYCLE
CONTROL DEFINATION
READY
80386 LOCK #
PROCESSOR
HOLD PEREQ
INTR
V CC
NMI
POWER
INTERRUPTS GND CONNECTIO
RESET NS
Fig:
M. Krishna Kumar MAM/M8/LU18/V1/2004 10
Signal Descriptions of 80386 (cont..)
• W/R#: The write / read output distinguishes the write and read
cycles from one another.
• D/C#: This data / control output pin distinguishes between a
data transfer cycle from a machine control cycle like interrupt
acknowledge.
• M/IO#: This output pin differentiates between the memory
and I/O cycles.
• LOCK#: The LOCK# output pin enables the CPU to prevent
the other bus masters from gaining the control of the system
bus.
• NA#: The next address input pin, if activated, allows address
pipelining, during 80386 bus cycles.
• ERROR#: The error input pin indicates to the CPU that the
coprocessor has encountered an error while executing its
instruction.
• PEREQ: The processor extension request output signal
indicates to the CPU to fetch a data word for the coprocessor.
• INTR: This interrupt pin is a maskable interrupt, that can be
masked using the IF of the flag register.
• NMI: A valid request signal at the non-maskable interrupt
request input pin internally generates a non- maskable
interrupt of type2.
Fig:
M. Krishna Kumar MAM/M8/LU18/V1/2004 17
Register Organisation (cont..)
• The six segment registers available in 80386 are CS, SS, DS,
ES, FS and GS.
• The CS and SS are the code and the stack segment registers
respectively, while DS, ES, FS, GS are 4 data segment
registers.
• A 16 bit instruction pointer IP is available along with 32 bit
counterpart EIP.
• Flag Register of 80386: The Flag register of 80386 is a 32 bit
register. Out of the 32 bits, Intel has reserved bits D18 to D31,
D5 and D3, while D1 is always set at 1.Two extra new flags are
added to the 80286 flag to derive the flag register of 80386.
They are VM and RF flags.
31 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
F
L
A RESERVED FOR VM RF 0 NT IOPL OF DF IF TF SF ZF 0 AF 0 PF 1 CF
INTEL
G
S
OFFSET
19 0
SEGMENT
SELECTOR 0000
MAX LIMIT FIXED
AT 64 K IN REAL
MODE
c
c
+ MEMORY OPERAND SELECTED
c 64 K
SEGMENT
BYTES
c c
SEGMENT BASE
• Any fetch or access past the end of the segment limit generate
exception 13 in real address mode.
• The segments in 80386 real mode may be overlapped or non-
overlapped.
• The interrupt vector table of 80386 has been allocated 1Kbyte
space starting from 00000H to 003FFH.
SELECTOR OFFSET
SELECTOR OFFSET
47 / 31 31 / 15 0
SEGMENT LIMIT
ACCESS RIGHT
c
c
LIMIT
c
c
BASE ADDRESS
+ MEMORY OPERAND
UP TO SELECTED
c 4 GB
SEGMENT DESCRIPTOR SEGMENT
c
SEGMENT BASE ADDRESS
ADDRESS 0
BYTE
SEGMENT15BASE
...0 SEGMENT BASE 15….0
LIMIT BASE +4
BASE 31..24 G D 0 AVL P DPL S TYPE A
19….16 23….26
Structure of An Descriptor
BASE Base Address of the segment
LIMIT The length of the segment
P Present Bit - 1=Present ,0 = not present
S Segment Descriptor-0 = System Descriptor ,
1 = Code or data segmentdescriptor
TYPE Type of segment
G Granularity Bit- 1= Segment length is page granular
,
0 = Segment length is byte granular
D Default Operation size
0 Bit must be zero
AVL Available field for user or OS
READ / WRITE
0 0 NONE
READ / WRITE
1 1 READ - WRITE
31 22 12 0
10 10 +
12
0 31 0
31
CR 31 DIRECTORY 0
0
CR 1 +
+
CR
2
PAGE TABLE
CR DBA
3
CONTROL
REGISTERS
• The D bit ( Dirty bit) is set before a write operation to the page
is carried out. The D-bit is undefined for page director entries.
• The OS reserved bits are defined by the operating system
software.
• The User / Supervisor (U/S) bit and read/write bit are used to
provide protection. These bits are decoded to provide
protection under the 4 level protection model.
• The level 0 is supposed to have the highest privilege, while the
level 3 is supposed to have the least privilege.
• This protection provide by the paging unit is transparent to the
segmentation unit.
386
PAGE N DX CPU OS
MEMORY
TASK 2
MEMORY
8086OS
TASK 1
EMPTY MEMORY
TASK
2 PAGE TABLE TASK 2
VIRTUAL MODE
8086 MEMORY
TASK PAGE DIRECTOR TASK
2
TASK 2
MEMORY
TASK 1
PAGE N
MEMORY
PAGE
1
AVAILABLE
8086OS
`
TASK 1
PAGE EMPTY MEMORY
DIRECTORY
ROOT TASK
1 PAGE 8086 OS
TABLE
VIRTUAL MODE MEMORY
8086 TASK PAGE DIRECTORY TASK
1
000000000 H