Professional Documents
Culture Documents
8085 Architecture
8085 Architecture
(BEC-32)
1
Syllabus
Unit-I
Introduction to Microprocessors: Evolution of Microprocessors, Microprocessor
Architecture and its operations, Memory devices, I/O Devices, 8-bit
Microprocessor (8085): Introduction, Signal Description, Register Organization,
Architecture, Basic Interfacing Concepts for Memory and I/O Devices
Unit-II
8085 Assembly Language Programming: Instruction Classification, Instruction
Format, Addressing Modes, 8085 Instructions: Data Transfer operations,
Arithmetic operations, Logic Operations, Branch operation, Flow Chart, Writing
assembly language programs, Programming techniques: looping, counting and
indexing.
Unit-III
16-bit Microprocessors (8086/8088): Architecture, Physical address segmentation,
memory organization, Bus cycle, Addressing modes, difference between 8086 and
8088, Introduction to 80186 and 80286, Assembly Language Programming of
8086/8088.
2
Unit-IV
Data Transfer Schemes: Introduction, Types of transmission, 8257 (DMA), 8255
(PPI), Serial Data transfer (USART 8251), Keyboard-display controller (8279),
Programmable Interrupt Controller (8259), Programmable Interval Timer/ Counter
(8253/8254): Introduction, modes, Interfacing of 8253, applications, ADC and DAC
4. Y.C. Liu and G.A. Gibson: Microcomputer Systems: The 8086/8088 Family:
Architecture, Programming and Design, PHI 2nd Edition
3
EXPERIMENTS
5. To find the largest and smallest number in an array of data using 8085
instruction set.
10. To interface 8255 with 8085 and verify the operation of 8255 in
different modes.
11. To interface 8259 with 8085 and verify the operation of 8259.
5
What is Microprocessor?
Microprocessors is a programmable logic
device, designed with registers, flip-flop and
timing elements to perform arithmetic and
logical operation according to given
instructions.
6
Microprocessor based System
Architecture
7
Processor System Architecture
The typical processor system consists of:
▪ CPU (central processing unit)
▪ ALU (arithmetic-logic unit)
▪ Control Logic
▪ Registers, etc…
▪ Memory
▪ Input / Output interfaces
Interconnections between these units:
▪ Address Bus
▪ Data Bus
▪ Control Bus
8
Evolution of Microprocessors
9
Introduction to 8085
It was introduced in 1977.
It is 8-bit microprocessor.
Its actual name is 8085 A.
It is single NMOS device.
It contains 6200 transistors
approx.
Its dimensions are
164 mm x 222 mm.
It is having 40 pins Dual-
Inline-Package (DIP).
10
Introduction to 8085
It has three advanced
versions:
◦ 8085 AH
◦ 8085 AH2
◦ 8085 AH1
These advanced
versions are designed
using HMOS
technology.
11
Salient Features of 8085
1. It is 8-bit microprocessor.
2. It has 16-bit address bus and hence can address up to 216 = 65536
bytes (64KB) memory locations through A0-A15.
3. The first 8 lines of address bus and 8 lines of data bus are
multiplexed AD0 – AD7.
4. Data bus is a group of 8 lines D0 – D7.
5. It supports 5 hardware interrupt and 8 software interrupt.
6. A 16-bit program counter (PC)
7. A 16-bit stack pointer (SP)
8. Six 8-bit general purpose registers( B, C, D, E, H and L)
9. Also arranged in pairs( BC,DE, HL) for 16-bit operands.
10. It requires a signal +5V power supply
11. Maximum Clock Frequency is 3MHz and Minimum Clock
Frequency is 500kHz
12
The 8085 Bus Structure
Address Bus
▪ Consists of 16 address lines: A0 – A15
13
The 8085 Bus Structure
Data Bus
▪ Consists of 8 data lines: D0 – D7
▪ Operates in bidirectional mode: The data bits are
sent from the MPU to peripheral devices, as well
as from the peripheral devices to the MPU.
Control Bus
▪ Consists of various lines carrying the control
signals such as read / write enable, flag bits.
14
8085 Microprocessor Architecture
15
The 8085: CPU Internal Structure
16
The 8085: Registers
17
The 8085: CPU Internal Structure
Registers
▪ Six general purpose 8-bit registers: B, C, D, E, H, L
20
The 8085: CPU Internal Structure
21
Example: Memory Read Operation
22
Cycles and States
– T- State: One subdivision of an operation. A T-
state lasts for one clock period.
• An instruction’s execution length is usually
measured in a number of T-states. (clock
cycles).
– Machine Cycle: The time required to complete one
operation of accessing memory, I/O, or
acknowledging an external request.
• This cycle may consist of 3 to 6 T-states.
– Instruction Cycle: The time required to complete
the execution of an instruction.
• In the 8085, an instruction cycle may consist of 1
to 6 machine cycles.
23
• The 8085 executes several types of instructions
with each requiring a different number of
operations of different types. However, the
operations can be grouped into a small set.
• The three main types are:
• Memory Read and Write.
• I/O Read and Write.
• Request Acknowledge.
25
Example: Instruction Fetch Operation
26
Example: Instruction Fetch Operation
27
Timing Diagram
Opcode Fetch Cycle
T1 T2 T3 T4
CLX
A15
20H High-Order Memory Address Unspecified
A8
Low-Order
AD7
05H 4FH Opcode
AD0
Memory Address
ALE
RD
28
Demultiplexing the Bus AD0-AD7
29
Schematic of Latching Low Order
Address Bus
A15 A15
8085
Microprocessor
A8
A8
ALE
Enable
AD7 G
D Q A7
AD0 74LS373
A0
D7
D0
30
Schematic to generate Control Signals
74LS32
IO/M
MEMR
RD
8085
WR MEMW
IOR
74LS04
IOW
31
Timing for Execution of the
Instruction MVI A,32H
M1 Opcode Fetch M2 Memory Read
T1 T2 T3 T4 T1 T2 T3
CLX
A15
20H High-Order Memory Address Unspecified 20H High- Order Memory Address
A8
AD7
00H 3EH Opcode 01H 32H Data
AD0
Low-Order Memory Address Memory Address
ALE
IO/M
Status IO/M = 0, S0 = 1, S1 = 1 Opcode Fetch IO/M = 0, S1 = 1, S0 = 0 Status
S1, S0
RD
32
Addressing Modes
• Various ways of specifying the operands or
various formats for specifying the operands is
called addressing mode
• 8-bit or 16-bit data may be directly given in the
instruction itself
• The address of the memory location, I/O port or
I/O device, where data resides, may be given in
the instruction itself
• In some instructions only one register is specified.
The content of the specified register is one of the
operands. It is understood that the other operand is
in the accumulator.
33
• Some instructions specify one or two
registers. The contents of the registers are
the required data.
• In some instructions data is implied. The
most instructions of this type operate on the
content of the accumulator
34
Addressing Modes (8085)
• Implicit addressing
– CMA – Complement the contents of
accumulator
• Immediate addressing
– MVI R, 05H
– ADI 06H
• Direct addressing – The address of the
operand in the instruction - STA 2400H, IN
02H
35
• Register addressing
– In register addressing mode the operands are in
the general purpose registers
– MOV A, B
– ADD B
• Register indirect addressing
– Memory location is specified by the contents of
the registers
– LDAX B, STAX D, MOV A,M
36
Instructions of 8085
37
Data Transfer Instructions
Type Example
Between Registers MOV B, D - Copy the contents of
register D into register B
Specific data byte to a register or a MVI B, 32H – Load register B with
memory location the immediate data byte 32H.
Between a memory location and a MOV B, M – From memory location
register specified by HL pair register to
register B
Between an I/O device and the IN 05H – The contents of input port
accumulator designated in the operand(05H) are
read and loaded in accumulator(A)
38
MOV: This instruction copies the contents of source
register into destination register.
• MOV Rd,Rs
• MOV M,Rs
• MOV Rd,M
These instructions are 1 byte instructions.
Examples: MOV A,B
MOV B,M
MOV M,A
Flags: No flags are affected
If one of operands is memory location, it is specified
by HL pair register.
39
Opcode Operand Byte M- Cycle T-State
MOV Rd, Rs 1 1 4
MOV M, Rs 1 2 7
MOV Rd, M 1 2 7
40
MVI R,8 bit data: Store 8 bit data in
destination register or memory. If
destination is memory, it is specified by the
HL pair register.
.Opcode Operand Byte M- Cycle T-State
MVI R, Data 2 2 7
MVI M,Data 2 3 10
41
LXI Rp/SP, 16 bit data: Loads 16 bit data in
register pair/stack pointer.
.Opcode Operand Byte M- Cycle T-State
LXI Rp, 3 3 10
Data(16)
LXI SP,Data(16) 3 3 10
STA 16 bit 3 4 13
43
LDA 16 bit Addr: Content of memory
location memory location whose address is
specified by 2nd and 3rd byte of instruction,
is loaded in accumulator.
.Opcode Operand Byte M- Cycle T-State
LDA 16 bit 3 4 13
44
STAX Rp: Content of accumulator is copied
into memory location whose address is
specified by register pair(BC or DE).
.Opcode Operand Byte M- Cycle T-State
STAX B/D 1 2 7
45
LDAX Rp: Content of memory location
whose address is specified by register
pair(BC or DE), is loaded in accumulator.
.
Opcode Operand Byte M- Cycle T-State
LDAX B/D 1 2 7
46
SHLD 16 bit Addr: Content of register L is
stored in memory location whose address is
specified by 2nd and 3rd byte of instruction
and content of register H is stored in next
memory location.
. Opcode Operand Byte M- Cycle T-State
SHLD Addr(16 3 5 16
bit)
•No flags are affected.
47
LHLD 16 bit Addr: Content of memory
location memory location whose address is
specified by 2nd and 3rd byte of instruction,
is loaded into register L and content of next
location is copied into register H.
. Opcode Operand Byte M- Cycle T-State
LHLD Addr(16 3 5 16
bit)
•No flags are affected.
48
IN 8 bit addr (Port Address):Accept(read)
data byte from an input device and place it
in the accumulator.
OUT 8 bit addr (Port Address): Send(write)
data byte from the accumulator to an output
device.
Opcode Operand Byte M- Cycle T-State
IN Addr(8 bit) 2 3 10
OUT Addr(8 bit) 2 3 10
XCHG None 1 1 4
50
SPHL: Copy the contents of H and L register
into the stack pointer.
SPHL None 1 1 6
51