Beruflich Dokumente
Kultur Dokumente
8085 Microprocessor
The Intel ® 8085 Microprocessor
• Intel introduced its first microprocessor in 1971
• 4004 was a 4-bit microprocessor
• 8008 in the same year was an 8-bit microprocessor
• Intel in 1974 introduced 8080, an 8-bit microprocessor
having 16-bit address line
• Intel 8085 is an enhancement over 8080 having:
• Clock, control and interrupt control within CPU IC
• Two added instructions
• +5v power supply
• The generic microprocessor studied was a simplified
version of 8080/8085
• 8085 has some more registers, control lines and
features
2
• 8085 is pronounced as "eighty-eighty-five"
microprocessor. It is an 8-bit microprocessor
designed by Intel in 1977 using NMOS technology.
• It has the following configuration −
• 8-bit data bus
• 16-bit address bus, which can address upto 64KB
• A 16-bit program counter
• A 16-bit stack pointer
• Six 8-bit registers arranged in pairs: BC, DE, HL
• Requires +5V supply to operate at 3.2 MHZ single
phase clock
• It is used in washing machines, microwave ovens,
mobile phones, PART
etc.2- Microprocessor Architecture
and Programming
3
8085 Microprocessor – Functional
Units
• 8085 consists of the following functional
units −
Accumulator
• It is an 8-bit register used to perform
arithmetic, logical, I/O & LOAD/STORE
operations. It is connected to internal data
bus & ALU.
Arithmetic and logic unit
• As the name suggests, it performs
arithmetic and logical operations like
Addition, Subtraction, AND, OR, etc. on 8-
bit data. PART 2- Microprocessor Architecture
and Programming
4
General purpose register
• There are 6 general purpose registers in
8085 processor, i.e. B, C, D, E, H & L. Each
register can hold 8-bit data.
• These registers can work in pair to hold 16-
bit data and their pairing combination is like
B-C, D-E & H-L.
• Sign (S)
• Zero (Z)
• Auxiliary Carry (AC)
• Parity (P)
• Carry (C)
• Its bit position is shown in the following table −
• D7 D6 D5 D4 D3 D2 D1 D0
• S Z AC P C
D
IR 1000 1st
1001 2nd
C 1002 3rd
ID
RD
• int a,b,c;
• a = 1;
B = 2;
c = a+b;
• 3+2=5
• A <-ADD A, B
• ADD B 8085
• AA + B
24
Electrical Engineering, QUEST, Nawabshah. 14EL
0 0 1 Memory Write
0 1 0 Memory Read
1 0 1 I/O Write
1 1 0 I/O Read
0 1 1 Opcode Fetch
1 1 1 Interrupt acknowledge
* 0 0 Halt
* XPARTX 2- Microprocessor
Hold Architecture
and Programming
* X X Reset 27
Electrical Engineering, QUEST, Nawabshah. 14EL
TRAP 1 24h
RST7.5 2 3Ch
RST6.5 3 34h
RST5.5 4 2Ch
INTR 5 (1)*
(1)* Depends upon the number provided by the 8259 or other circuitry to the MPU
when interrupt is acknowledged.
Addressing Modes
• “The manner in which operand is given in an
instruction.” We need address of the data when we
perform any operation or any instruction.
• 8085 uses 5 addressing modes
• Implied
• No register or memory location involved. Like STC, NOP, HLT
• Register
• Both operands are in MPU registers like ADD C
• Immediate
• Data immediately follows in the next byte to op code (MVI)
• Direct
• 3-byte instructions. 1st byte op code. Next 2 bytes address like
LDA
• Register Indirect
• Uses register pair to address memory like ADD M
PART 2- Microprocessor Architecture
31 May 2019
and Programming
29
29
Addressing Modes
• Different ways by which a MPU can access data.
• The way the operands are chosen during execution
of an inst is determined by the addressing modes.
Immediate:
• Register:
Direct:
• Indirect:
• Implied/implicit
• Eg:
6002H 89
PART 2- Microprocessor Architecture
and Programming
32
• Indirect Addressing Mode: (Address of the data is
present as content of another register pair.)
(memory)
EG;
LDAX D
Load Accumulator with data in memory location/addreess
whose address is present in register pair (X). (DE in this
case)
6000H 89
D E 6001H 78
60 02 6002H 61 Accumulator
PART 2- Microprocessor Architecture
6003H 56
and Programming
• Register Addressing Mode: (Moving data from one
register to another, data is transferred between registers
not from memory)
(Register)
EG;
MOV B, C
Move contents or data in C register to B
MOV D, E
Arithmetic Instructions
• Add r (Register)
• Add M (Register Indirect)
• ADI data (Immediate)
• ADC r (Register)
• ADC M (Register Indirect)
• ACI data (Immediate)
• SUB r (Register)
• SUB M (Register Indirect)
• SUI data (Immediate)
44
Arithmetic Instructions
Examples
• Description • Instruction
Arithmetic Instructions
• Addition and Subtraction operations affects all flags
• Increment and Decrement operations affect all flags
except carry (INX and DCX affect none)
• DAD affects only carry flag
Branch Instructions
• JMP addr (Immediate)
• Jcondition addr (Immediate)
• CALL addr (Immediate)
• Ccondition addr (Immediate/ Register Indirect)
• RET (Register Indirect)
• Rcondition (Register Indirect)
• RST n (Register Indirect)
• PCHL (Register)
49
Branch Instructions
Program code:
XRA A ; Clear Accumulator
COUNT: OUT 02h ; Output acc. To port 02h
INR A ; Increment accumulator
MOV B, A ; Store count an B Register
LXI H, FFFFh ; Initialize HL pair with a big number
DELAY: DCX H ; Decrement HL by 1
MOV A, L ; Move L to A
ORA H ; Logically OR H and L to see if HL=0?
JNZ DELAY ; If not zero then repeat with delay
MOV A, B ; If yes then repeat next count
JMP COUNT ;
59
Electrical Engineering, QUEST, Nawabshah. 14EL
Program Code
LXI H 2020H ; Initialize HL register pair
MOV A, M ; Move LSB of first number into accumulator
INX H ; Increment pointer
ADD M ; Add LSBs of both numbers
STA 2026H ; Store the LSB of sum at memory location 2026h
INX H ; Increment memory pointer (2022h)
MOV A, M ; Move the middle byte of first number into accumulator
INX H ; Increment memory pointer
ADC M ; Add the middle bytes with carry
STA 2027H ; Store the sum of middle bytes at memory location 2027h
INX H ; Increment the memory pointer
MOV A, M ; Move the MSB of first number into accumulator
INX H ; Increment memory pointer
ADC M ; Add the MSB of both numbers with carry
STA 2028 ; Store the result of addition at memory location 202h
PART 2- Microprocessor Architecture
HLT2019
31 May ; Stop and Programming
61
61
Electrical Engineering, QUEST, Nawabshah. 14EL
Questions
62