Documente Academic
Documente Profesional
Documente Cultură
❖ “Microprocessor” is a
➢Clock driven ➢Register based
➢Multipurpose ➢Programmable
•Electronic semiconductor device.
BHE/S7
A16/S3 – A19/S6
AD0 – AD15
INTA
DT/R
DEN
ALE
RQ/GT0 - RQ/GT1
TEST LOCK
INTR
NMI M/IO
HOLD QS0,QS1
HLDA S2, S1, S0
VCC
CLK
RESET READY MN/MX 2 - Gnd RD WR
PIN Description
8086 is a 40 pin DIP
using MOS technology.
It has 2 GND’s as circuit
complexity demands a
large amount of current
0 1
flowing through the
circuits, and multiple
grounds help in
dissipating the
accumulated heat etc.
8086 works on two
modes of operation
namely, Maximum
Mode and Minimum
Mode.
Power Connections
❖ Pin Description:
GND 1 40 VCC
➢ GND – Pin no. 1, 20
• Ground
➢ CLK – Pin no. 19 – Type I 8086
• Clock: provides the
CLK 19
basic timing for the
processor and bus GND 20
controller. It is
asymmetric with a 33%
duty cycle to provide
optimized internal
timing.
➢ VCC – Pin no. 40
• VCC: +5V power
supply pin
Address/ Data Lines
AD14 2
39 AD15
AD13 3
AD12 4
AD11 5
AD10 6
AD9 7
AD8 8 8086
AD7 9
AD6 10
AD5 11
AD4 12
AD3 13
AD2 14
AD1 15
AD0 16
Address Lines
A14 2 39 A15
A13 3
A12 4
38 A 16
A11 5
A10 6
37 A 17
A9 7
A8 8 8086
A7 9 36 A 18
A6 10
A5 11 35 A 19
A4 12
A3 13
A2 14
A1 15
A0 16
Segments
Segment Starting address is
segment register value MEMORY Address
shifted 4 place to the left. 000000H
CODE
64K Data
Segment
STACK
DATA
EXTRA CS:0
64K Code
Segment
Segment
Registers
1/2002 JNM 14
Physical Address generation
000000H
4000H
CS: 0400H
4056H
IP 0056H CS:IP = 400:56
Logical Address
Left-shift 4 bits
Memory
0400 0
Segment Register
Offset + 0056
0FFFFFH
Physical or 04056H
Absolute Address
➢ The offset is the distance in bytes from the start of the segment.
➢ The offset is given by the IP - Code Segment. SP - Stack Segment, EA – Data/Extra Seg.
➢ Instructions are always fetched with using the CS register.
➢ The physical address is also called the absolute address
S4 S3 Address status
0 0 Alternate(relative to ES segment)
38 S3
37 S4
36 S5
35 S6
34 S7
8086
28 S2 (M/I O )
27 S1 (DT / R )
S 0 ( DEN)
26
❖ These signals float to 3-state OFF in “hold
acknowledge”. These status lines are encoded as
shown.
Characteristics
0(LOW) 0 0 Interrupt acknowledge
0 0 1 Read I/O Port
0 1 0 Write I/O Port
0 1 1 Halt
1(HIGH) 0 0 Code Access
1 0 1 Read Memory
1 1 0 Write Memory
1 1 1 Passive
S5 ----- Value of Interrupt Enable flag
8086
NMI 17
INTR 18
33 VCC MN/ MX
31 HOLD
30 HLDA
29 WR
28 M/I O
8086
27 DT/ R
26 DEN
25 ALE
24 INTA
Max mode signals
33 GND
31 RQ/ GT0
30 RQ/ GT1
29 LOCK
28 S2
8086
27 S1
26 S0
25 QS0
24 QS1
QS1 QS0 Characteristics
0(LOW) 0 No operation
Flags Cleared
Instruction Pointer 0000H
CS FFFFH
DS, SS and ES 0000H
Queue Empty
❖ BHE/S7- Pin No. 34 – Type O
➢ Bus High Enable / Status: During T1 the Bus High Enable signal
(BHE*) should be used to enable data onto the most significant
half of the data bus, pins D15-D8. Eight bit oriented devices tied
to the upper half of the bus would normally use BHE* to
condition chip select functions. BHE* is LOW during T1 for read,
write, and interrupt acknowledge cycles when a byte is to be
transferred on the high portion of the bus. The S,7 status
information is available during T2, T3 and T4. The signal is
active LOW and floats to 3-state OFF in “hold”. It is LOW during
T1 for the first interrupt acknowledge cycle.
BHE* A0 Characteristics
0 0 Whole word
0 1 Upper byte from / to odd address
1 0 Lower byte from / to even address
1 1 None
Flag Register
❖ The EU also contains the Flag Register which is a collection of
condition bits and control bits. The condition bits are set or
cleared by the execution of an instruction. The control bits are set
by instructions to control some operation of the CPU.
• Bit 0 - CF Carry Flag - Set by carry out of msb
• Bit 2 - PF Parity Flag - Set if result has even parity
• Bit 4 - AF Auxiliary Flag - for BCD arithmetic
• Bit 6 - ZF Zero Flag - Set if result is zero
• Bit 7 - SF Sign Flag = MSB of result
• Bit 8 - TF Single Step Trap Flag
• Bit 9 - IF Interrupt Enable Flag
• Bit 10 - DF String Instruction Direction Flag
• Bit 11 - OF Overflow Flag
• Bits 1, 3, 5, 12-15 are undefined.
➢General Purpose
• MOV,PUSH,POP,XCHG,XLAT
➢Address Object
• LEA,LDS,LES
➢Input/Output
• IN,OUT
➢Flag Transfer
• LAHF,SAHF,PUSHF,POPF
Arithmetic Instructions
➢Addition
• ADD,ADC,INC,AAA,DAA
➢Subtraction
• SUB,SBB,DEC,NEG,CMP,AAS,DAS
➢Multiplication
• MUL,IMUL,AAM
➢Division
• DIV,IDIV,AAD,CBW,CWD
Bit Manipulation Instruction
➢Logical
• NOT,AND,OR,XOR,TEST
➢Shifts
• SHL/SAL,SHR,SAR
➢Rotate
• ROL,ROR,RCL,RCR
❖String Instructions
• REP,REPE/REPZ,REPNE/REPNZ,MOVS,MOVSB/
MOVSW,CMPS,SCAS,LODS,STOS
❖ Processor Control Instructions
➢Flag operation
• STC,CLC,CMC,STD,CLD,STI,CLI
➢External Synchronization
• HLT,WAIT,ESC,LOCK
➢No operation
• NOP
Program Execution Transfer
Instructions
❖ There are two main type of execution transfer
instructions i) Intra-segment ii)
Inter-segment
➢ Intra-Segment :In this the execution transfer is within the
segment and only the effective address changes.
➢ Inter-segment : In this case execution transfer is out of current
segment and new segment base and effective address related to
it is used for address generation.
❖ In case of Program Execution Transfer with the
execution of Opcode, the instruction queue in BIU is
flushed by EU and new queue is generated from new IP
address.
❖ If it is 8 – bit jump then termed as ‘short jump’ if 16 – bit
the ‘near jump’ within the segment.
❖ If jump is out of the segment then it is called ‘far jump’
➢Unconditional
• CALL,RET,JMP
➢Conditional
➢Iteration Control
• LOOP,LOOPE/LOOPZ,LOOPNE/LOOPNZ,JCXZ
➢Interrupt
• INT,INT0,IRET
Comparison of 8086 and 8088
1. In 8088 we have A15-8, instead of AD15-8 of
8086. this is because, the 8088 can
communicate with the outside world using
only 8 bits o data. However, the registers in
8088 and 8086 are same, and the instruction set
is also the same. So, for word operations, the
8088 has to access information twice. Thus the
execution time is increased in the case of 8088.
Continued…
2. In 8086 pin 28 is assigned for the signal M/IO* in the
minimum mode. But in 8088, this pin is assigned to the
signal IO/M* in the minimum mode. This change has been
done in 8088 so that the signal is compatible with 8085 bus
structure.
3. The instruction queue length in the case of 8086 is 6 bytes.
The BIU in 8088 needs more time to fill up the queue a
byte at a time. Thus to prevent overuse of the bus by the
BIU, the instruction queue in 8088 is shortened to 4 bytes.
4. To optimize the working of the queue, the 8086 BIU will
fetch a word into the queue whenever there is a space for
a word in the queue. The 8088 BIU will fetch a byte into
the queue whenever there is space for a byte in the queue.
Continued…
5. Pin number 34 of 8086 is BHE*/S7. BHE* is
irrelevant for 8088, which can only access 8 bits
at a time. Thus pin 34 o 8088 is assigned for the
signal SSO*. This pin acts like SO* status line in
the minimum mode of operation. So, in the
minimum mode, DT/R*, IO/M*, and SSO*
provide the complete bus status as shown.
Continued…
IO/M* DT/R* SSO* Bus Cycle
1 0 0 Interrupt acknowledge
1 0 1 Read I/O port
1 1 0 Write I/O port
1 1 1 Halt
0 0 0 Code Access
0 0 1 Read Memory
0 1 0 Write Memory
0 1 1 Passive
Continued…
6. In the maximum mode for 8088 the SSO* (pin 34) signal is
always a 1. In the maximum mode for 8086, the BHE*/S7
(pin 34) will provide BHE* information during the first clock
cycle, and will be 0 during subsequent clock cycles. In
maximum mode, 8087 will monitor this pin to identify the
CPU as a 8088 or a 8086, and accordingly sets its own queue
length to 4 or 6 bytes.