Microprocessor Slide
Microprocessor Slide
1
Advantages of 8085 MPU
2
Necessary information to use a
microprocessor
a) Pinout diagram of MPU,
b) Register set (programming model),
c) Instruction set (opcode / mnemonics ) and
addressing modes,
d) Typical circuit diagram.
• These information are provided by the
manufacturer of the MPU.
3
Pinout diagram of MPU
Pinout diagram of MPU shows the designation
of the pins originating from the MPU chip, i.e.
(pin number and signal).
4
Pinout diagram of 8085 MPU
5
Classification of the signals on the pins of
8085
There are six groups of signals:
1. Address bus: high order address bus A15 – A8, low order address bus AD7
– AD0 (combined with data bus – known as multiplexing), total 16 address
lines.
2. Data Bus: multiplexed with low order address bus AD7 – AD0, total 8 data
lines.
3. Control and status signal: ALE- address latch enable, /RD- read, /WR-
write, IO /M- status signal to differentiate between IO and memory
operation, S1 and S0- status signals,
4. Externally initiated signals: INTR- interrupt request, /INTRA- interrupt
acknowledge, RST7.5, RST6.5, RST5.5- restart interrupts, TRAP-
nonmaskable interrupt, HOLD- DMA request, HLDA- hold acknowledge,
READY- wait signal to MPU, /RSTIN- reset MPU, RSTOUT- reset other
devices along the MPU,
5. Serial IO ports: SID- serial input data, SOD- serial output data.
6. Power supply and frequency signals: VCC, VSS (GND), X1- X2 for crystal,
CLK (out)- clock output,
6
Diagram of 8085 classified signal pins
7
The register set (Programming model)
8
8085 register set (programming model)
9
8085 register set diagram
10
8085 general purpose registers
11
The accumulator register
12
8085 flag register
Flag register (F) stores the outputs of flip flops included
in the Arithmetic and Logic Unit (ALU), that are set or
reset to indicate data conditions (flags) in accumulator
and other registers after some operation.
•The flag bits are Zero (Z), Carry (C), Sign (S), Parity
(P) and Auxiliary Carry (AC).
•The bits of the flag register are used for testing the data
condition and taking decision accordingly by the MPU.
13
The program counter register
14
The stack pointer register
16
The instruction set
17
Parts of Instruction
18
Machine language program
19
Mnemonics
20
Assembly language program
21
Format of instruction in assembly
language
[Label:] mnemonic destination, source [; comments]
• Label is the name given to the start address of
instruction loaded into memory.
• destination and source are operands, which
may be
• register
• memory location
• a data constant - appears only as source.
22
Addressing mode
23
Addressing mode in 8085 MPU
24
Implied addressing
25
Immediate addressing
26
Register addressing
Example:
Copy data8 from source to destination registers8
•MOV A, C ; source C reg., destination A reg.;
27
Direct addressing
The operand is memory address (8/16 bits) and is contained in
the instruction to be copied into accumulator register A.
Example:
Load data8 into register A from system memory (address 16bit)
LDA C100h;
Store data8 from register A to system memory (address 16bit)
STA C101h;
Read data8 into register A from port memory (address 8 bit)
IN FFh;
Write data8 from register A to port memory (address 8 bit)
OUT FFh;
28
Register indirect addressing
31
Register indirect addressing (cont.)
b. HL register pair (denoted by M) contains address of
memory location (pointer).
MOV REG8, M;
MOV M, REG8;
32
Example
Copy data from memory location C100h pointed
by HL register pair
1. LXI H, C100h; H= C1h, L= 00h.
2. MOV A, M; copy data from memory location
C100h pointed by HL (M) register pair into A
reg.
3. MOV M, B; copy data from B register to
memory location C100h pointed by HL register
pair.
33
Types of instructions
34
Data transfer operations
35
Types of data transfer operations
1. Data (constant) to Reg8=A,B,C,D,E,H,L
data8 =8 bit data
– a register: MVI reg8, data8 ; data16 =16 bit data
38
Types of data transfer operations (cont.)
39
Types of data transfer operations (cont.)
4. Between stack and register pairs
PUSH source ; write on stack, SP reg. decreases by 2
POP destination; read from stack, SP reg. increases
by 2
source or destination are register pairs - B (BC pair),
D (DE pair), H (HL pair), and PSW (A&F registers).
PSW-program status word
5. Between IO-controller (port memory) and
accumulator register A
OUT port_address8 ; write data from A-reg. to port.
IN port_address8; read data into A-reg. from port.
40
Summary of data transfer operations
41
Arithmetic operations
42
Arithmetic operations (cont.)
1. Addition / Subtraction-
The source operand may be-
• Any 8-bit data constant: ADI data8; SUI data8;
• Content of an 8-bit register: ADD reg8; SUB reg8;
• Content of the memory location pointed by HL pair,
denoted by M: ADD M; SUB M;
43
Arithmetic operations (cont.)
44
Summary of arithmetic operations
45
Logical operations
46
Logical operations (cont.)
47
Logical operations (cont.)
48
Logical operations (cont.)
4. Compare- compare a data for equality, greater than,
or less than, with the content of accumulator
register.
The source operand may be-
• Any 8-bit number: CPI data8;
• Content of a 8-bit register: CMP reg8;
• Content of the memory location pointed by HL pair:
CMP M;
• Compare-logical subtraction: content of accumulator
reg. A is not changed, only flags are affected.
• Used in pair with Jmp_condition instruction. 49
Summary of logical operations
right
50
Branching operations
These instructions alter the sequence of program
execution conditionally or unconditionally, consist of
jump, call, return, restart- instructions.
1.Jump
– Unconditional- instructions alters the program
sequence unconditionally: JMP branch_address16;
– Conditional- instructions test for certain condition
(sign, zero, carry, parity, aux. carry flags) and alter the
program sequence where the condition is met:
Jmpcondition branch_address16;
51
Branching operations (cont.)
53
Machine control operations
54
Machine control operations (cont.)
55
Typical circuit diagram
56
Circuit diagram of a 8085 MPU based
Single Board Computer [SBC] system
57
Components of SBC
• 8085 - microprocessor
• 74373 - single register data latch
• 2732 - 4KByte EPROM
• 74138 - 3 to 8 decoder
58
Purpose of the Circuit
59
The listing of program to control the
circuit
60