Unit - 2
Unit - 2
Microprocess
or
Case Study: Intel
Slide 2
Processors
Micropro
Fifth Generation Pentium
ce Fourth Generation
During 1980s
Low power version of HMOS technology
4
8086
Microprocessor Pins and Common signals
Signals
AD0-AD15 (Bidirectional)
Address/Data bus
MN/ MX
MINIMUM / MAXIMUM
6
8086
Microprocessor Pins and Common signals
Signals
TEST
hardware.
CLK
9
8086
Microprocessor Pins and Minimum mode signals
Signals
Pins 24 -31
DT/𝐑ഥ
(Data Transmit/ Receive) Output signal from the
processor to control the direction of data flow
through the data transceivers
𝐃𝐄
𝐍
(Data Enable) Output signal from the processor
used as out put enable for the transceivers
𝐈𝐎
M/ Used to differentiate memory access and I/O
access. For memory reference instructions, it
is
𝐖
high. For IN and OUT instructions, it is low.
𝐑
Write control signal; asserted low Whenever
processor writes data to memory or I/O port
𝐈𝐍𝐓
𝐀
(Interrupt Acknowledge) When the interrupt
request is accepted by the processor, the output
is
low on this line.
10
8086
Microprocessor Pins and Minimum mode signals
Signals
Pins 24 -31
11
8086
Microprocessor Pins and Maximum mode signals
Signals
During maximum mode operation, the MN/ 𝐌𝐗
is grounded (logic low)
𝑺𝟎,
𝑺𝟏 , 𝑺𝟐
Status signals; used by the 8086 bus controller to
generate bus timing and control signals. These
are decoded as shown.
12
8086
Microprocessor Pins and Maximum mode signals
Signals
During maximum mode operation, the MN/ 𝐌𝐗
is grounded (logic low)
𝑸𝑺𝟎,
𝑸𝑺𝟏
(Queue Status) The processor provides the status
of queue in these lines.
13
8086
Microprocessor Pins and Maximum mode signals
Signals
During maximum mode operation, the MN/ 𝐌𝐗
is grounded (logic low)
𝐑𝐐/𝐆𝐓𝟎,
𝐑𝐐/𝐆𝐓𝟏
(Bus Request/ Bus Grant) These requests are used
by other local bus masters to force the processor
to release the local bus at the end of the
processor’s current bus cycle.
𝐋𝐎𝐂
𝐊
An output signal activated by the LOCK prefix
instruction.
14
8086
Architectur
e Microprocessor
15
8086
Microprocessor Architectur
e
into 4 groups OF DF IF TF SF ZF AF PF CF
CX Count Register Used to hold the count value in SHIFT, ROTATE and
LOOP instructions
Segment
Registers
20
8086
Architectur Bus Interface Unit (BIU)
Microprocessor
e
21
8086
Architectur Bus Interface Unit (BIU)
Microprocessor
e
22
8086
Architectur Bus Interface Unit (BIU)
Microprocessor
e
23
8086
Architectur Bus Interface Unit (BIU)
Microprocessor
e
24
8086
Architectur Bus Interface Unit (BIU)
Microprocessor
e
25
8086
Architectur Bus Interface Unit (BIU)
Microprocessor
e
Instruction queue
A group of First-In-First-
Out (FIFO) in which up to
6 bytes of instruction
code are pre fetched
from the memory ahead
of time.
26
8086
Architectur Execution Unit (EU)
Microprocessor
e
EU decodes and
executes instructions.
A decoder in the EU
control system
translates
instructions.
and
Some of the 16 bit registers can
Index registers (Source be used as two 8 bit registers as
Index, Destination Index) :
each of 16-bits AX can be used as AH and AL
BX can be used as BH and BL
CX can be used as CH and CL 27
DX can be used as DH and
8086
Architectur Execution Unit (EU)
Microprocessor
e
28
8086
Architectur Execution Unit (EU)
Microprocessor
e
29
8086
Architectur Execution Unit (EU)
Microprocessor
e
Example:
30
8086
Architectur Execution Unit (EU)
Microprocessor
e
31
8086
Architectur Execution Unit (EU)
Microprocessor
e
32
8086
Architectur Execution Unit (EU)
Microprocessor
e
33
8086
Architectur Execution Unit (EU)
Microprocessor
e
34
8086
Architectur Execution Unit (EU)
Microprocessor
eAuxiliary Carry Flag
Carry Flag
Flag This is set, if there is a carry
This flag is set, when
from the lowest nibble, i.e, bit
Register three during addition, or there is a carry out of
borrow for the lowest nibble, MSB in case of
i.e, bit three, during addition or a borrow
subtraction. in case of subtraction.
Sign Flag Zero Parity Flag
Flag
This flag is set, when the This flag is set, if the result of This flag is set to 1, if the lower
result of any computation is the computation or comparison byte of the result contains even
negative performed by an instruction is number of 1’s ; for odd number of
zero 1’s set to zero.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
OF DF IF TF SF ZF AF PF CF
Tarp Flag
Over flow Flag If this flag is set, the
This flag is set, if an overflow occurs, i.e, if the result of a signed processor enters the
operation is large enough to accommodate in a destination
single step execution
register. The result is of more than 7-bits in size in case of 8-bit
signed operation and more than 15-bits in size in case of 16-bit mode by generating
sign operations, then the overflow will be set. internal interrupts
after the execution of
Direction Interrupt Flag
each instruction
Flag
This is used by string manipulation instructions. If this flag bit
is ‘0’, the string is processed beginning from the lowest Causes the 8086 to recognize
address to the highest address, i.e., auto incrementing mode. external mask interrupts; clearing IF
Otherwise, the string is processed from the highest address disables these interrupts.
towards the lowest address, i.e., auto incrementing mode. 35
ADDRESSING
MODES
& Instruction set
8086
Microprocessor Introduction
Program
A set of instructions written to solve
a problem.
Instruction
Directions which a microprocessor
follows to execute a task or part of a
task.
Computer language
1. Register
Addressing
Group I : Addressing modes for
2. Immediate register and immediate data
Addressing
3. Direct Addressing
5. Based Addressing
Group II : Addressing modes for
6. Indexed Addressing
memory data
7. Based Index Addressing
8. String Addressing
8. String Addressing
41
8086 Group I : Addressing modes for
Microprocessor Addressing register and immediate
Modes data
1. Register
Addressing In immediate addressing mode, an 8-bit or 16-bit
2. Immediate Addressing data is specified as part of the instruction
3. Direct
Example:
Addressing
4. Register Indirect Addressing
MOV DL,
5. Based 08H
Addressing The 8-bit data (08H) given in the instruction is
6. Indexed Addressing moved to DL
8. String
Addressing MOV AX,
9. Direct I/O port Addressing 0A9FH
The 16-bit data (0A9FH) given in the instruction is
10. Indirect I/O port Addressing
moved to AX register
11. Relative Addressing
(AX) 0A9FH
12. Implied Addressing
42
8086
Microprocessor Addressing Modes : Memory
Access
20 Address lines 8086 can address up to
2 = 1M bytes of memory
20
2. Immediate Addressing
Here, the effective address of the memory
3. Direct
Addressing location at which the data operand is stored is
4. Register Indirect Addressing given in the instruction.
12. Implied Addressing This addressing mode is called direct because the
displacement of the operand from the segment
base is specified directly in the instruction.
46
Group II : Addressing modes
8086
Addressing Modes
for memory data
Microprocessor
(CL) (MA)
(CH) (MA +1) 47
8086 Group II : Addressing modes
Microprocessor Addressing for memory data
Modes
1. Register In Based Addressing, BX or BP is used to hold the
Addressing base value for effective address and a signed 8-
2. Immediate Addressing or unsigned 16-bit displacement will be specified
bit
in the instruction.
3. Direct
Addressing In case of 8-bit displacement, it is sign extended
4. Register Indirect Addressing to 16-bit before adding to the base value.
(AL) (MA)
48
(AH) (MA + 1)
8086 Group II : Addressing modes
Microprocessor Addressing for memory data
Modes
1. Register SI or DI register is used to hold an index value for
Addressing memory data and a signed 8-bit or unsigned 16-
2. Immediate Addressing bit displacement will be specified in the
instruction.
3. Direct
Addressing Displacement is added to the index value in SI or
4. Register Indirect Addressing DI register to obtain the EA.
(CL) (MA)
(CH) (MA + 1)
49
8086 Group II : Addressing modes
Microprocessor Addressing for memory data
Modes
1. Register In Based Index Addressing, the effective address
Addressing is computed from the sum of a base register (BX
2. Immediate Addressing or BP), an index register (SI or DI) and a
displacement.
3. Direct
Addressing Example:
4.Register Indirect
Addressing
MOV DX, [BX + SI + 0AH]
5.Based Addressing
Operations
6. Indexed Addressing
:
000AH 0AH (Sign extended)
7. Based Index Addressing
50
8086 Group II : Addressing modes
Microprocessor Addressing for memory data
Modes
1. Register Employed in string operations to operate on
Addressing string data.
2. Immediate Addressing
The effective address (EA) of source data is
3. Direct stored in SI register and the EA of destination is
Addressing stored in DI register.
4. Register Indirect Addressing
Segment register for calculating base address of
5. Based source data is DS and that of the destination data
Addressing is ES
6. Indexed Addressing
1. Register Addressing
2. Immediate Addressing
If ZF = 0, then
next instruction of
the program is executed. 53
8086 Group IV : Implied
Microprocessor Addressing Addressing
Modes mode
1. Register Addressing
2. Immediate Addressing
3. Direct Addressing
5. Based Addressing
6. Indexed Addressing
Instructions using this mode have no operands.
The instruction itself will specify the data to be
7. Based Index Addressing
operated by the instruction.
8. String
Addressing Example: CLC
9. Direct I/O port Addressing
This clears the carry flag to
10. Indirect I/O port Addressing zero.
11. Relative
Addressing
54
INSTRUCTION
SET
8086
Microprocessor Instruction Set
2.Arithmetic Instructions
3.Logical Instructions
56
8086
Microprocessor Instruction Set
57
8086
Microprocessor Instruction Set
58
8086
Microprocessor Instruction Set
60
8086
Microprocessor Instruction Set
2. Arithmetic Instructions
ADD, ADC, SUB, SBB, INC, DEC,
Mnemonics:
MUL, DIV, CMP…
ADD reg2/ mem, reg1/mem
ADC reg2, reg1 ADC reg2, mem ADC(reg2) (reg1) + (reg2) (reg2) (reg2) +
mem, reg1 (mem)
(mem) (mem)+(reg1)
ADD A, data
61
8086
Microprocessor Instruction Set
2. Arithmetic Instructions
ADD, ADC, SUB, SBB, INC, DEC,
Mnemonics:
MUL, DIV, CMP…
ADC reg2/ mem, reg1/mem
ADC reg2, reg1 ADC reg2, mem ADC(reg2) (reg1) + (reg2)+CF (reg2) (reg2)
mem, reg1 + (mem)+CF (mem) (mem)+(reg1)+CF
ADDC A, data
62
8086
Microprocessor Instruction Set
2. Arithmetic Instructions
ADD, ADC, SUB, SBB, INC, DEC,
Mnemonics:
MUL, DIV, CMP…
SUB reg2/ mem, reg1/mem
SUB A, data
63
8086
Microprocessor Instruction Set
2. Arithmetic Instructions
ADD, ADC, SUB, SBB, INC, DEC,
Mnemonics:
MUL, DIV, CMP…
SBB reg2/ mem, reg1/mem
SBB A, data
64
8086
Microprocessor Instruction Set
2. Arithmetic Instructions
ADD, ADC, SUB, SBB, INC, DEC,
Mnemonics:
MUL, DIV, CMP…
INC reg/ mem
INC reg8 INC reg16 INC mem (reg8) (reg8) + 1 (reg16) (reg16) + 1
(mem) (mem) + 1
DEC reg8 DEC reg16 DEC mem (reg8) (reg8) - 1 (reg16) (reg16) - 1
(mem) (mem) - 1
65
8086
Microprocessor Instruction Set
2. Arithmetic Instructions
ADD, ADC, SUB, SBB, INC, DEC,
Mnemonics:
MUL, DIV, CMP…
MUL reg/ mem
66
8086
Microprocessor Instruction Set
2. Arithmetic Instructions
ADD, ADC, SUB, SBB, INC, DEC,
Mnemonics:
MUL, DIV, CMP…
DIV reg/ mem
67
8086
Microprocessor Instruction Set
2. Arithmetic Instructions
ADD, ADC, SUB, SBB, INC, DEC,
Mnemonics:
MUL, DIV, CMP…
IDIV reg/ mem
68
8086
Microprocessor Instruction Set
2. Arithmetic Instructions
ADD, ADC, SUB, SBB, INC, DEC,
Mnemonics:
MUL, DIV, CMP…
CMP reg2/mem, reg1/ mem
69
8086
Microprocessor Instruction Set
2. Arithmetic Instructions
ADD, ADC, SUB, SBB, INC, DEC,
Mnemonics:
MUL, DIV, CMP…
CMP reg/mem, data
70
8086
Microprocessor Instruction Set
2. Arithmetic Instructions
ADD, ADC, SUB, SBB, INC, DEC,
Mnemonics:
MUL, DIV, CMP…
CMP A, data
71
8086
Microprocessor Instruction Set
3. Logical Instructions
AND, OR, XOR, TEST, SHR,
Mnemonics:
SHL, RCR, RCL …
72
8086
Microprocessor Instruction Set
3. Logical Instructions
AND, OR, XOR, TEST, SHR,
Mnemonics:
SHL, RCR, RCL …
73
8086
Microprocessor Instruction Set
3. Logical Instructions
AND, OR, XOR, TEST, SHR,
Mnemonics:
SHL, RCR, RCL …
74
8086
Microprocessor Instruction Set
3. Logical Instructions
AND, OR, XOR, TEST, SHR,
Mnemonics:
SHL, RCR, RCL …
75
8086
Microprocessor Instruction Set
3. Logical Instructions
AND, OR, XOR, TEST, SHR,
Mnemonics:
SHL, RCR, RCL …
76
8086
Microprocessor Instruction Set
3. Logical Instructions
AND, OR, XOR, TEST, SHR,
Mnemonics:
SHL, RCR, RCL …
77
8086
Microprocessor Instruction Set
3. Logical Instructions
AND, OR, XOR, TEST, SHR,
Mnemonics:
SHL, RCR, RCL …
78
8086
Microprocessor Instruction Set
3. Logical Instructions
AND, OR, XOR, TEST, SHR,
Mnemonics:
SHL, RCR, RCL …
79
8086
Microprocessor Instruction Set
4. String Manipulation
Instructions
String Sequence of bytes or words
:
8086 instruction set includes instruction string movement, comparison,
scan,
for load and store.
80
8086
Microprocessor Instruction Set
REP
81
8086
Microprocessor Instruction Set
MOVS
(MAE) (MA)
CMPS
LODS
85
8086
Microprocessor Instruction Set
STOS
86
8086
Microprocessor Instruction Set
CLC Clear CF 0
NOP No operation
Mnemonics Explanation
CALL reg/ mem/ disp16 Call subroutine
88
8086
Microprocessor Instruction Set
Checks flags
89
8086
Microprocessor Instruction Set
JC disp8 Jump if CF = 1
JP disp8 Jump if PF = 1
JO disp8 Jump if OF = 1
JS disp8 Jump if SF = 1
91