MPMC Unit I
MPMC Unit I
BIU (Bus Interface Unit) BIU takes care of all data and
addresses transfers on the buses for the EU like sending
addresses, fetching instructions from the memory, reading
data from the ports and the memory as well as writing data to
the ports and the memory. EU has no direction connection
with System Buses so this is possible with the BIU. EU and
BIU are connected with the Internal Bus.
8086 Architecture
Functional parts of 8086 microprocessors.
10
8086 Registers
General Purpose Index
AH AL
BP
AX
SP
BH BL
BX
SI
CH CL
DI
CX
DH DL
DX Segment
CS
Flags DS
IP ES
11
General Purpose Registers
AX - the Accumulator
BX - the Base Register
CX - the Count Register
DX - the Data Register
12
General Purpose Registers
•AX
–Accumulator Register
–Preferred register to use in arithmetic, logic and data
transfer instructions because it generates the shortest
Machine Language Code
–Must be used in multiplication and division operations
–Must also be used in I/O operations
•BX
–Base Register
–Also serves as an address register
13
General Purpose Registers
•CX
–Count register
–Used as a loop counter
–Used in shift and rotate operations
•DX
–Data register
–Used in multiplication and division
–Also used in I/O operations
14
Pointer and Index Registers
Overflow Carry
Direction Parity
EU registers AX AH AL Accumulator
BX BH BL Base Register
CX CH CL Count Register
DX DH DL Data Register
SP Stack Pointer
BP Base Pointer
SI Source Index Register
DI Destination Index Register
FLAGS
17
The Stack
18
The Stack
19
Physical Address Generation in 8086
The 20-bit physical address is generated by adding 16-bit contents of a
segment register with an 16-bit offset value (also called Effective Address)
which is stored in a corresponding default register (either in IP, BX, SI, DI,
BP or SP. Different segments have different default register for offset, for
example IP is default offset register for Code Segment)
BIU always appends 4 zeros automatically to the 16-bit address of a segment
register (to make it 20-bit) because it knows the starting address of a
segment always ends with 4 zeros
Adder
21
Physical Address Calculation
Memory address
Examples
CS 3 4 8 A 0 SS 5 0 0 0 0
IP + 4 2 1 4 SP + F F E 0
Instruction 3 8 A B 4 Stac 5 F F E 0
(code) k
addressDS 1 2 3 4 0 addr
ess
DI + 0 0 2 2
Data 1 2 3 6 2
addr
ess
Example of Physical Address
Generation for Code Segment Memory
Start of Code Segment
1 00000H
(348A0H) Data
Segment
IP = 4214H 3
4
Code Byte at 38AB4H
Code
Segment
Extra
Segment
7 1MB
8 Address
9
Range
CS 348A0H 10
11
IP + 4214 H 12
Physical Address 38AB4 H 13
14
15
Stack
Segment FFFFFH
Example of Physical Address Generation
for Data Segment
0H
05C00H
DS: 05C0
05C50H
SI 0050 DS:EA
Memory
05C0 0
Segment Register
Offset + 0050
0A00 0A000H
SS:
0A100H
SP 0100 SS:SP
Memory
0A00 0
Segment Register
Offset + 0100
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 Addressing register and immediate data
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
30
8086 Microprocessor Group I : Addressing modes for
Addressing Modes register and immediate 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 Addressing
Example:
4. Register Indirect Addressing
MOV DL, 08H
5. Based Addressing
The 8-bit data (08H) given in the instruction is
6. Indexed Addressing moved to DL
8. String Addressing
MOV AX, 0A9FH
9. Direct I/O port Addressing
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
31
8086 Microprocessor Group II : Addressing modes
Addressing Modes for memory data
1. Register Addressing
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.
32
8086 Microprocessor Group II : Addressing modes
Addressing Modes for memory data
(CL) (MA)
(CH) (MA +1)
33
8086 Microprocessor Group II : Addressing modes
Addressing Modes for memory data
(AL) (MA)
34
(AH) (MA + 1)
8086 Microprocessor Group II : Addressing modes
Addressing Modes for memory data
(CL) (MA)
(CH) (MA + 1)
35
8086 Microprocessor Group II : Addressing modes
Addressing Modes for memory data
36
8086 Microprocessor Group II : Addressing modes
Addressing Modes for memory data
1. Register Addressing
2. Immediate Addressing
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 zero.
10. Indirect I/O port Addressing
40
8086 - INSTRUCTION SET
8086 Microprocessor
Instruction Set
2. Arithmetic Instructions
3. Logical Instructions
42
8086 Microprocessor
Instruction Set
43
8086 Microprocessor
Instruction Set
44
8086 Microprocessor
Instruction Set
46
8086 Microprocessor
Instruction Set
2. Arithmetic Instructions
Mnemonics: ADD, ADC, SUB, SBB, INC, DEC, MUL, DIV, CMP…
ADD A, data
47
8086 Microprocessor
Instruction Set
2. Arithmetic Instructions
Mnemonics: ADD, ADC, SUB, SBB, INC, DEC, MUL, DIV, CMP…
ADDC A, data
48
8086 Microprocessor
Instruction Set
2. Arithmetic Instructions
Mnemonics: ADD, ADC, SUB, SBB, INC, DEC, MUL, DIV, CMP…
SUB A, data
49
8086 Microprocessor
Instruction Set
2. Arithmetic Instructions
Mnemonics: ADD, ADC, SUB, SBB, INC, DEC, MUL, DIV, CMP…
SBB A, data
50
8086 Microprocessor
Instruction Set
2. Arithmetic Instructions
Mnemonics: ADD, ADC, SUB, SBB, INC, DEC, MUL, DIV, CMP…
51
8086 Microprocessor
Instruction Set
2. Arithmetic Instructions
Mnemonics: ADD, ADC, SUB, SBB, INC, DEC, MUL, DIV, CMP…
52
8086 Microprocessor
Instruction Set
2. Arithmetic Instructions
Mnemonics: ADD, ADC, SUB, SBB, INC, DEC, MUL, DIV, CMP…
53
8086 Microprocessor
Instruction Set
2. Arithmetic Instructions
Mnemonics: ADD, ADC, SUB, SBB, INC, DEC, MUL, DIV, CMP…
54
8086 Microprocessor
Instruction Set
2. Arithmetic Instructions
Mnemonics: ADD, ADC, SUB, SBB, INC, DEC, MUL, DIV, CMP…
55
8086 Microprocessor
Instruction Set
2. Arithmetic Instructions
Mnemonics: ADD, ADC, SUB, SBB, INC, DEC, MUL, DIV, CMP…
56
8086 Microprocessor
Instruction Set
2. Arithmetic Instructions
Mnemonics: ADD, ADC, SUB, SBB, INC, DEC, MUL, DIV, CMP…
CMP A, data
57
8086 Microprocessor
Instruction Set
3. Logical Instructions
Mnemonics: AND, OR, XOR, TEST, SHR, SHL, RCR, RCL …
58
8086 Microprocessor
Instruction Set
3. Logical Instructions
Mnemonics: AND, OR, XOR, TEST, SHR, SHL, RCR, RCL …
59
8086 Microprocessor
Instruction Set
3. Logical Instructions
Mnemonics: AND, OR, XOR, TEST, SHR, SHL, RCR, RCL …
60
8086 Microprocessor
Instruction Set
3. Logical Instructions
Mnemonics: AND, OR, XOR, TEST, SHR, SHL, RCR, RCL …
61
8086 Microprocessor
Instruction Set
3. Logical Instructions
Mnemonics: AND, OR, XOR, TEST, SHR, SHL, RCR, RCL …
62
8086 Microprocessor
Instruction Set
3. Logical Instructions
Mnemonics: AND, OR, XOR, TEST, SHR, SHL, RCR, RCL …
63
8086 Microprocessor
Instruction Set
3. Logical Instructions
Mnemonics: AND, OR, XOR, TEST, SHR, SHL, RCR, RCL …
64
8086 Microprocessor
Instruction Set
3. Logical Instructions
Mnemonics: AND, OR, XOR, TEST, SHR, SHL, RCR, RCL …
65
8086 Microprocessor
Instruction Set
66
8086 Microprocessor
Instruction Set
REP
67
8086 Microprocessor
Instruction Set
MOVS
(MAE) (MA)
68
8086 Microprocessor
Instruction Set
CMPS
69
8086 Microprocessor
Instruction Set
LODS
71
8086 Microprocessor
Instruction Set
STOS
72
8086 Microprocessor
Instruction Set
CLC Clear CF 0
NOP No operation
Mnemonics Explanation
CALL reg/ mem/ disp16 Call subroutine
74
8086 Microprocessor
Instruction Set
Checks flags
75
8086 Microprocessor
Instruction Set
Mnemonics Explanation
JC disp8 Jump if CF = 1
JP disp8 Jump if PF = 1
JO disp8 Jump if OF = 1
JS disp8 Jump if SF = 1
77
8087 ARCHITECTURE
The numeric Extension Unit handles all the numeric processor instructions like arithmetic,
logical, transcendental, and data transfer instructions. It has 8 register stack, which holds the
operands for instructions and their results.
8086 PROGRAMS
Addition of two 16 bit data