8086 Microprocessor
8086 Microprocessor
MEMORY ORGANIZATION
By using 20 address line 8086 can access 1 Mbyte memory
8086 can access four segment at a time
1 Code segment contain program 0000
0
2 Data segment contain data
2000
Code
0
3 Stack segment contain stack data
Seg
2FFF
4 Extra segment contain intermediate
F
400
result
00
Data
Each Segment have 64 Kbyte locations
Seg
Base address is given by respective
4FFFF
segment register
60000
Stack
Seg
Extra
Seg
FFFF
F
6FFFF
80000
8FFFF
Address generation
MP need to generate 20 bit address to access memory
if code segment = 2000
And Instruction Pointer = 0050
Then 20 bit address is generated as
Code seg X 16 (H) = 20000 - - Base address
IP
=
0050 - - Effective address
(Base add + Eff add) 20050 - - Physical address
Instruction is fetched from the location 20050
Total 1 Mbyte is divided into two blocks Odd block and Even block
Size of Even block is 512 Kbytes
It contain the locations with even address only
It is enabled by the address line A0
Data bus D0 to D7 is connected with even bank
Size of Odd block is 512 Kbytes
It contain the locations with odd address only
It is enabled by
signal
Data bus D8 to D15 is connected with odd bank
Address line A1 to A19 is connected with both the bank
First loc
Second loc
ODD Bank
512 Kb
Even Bank
512 Kb
C
S
C
S
BHE
D15
A1---
D0 D7
00000(
00002(
H)
H)
ODD Bank
512 Kb
Even Bank
512 Kb
C
S
C
S
BHE
D15
A1---
D0 D7
00001(
H)
00003(
H)
First loc
Second
loc
First loc
Second loc
Upper Bank
(ODD Bank)
512 Kb
Lower
Bank
(Even
Bank)
C
512 Kb
S
C
S
BHE
D15
D8
A19
00000(
H)
00002(
H)
A1--A19
A
0
D0 D7
A
0
0000
Execution
Unit
It get the instruction and data from bus interfacing unit(BIU) and
executes it.
It contains
1. Registers
2. Arithmetic and Logic unit
3. Control Unit
1.Registers
(I)General
Purpose registers
AX - the
Accumulator
BX - the Base
Register
- the used
Count
CX
Normally
for storing temporary results
Register
Each of the registers is 16 bits wide (AX, BX, CX, DX)
DX - the Data
Can be accessed as either 16 ( as AX,BX,CX,DX)or 8 bits (as
Register
AL,AH,BL,BH,CL,CH,DL,DH)
Each register have some special purpose
AX
Accumulator
Must be used in Multiplication and Division operations
Must be used in Input and Output operation
BX
CX
DX
Flag
Register
It is 16 bit register
But only 9 bits are used
Types
1. Conditional Flag
2. Control Flag
Overflow
Carry
Direction
Parity
Interrupt enable
Auxiliary Carry
Trap Zero
Conditional fag
It reflect the condition of result of the previous operation
Carry flag
It will be set when the carry is generated in the previous operation like
addition
While performing Subtraction it will act as the borrow flag
Parity Flag
It will set when the result contain even no of ones
Auxiliary Carry Flag
It will be set when the carry is generated from the bit D3 to D4 ,while
performing the
arithmetic operation
Zero Flag
It will be set when the result of the previous operation is zero
Sign Flag
It will be copy of the MSB of the result
Over Flow flag
It will be set when the carry is generated from Bit D14 to D15
It is useful when the signed number system is used
Control flag
Control flags are set or reset deliberately to control the operations of the
execution unit.
Trap Flag (TF):
It is used for single step control.
8086
LATC
H
BHE
W
R
D
D8-
8286
D15
TRANSCEIV
ER
DT/
R
DEN
MIN/M
X
D0-D7
VC
C
A1A19
A
0
R W CS
D R
Odd
Bank
512
Kb
RD W CS
Even
R
Bank
512
Kb
8282
STB
ALE
STB
8282
STB
8282
8286
8086
8286
REA
DY
RESE
T
CL
K
RDY1
RESE
T
READY
8284
X1
X2
PCLK
Status signal
8086 generate four status signals
S3 and S4 indicate which of the segment is
used
S S Segment3
0
0
1
1
4
0
1
0
1
Register
ES
SS
CS
DS
Control signals
BHE/S7 - BUS HIGH ENABLE/STATUS
BHE signal is multiplexed with Status signal S7
BHE signal is used to enable the Odd address bank
S7 become low in interrupt acknowledgement
cycle
M/IO (memory/Io)
it tells whether a memory or I/O transfer is
talking place.
Logic 1 signals a memory operation and logic
0
signals an I/O operation.
RD(Read):
READY
Interrupt Signals:
(INTR) Interrupt request
Used by an external device to get the MP
attention
Sampled during the last clock of each instruction
A subroutine address is available in interrupt
vector table
RESET:
Used to reset the MP
MP immediately terminate its present activity.
This signal is generated by 8284, when the
manual reset switch is closed
DMA Interface Signals:
HOLD
It is send by the DMA controller to request
address and data bus control
HLDA
When the MP relive the control of the busses , it
send HLDA signal to DMA controller
TEST:
This input is examined by the ``Wait'' instruction.
If the TEST input is LOW execution continues,
otherwise the processor waits in an Idle state.
INTAsignal
IORCsignal
IOWC, AIOWCsignal
Interrupt Acknowledgement
used as I/O Read control
used as I/O Write control
LOCK
Used in multiprocessor system
Used to lockout other processor from using common bus
The LOCK signal is activated by the ``LOCK'' prefix
instruction
QS0,QS1- Queue status
It specifies what operation is performed in Instruction queue
AL
E