Sie sind auf Seite 1von 48

8085 MICROPROCESSOR

Why the name 8085 ?


80 indicates eighties(1976) it was developed in early

5 means the microprocessor operates at +5volts.


8 means 8bits, its word length is 1byte.

Organization of a microprocessorbased system


I/O Input / Output

ALU Register Array Timing &Control

System Bus

Memory

General Operations In Microprocessor


These are usually one of 4 operations:
Memory Read Memory Write I/O Read (Get data from an input device) I/O write (Send data to an output device)

8085 Microprocessor Architecture

Three Sections in Architecture


ALU Timing and Control Unit Set of Registers

ALU Section
ALU Can Performs
Addition Subtraction Logical AND Logical OR Logical EXCLUSIVE OR Complement (logical NOT) Increment (add 1) Decrement (subtract 1) Left shift Clear

Register Section
General Purpose Registers
B Reg C Reg D Reg E Reg H Reg L Reg

Special Purpose Registers


Accumulator Program Counter Stack Pointer Temp Reg (Temp Data Reg W and Z Reg) Instruction Register

General Purpose Registers


B,C,D,E,H,L used as 8 bit registers separately also 16 bit registers as BC,DE,HL register pairs

Special Purpose Registers


Accumulator (8 bit)
Used to store arithmetic ,logic, load and store operations Store the result of arithmetic operations

Program Counter (16 bit)


This is a register that is used to control the sequencing of the execution of instructions. This register always holds the address of the next instruction. Since it holds an address, it must be 16 bits wide.

The Stack pointer(16 bit)


The stack pointer is used to point into memory.

This register points to is a special area called


the stack.

The stack is an area of memory used to hold


data that will be retreived soon. The stack is usually accessed in a Last In First Out (LIFO) fashion.

Special Purpose Registers Contd


Flag Register has five 1-bit flags.
S Z X AC X P X C
Sign - set if the most significant bit of the result is set. Zero - set if the result is zero. Auxiliary Carry Flag- set if there was a carry out from bit 3 to bit 4 of the result. Parity Flag - set if the parity (the number of set bits in the result) is even. Carry Flag- set if there was a carry during addition, or borrow during subtraction/comparison/rotation.

Timing and Control Unit


Responsible for all the operation
Generates signals for instruction execution, required to interface external devices to the processor 8085

Instruction Decoder
Decoder then takes instruction and decodes or interprets the instruction. Decoded instruction then passed to next stage.

System Bus
Address Bus Data Bus Control Bus

The Address Bus


16 bits wide (A0 A1A15)
Therefore, the 8085 can access locations with numbers from 0 to 65,536. Or, the 8085 can access a total of 64K addresses.

Unidirectional.
Information flows out of the microprocessor and into the memory or peripherals.

When the 8085 wants to access a peripheral or a memory location, it places the 16-bit address on the address bus and then sends the appropriate control signals.

The Data Bus


8 bits wide (D0 D1D7) Bi-directional.
Information flows both ways between the microprocessor and memory or I/O.

The 8085 uses the data bus to transfer the binary information. Since the data bus has 8-bits only, then the 8085 can manipulate data 8 bits at-a-time only.

Control Bus
The control bus has various lines which have specific functions for coordinating and controlling microprocessor operations. 8085 has 11 control signals
s0, s1, IO/M, RD, WR, ALE, READY, HOLD, HLDA,
RESET IN, RESET OUT.

Example: Memory Read Operation

3 2

Example: Instruction Fetch Operation

8085 PIN Configuration

8085 Functional Pin Diagram

8085 is a 40 pin IC, DIP package. The signals from the pins can be grouped as follows
Power supply and clock signals Address bus Data bus Control Bus Interrupts signals Serial I/O ports DMA Signals Reset Signals

Power supply and Clock frequency signals


Vcc + 5 volt power supply Vss Ground X1, X2 : Crystal or R/C network or LC network connections to set the frequency of internal clock generator. The frequency is internally divided by two. Since the basic operating timing frequency is 3 MHz, a 6 MHz crystal is connected externally. CLK OUT-Clock Output is used as the system clock for peripheral and devices interfaced with the microprocessor

