8086 Microprocessor
8086 Microprocessor
Microprocessor
Microprocesso
r
Fourth Generation
During 1980s
Low power version of HMOS technology
(HCMOS)
Third Generation 32 bit processors
During 1978 Physical memory space 224 bytes = 16 Mb
HMOS technology Faster speed, Virtual memory space 240 bytes = 1 Tb
Higher Floating point hardware
packing density Supports increased number of addressing
16 bit processors 40/ 48/ 64 modes
pins
Easier to program Intel 80386
Dynamically relatable programs
Processor has multiply/ divide arithmetic
hardware Second Generation
More During 1973
powerful interrupt handling NMOS technology Faster speed, Higher
Intel 8086 (16 bit capabilities
processor) density, Compatible with TTL
Flexible I/O port 4 / 8/ 16 bit processors 40 pins
addressing Ability to address large memory spaces
First Generation
Between 1971 – 1973 and I/O ports
PMOS technology, non compatible with Greater number of levels of subroutine
TTL nesting
4 bit Better interrupt handling capabilities
processors 16 pins 3
3D/2u9e/2t0o1l6imitations of pins, signals are Sukant Beher a
8 and 16 bit
multiplexed I ntel 8085 (8 bit processor)
Microprocesso Functional blocks
r
Various conditions of the
Computational Unit;
results are stored as
performs arithmetic and Internal storage of data
status bits called flags in
logic operations
flag register
5
Pins and
signals
8086
Microprocessor Pins and Signals Common signals
AD0-AD15 (Bidirectional)
Address/Data bus
7
8086
Microprocessor Pins and Signals Common signals
MN/ MX
MINIMUM / MAXIMUM
TEST
READY
RESET (Input)
Pins 24 -31
Pins 24 -31
Segment
Registers
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.
EU decodes and
executes instructions.
A decoder in the EU
control system
translates instructions.
and
Some of the 16 bit registers can be
Index registers (Source 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
3/29/2016 SuCkaXntcaBnehbereaused
as CH and 27
CL DX can be used as DH and
8086
Microprocessor Architecture Execution Unit (EU)
Example:
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 the computation or comparison byte of the result contains even
is 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
8086 registers
categorized 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
into 4 groups OF DF IF TF SF ZF AF PF CF
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
9. Direct I/O port Addressing
Group III : Addressing modes for
10. Indirect I/O port Addressing I/O ports
8. String Addressing
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
8086
Microprocessor Addressing Modes : Memory Access
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.
9. Direct I/O port Addressing The square brackets around the 1354H denotes
the contents of the memory location. When
10. Indirect I/O port Addressing executed, this instruction will copy the contents of
11. Relative Addressing the memory location into BX register.
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.
8086 Group II : Addressing modes
Microprocessor Addressing Modes for memory data
(CX) (MA)
or,
(CL) (MA)
(CH) (MA +1)
8086 Group II : Addressing modes
Microprocessor Addressing Modes for memory data
50
(AH) (MA + 1)
8086 Group II : Addressing modes
Microprocessor Addressing Modes for memory data
(CL) (MA)
(CH) (MA + 1)
8086 Group II : Addressing modes
Microprocessor Addressing Modes for memory data
Content of AX is
moved to port
whose 54
8086 Group IV : Relative
Microprocessor Addressing Modes Addressing
mode
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
2. Arithmetic Instructions
3. Logical Instructions
addr8 AX
8086
Microprocessor Instruction Set
2. Arithmetic Instructions
Mnemonics: ADD, ADC, SUB, SBB, INC, DEC, MUL, DIV, CMP…
ADD A, data
2. Arithmetic Instructions
Mnemonics: ADD, ADC, SUB, SBB, INC, DEC, MUL, DIV, CMP…
ADDC A, data
2. Arithmetic Instructions
Mnemonics: ADD, ADC, SUB, SBB, INC, DEC, MUL, DIV, CMP…
SUB A, data
2. Arithmetic Instructions
Mnemonics: ADD, ADC, SUB, SBB, INC, DEC, MUL, DIV, CMP…
SBB A, data
2. Arithmetic Instructions
Mnemonics: ADD, ADC, SUB, SBB, INC, DEC, MUL, DIV, CMP…
2. Arithmetic Instructions
Mnemonics: ADD, ADC, SUB, SBB, INC, DEC, MUL, DIV, CMP…
2. Arithmetic Instructions
Mnemonics: ADD, ADC, SUB, SBB, INC, DEC, MUL, DIV, CMP…
2. Arithmetic Instructions
Mnemonics: ADD, ADC, SUB, SBB, INC, DEC, MUL, DIV, CMP…
2. Arithmetic Instructions
Mnemonics: ADD, ADC, SUB, SBB, INC, DEC, MUL, DIV, CMP…
2. Arithmetic Instructions
Mnemonics: ADD, ADC, SUB, SBB, INC, DEC, MUL, DIV, CMP…
2. Arithmetic Instructions
Mnemonics: ADD, ADC, SUB, SBB, INC, DEC, MUL, DIV, CMP…
CMP A, data
3. Logical Instructions
Mnemonics: AND, OR, XOR, TEST, SHR, SHL, RCR, RCL …
8086
Microprocessor Instruction Set
3. Logical Instructions
Mnemonics: AND, OR, XOR, TEST, SHR, SHL, RCR, RCL …
8086
Microprocessor Instruction Set
3. Logical Instructions
Mnemonics: AND, OR, XOR, TEST, SHR, SHL, RCR, RCL …
8086
Microprocessor Instruction Set
3. Logical Instructions
Mnemonics: AND, OR, XOR, TEST, SHR, SHL, RCR, RCL …
8086
Microprocessor Instruction Set
3. Logical Instructions
Mnemonics: AND, OR, XOR, TEST, SHR, SHL, RCR, RCL …
8086
Microprocessor Instruction Set
3. Logical Instructions
Mnemonics: AND, OR, XOR, TEST, SHR, SHL, RCR, RCL …
8086
Microprocessor Instruction Set
3. Logical Instructions
Mnemonics: AND, OR, XOR, TEST, SHR, SHL, RCR, RCL …
8086
Microprocessor Instruction Set
3. Logical Instructions
Mnemonics: AND, OR, XOR, TEST, SHR, SHL, RCR, RCL …
8086
Microprocessor Instruction Set
REP
MOVS
(MAE) (MA)
CMPS
LODS
STOS
CLC Clear CF 0
NOP No operation
Mnemonics Explanation
CALL reg/ mem/ disp16 Call subroutine
Checks flags
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
93
Assembler
directives
8086
Microprocessor Assemble Directives
Used to :
› specify the start and end of a program
› attach value to variables
› allocate storage locations to input/ output data
› define start and end of segments, procedures, macros etc..
95
8086
Microprocessor Assemble Directives
DB Define Byte
DB Define Word
PROC
FAR Example:
NEAR ALIST DW 6512H, 0F251H, 0CDE2H
ORG
END Segnam SEGMENT
EVEN
…
EQU … Program code
… or
PROC … Data Defining
… Statements
FAR …
NEAR
Segnam ENDS
ENDP
SHORT
ORG
User defined name of
END Segment Register
the segment
EVEN
EQU
PROC Example:
FAR
NEAR ASSUME CS: ACODE, DS:ADATA Tells the compiler that the
instructions of the program are
stored in the segment ACODE and
ENDP data are stored in the segment
SHORT ADATA
MACRO
EN3/D29 Sukant Behera 99
8086
Microprocessor Assemble Directives
ORG
Examples:
END
EVEN ORG 1000H Informs the assembler that the statements
EQU following ORG 1000H should be stored in
memory starting with effective address
1000H
PROC
FAR LOOP EQU 10FEH Value of variable LOOP is 10FEH
NEAR
_SDATA SEGMENT In this data segment, effective address of
ORG 1200H memory location assigned to A will be 1200H
ENDP A DB 4CH and that of B will be 1202H and 1203H.
EVEN
SHO B DW
1052H hera
RT _SDATA ENDS
100
Sukant Be
8086
Microprocessor Assemble Directives
General form
ASSUME
ORG
procname PROC[NEAR/ FAR]
END
EVEN …
… Program statements of the
EQU procedure
…
DB
Examples:
DW
RET
ORG ADD64 ENDP
END
EVEN
EQU CONVERT PROC FAR The subroutine/ procedure named CONVERT
is declared as FAR and so the assembler will
… code the CALL and RET instructions involved
PROC … in this procedure as far call and return
…
ENDP RET
FAR CONVERT ENDP
NEAR
SHO
MACRO
RT
EN3/D29 102
8086
Microprocessor Assemble Directives
PROC
ENDP
FAR
NEAR
SHORT
MACRO
EN3/D29 103
8086
Microprocessor Assemble Directives
PROC
MACRO
EN3/D29 104
Interfacing memory and i/o
ports
8086
Microprocessor Memory
Processor Memory
Registers inside a microcomputer
Store data and results temporarily
No speed disparity
Cost
8086 : 16-bit
Bank 0 : A0 = 0
Even addressed memory
bank
107
8086
Microprocessor Memory organization in 8086
109
8086
Microprocessor Interfacing SRAM and EPROM
110
8086
Microprocessor Interfacing SRAM and EPROM
111
8086
Microprocessor Interfacing SRAM and EPROM
112
8086
Microprocessor Interfacing SRAM and EPROM
Monitor Programs
Programing 8279 for keyboard scanning and display
refreshing
Initialization of stack
113
8086
Microprocessor Interfacing I/O and peripheral devices
I/O devices
For communication between microprocessor and
outside world
Ports / Buffer IC’s
Microprocessor I/ O devices
(interface circuitry)
Interrupt driven I/ O
I/O device interrupts the
processor and initiate data
transfer
Direct memory access
Data 114
bypassing
trSaunksafnethe microprocessor
trBieshearcahieved
8086
Microprocessor 8086 and 8088 comparison
The I/O ports or peripherals can be Only IN and OUT instructions can be
treated like memory locations and used for data transfer between I/O
so all instructions related to device and processor
memory can be used for data
transmission between I/O device
and processor
Data can be moved from any Data transfer takes place only
register to ports and vice versa between accumulator and ports
When memory mapping is used for Full memory space can be used for
I/O devices, full memory address addressing memory.
space cannot be used for
addressing memory. Suitable for systems which
require large memory capacity
Useful only for small systems
where memory requirement is less
For accessing the memory mapped For accessing the I/O mapped
devices, the processor executes devices, the processor executes I/O
memory read or write cycle. read or write cycle.
8086 8088
16-bit Data bus lines obtained by 8-bit Data bus lines obtained by
demultiplexing AD0 – AD15 demultiplexing AD0 – AD7
In MIN mode, pin 28 is assigned the In MIN mode, pin 28 is assigned the
signal M / 𝐈𝐎 signal IO / 𝐌
To access higher byte, 𝐁𝐇𝐄 signal is No such signal required, since the
used data width is only 1-byte
117