Address Bus:
A8 - A15 (output) It carries the most significant 8 bits of the memory address or the 8 bits of the I/O address;

Multiplexed Address / Data Bus:


AD0 - AD7 (input/output) These multiplexed set of lines used to carry the lower order 8 bit address as well as data bus. During the opcode fetch operation, in the first clock cycle, the lines deliver the lower order address A0 - A7.

In the subsequent IO / memory, read / write clock cycle the lines are
used as data bus. The CPU may read or write out data through these lines.

Control Bus (Control Signals)


ALE (output) - Address Latch Enable. This signal helps to capture the lower order address presented on the multiplexed address / data bus.

RD (output 3-state, active low) - Read memory or IO


device. This indicates that the selected memory location or I/O device is to be read and that the data bus is ready for accepting data from the memory or I/O

device.

Control Bus (Control Signals)


WR (output 3-state, active low) - Write memory or IO device.
This indicates that the data on the data bus is to be written into
the selected memory location or I/O device.

IO/M (output) - Select memory or an IO device.


This status signal indicates that the read / write operation relates to whether the memory or I/O device. It goes high to indicate an I/O operation. It goes low for memory operations

Status Signals It is used to know the type of current operation of the microprocessor.

Interrupts
They are the signals initiated by an external device to request the microprocessor to do a particular task or work. There are five hardware interrupts called,

TRAP RST 7.5 RST 6.5 RST 5.5 INTR INTA

(High Priority)

(Low Priority)

Interrupts Contd
On receipt of an interrupt, the microprocessor acknowledges the interrupt by the active low INTA (Interrupt Acknowledge) signal.

Serial I/O Signals


These signals communication. are used for serial

SID (input) - Serial input data line


Used to accept serial data bit from external device

SOD (output) - Serial output data line


Enables the transmission of serial data bit by bit to the external device.

Reset Signals
Reset In (input, active low)
This signal is used to reset the microprocessor. The program counter inside the microprocessor is set to zero. The buses are tri-stated.

Reset Out (Output)


It indicates CPU is being reset. Used to reset all the connected devices when the microprocessor is reset.

DMA Signal
HOLD signal generated by the DMA controller circuit. Indicates that another master is requesting for the use of address bus, data bus and control bus. HLDA Signal this active high signal is used to acknowledge HOLD Request.

READY (input) Memory and I/O devices will have slower response compared to microprocessors. Before completing the present job such a slow peripheral may not be able to handle further data or control signal from CPU. The processor sets the READY signal after completing the present job to access the data The microprocessor enters into WAIT state while the READY pin is disabled.

Example: Instruction Fetch Operation

Instruction (opcode) reaches th instruction decoder now !

It takes four instruction clock cycles to get one into the CPU.

Execution of an Instruction
Now consider the execution of a simple instruction:
Instruction 3E (hex) means: Load a data byte into the accumulator The instruction is followed by the data byte 32 (hex) Two-byte instruction !

Execution of an Instruction

Get the instruction (opcode) byte from memory

39

Execution of an Instruction

Interpret the instruction: Wait for the data byte !

40

Execution of an Instruction

Put the next memory location on the address bus (2001 h)

41

Execution of an Instruction

Get the data byte from the memory

Put into accumulator

42

8085 Instruction Set


The 8085 instructions can be classified as follows:

Data transfer operations


Between registers Between memory location and a register Direct write to a register / memory Between I/O device and accumulator

Arithmetic operations (ADD, SUB, INR, DCR)


Logic operations

Branching operations (JMP, CALL, RET)


43

8085 Instruction Types

44

Cont..

8085 Instruction Types

45

Cont..

8085 Instruction Types

46

A Simple Program
Add two hexadecimal numbers:

Load register A (accumulator) with 32 (hex)


Load register B with 48 (hex) Add the two numbers and save the sum in A Display accumulator (A) contents at port (01) End
47

A Simple Program

48

Das könnte Ihnen auch gefallen