8085

You might also like

Download as ppt, pdf, or txt
Download as ppt, pdf, or txt
You are on page 1of 47

INTEL 8085-Features

INTEL 8085 is an 8-bit microprocessor. The data word size of the 8085 microprocessor is 8-bits. Hence has 8-bit data bus. The address size of 8085 microprocessor is 16-bits. Hence uses 16-bit address bus. It can directly process on 8-bits of data in single operation, hence it is known to be an 8-bit microprocessor. It can directly address 216 = 65,536 bytes i.e., 64 Kbytes (64 K memory locations) using 16-bits of address. 8085 microprocessor is fabricated using NMOS technology and comes in an 40-pin DIP(dual-in-line) package.

INTEL 8085-Features
It requires a single power supply of +5V. It has provision of internal frequency generation when an crystal is connected between the specified pins. The generated clock is divided by a factor of 2, hence to operate an 8085 based system at an frequency of 3 MHz, an crystal of 6 MHz frequency need to be connected to 8085. The NMOS 8085 is available in two versions 8085A and 8085A-2 with maximum internal clock frequency of 3.03 MHz and 5 MHz respectively and hence require an crystal of 6.06 MHz and 10 MHz to be connected them respectively.

INTEL 8085-Features
The enhanced version of 8085 is designed with HMOS transistors. It is available in three versions 8085AH, 8085AH-2, 8085AH-1 with maximum internal clock of 3 MHz, 5 MHz and 6 MHz respectively. The clock cycle of 8085 is of order of 320 ns and that for 8085AH-2 version is 200 ns. It has 80 basic instructions and 246 opcodes. 8085 is enhanced version of its predecessor the 8080A microprocessor; thus its instruction set is upward compatible with that of 8080A, i.e., 8085 instruction set includes all the 8080A instructions plus some more instructions.

INTEL 8085-Features
Thus the programs written for the 8080A will be executed by the 8085 microprocessor. But 8085 and 8080A are not pin compatible, i.e., the 8085 microprocessor can not be used in place of 8080A microprocessor in an 8080A based system.

INTEL 8085-Architecture
The internal block diagram of 8085 microprocessor consists of the following main sections: An arithmetic and logic unit
A timing and control unit

A set of registers

Interrupt Signals

. . .

Interrupt Control

Serial I/O control

SID SOD

Accumulator

Temporary Register

Status Flags

Instruction Register (IR)

B D H

C E L

Stack Pointer (SP)

Arithmetic And Logical Unit (ALU)

Instruction Decoder And M/C cycle Encoding

Program Counter(PC)

Incrementer/ Decrementer Address latch Data/Address Buffer

Address Buffer
X1

X2

Timing And Control Unit


CLK
-----------------Control Signals

A8-A15 Address Bus

AD0-AD7 Address/Data Bus

ALU
The arithmetic and logical unit(ALU), performs the following arithmetic and logical operations: Addition Subtraction Logical AND Logical OR Logical Exclusive-OR Complement (Logical NOT) Increment (add 1) Decrement(Subtract 1) Left shift, Right shift, Rotate Left,Rotate right Clear e.t.c.

Timing And Control Unit


It is section of CPU. It generates timing and control signals which are necessary for the execution of instructions It controls data flow between CPU and peripherals (including memory). Provides status, control and timing signals which are required for the operation of memory and I/O devices. Controls all the operations of microprocessor and peripherals

Registers
Registers are used by the microprocessor for temporary storage and manipulation of data and instructions. Data remains in the register till they are sent to the memory or I/O devices. INTEL 8085 microprocessor has the following registers:
One 8-bit accumulator (ACC) i.e., Register-A Six 8-bit general purpose registers. These are B,C,D,E,H and L. One 16-bit stack pointer (SP) One 16-bit program counter (PC) Instruction register Temporary register Incrementer/Decrementer Flag register ( a register made up of individual flip-flops out of which only five are active.

Registers
Accumulator:
Accumulator is an 8-bit register associated with the ALU. It is used to hold one of the operands of an arithmetic or logical operation, the other operand is held in either one of the general purpose registers or in memory. After the operation is completed the accumulator holds the final result.

Registers
General Purpose Registers: six 8-bit general purpose registers are present in 8085. The general purpose registers present in 8085 microprocessor are: B,C,D,E,H and L. To hold 16-bit data a combination of two 8-bit registers can be used and are known as register pair. The valid register pairs in 8085 are: B-C,D-E and H-L. H-L pair can be used as an memory pointer to access the 16-bit address of an memory location indirectly. The general purpose registers and accumulator are programmer accessible. BC, DE and HL registers are known as scratch pad registers. Basically this register array is like a small chip of RAM with addressable memory locations. By using proper control signals,the CPU can either load a register from the internal data bus or the output of these registers to the bus.

Registers
Program Counter (PC):
It is a 16-bit special purpose register. It is used to hold the memory address of the next instruction to be executed. It keeps the track of memory address of the instructions in a program while they are being executed. The microprocessor increments the contents of the program counter during the execution of an instruction so that it points to the address of the next instruction in the program at the end of the execution of an instruction. It is not programmer accessible.

Registers
Stack Pointer (SP): It is a 16-bit special function register. The stack pointer holds the address of the top of the stack i.e., the top most element of data stored in stack and controls the addressing of the stack of 8085. The stack is a sequence of memory locations set aside by a programmer to store/retrieve the contents of internal registers of microprocessor such as accumulator,flags,program counter and general purpose registers during the execution of the program. Any portion of the memory can be used as stack. Stack works on FIFO(first-in-first-out) principle. Generally the stack operations of storing/retrieving should be faster compared to normal store/retrieve operations of memory locations.

Registers
During the execution of a program some times it becomes necessary to save the contents of the registers which are needed for some other operations in the subsequent steps of the program. The contents of such registers is saved in stack. After saving the contents in the stack the registers can be used for some other operations. After completing the needed operations the contents which were saved in the stack are brought back to the registers. The contents of only those registers which are needed in the later part of the program. The order of the storing into stack should be followed by the retrieving principle of the element stored last will be retrieved first and vice versa. The stack is defined and stack pointer is initialized by the programmer at the beginning of a program which needs stack operation and then updated due to either stack instructions in the program or by the microprocessor while executing some of the instructions like CALL.

Registers
Instruction Register / Decoder :
The instruction register holds the opcode (operation code or instruction code) of the instruction which is being decoded and executed. The decoder interprets the instruction and produces the proper signals to carry it out. It is not programmer accessible.

Temporary Register:
It is an 8-bit register associated with the ALU. It holds data during an arithmetic/logical operation. It is used by the microprocessor. It is not accessible to programmer.

Registers
Incrementer / Decrementer: The Incrementer / Decrementer allows the contents of any of the 16-bit registers to be incremented or decremented, by 1. Program Status Word: The five bits of the flag register which provide the information about the status of the instruction execution along with the three undefined bits is known as PSW (program status word). Thus the program status word is the flag register of the microprocessor.

Flag Register
The flag register of 8085 microprocessor 7 6 5 4 3 2 1 S Z X AC X P X 0 CY

The INTEL 8085 microprocessor contains five flip-flops to serve the status of the program/instruction execution as status flags. The flipflops are set or reset according to the conditions which arise during an arithmetic or logical operation. The five status flags of INTEL 8085 are : 1. Carry Flag (CY) 2. Parity Flag (P) 3. Auxiliary Carry Flag (AC) 4. Zero Flag (Z) 5. Sign Flag (S)

Flag Register
If a flip-flop for a particular flag is set, it indicates 1. When it resets it indicates 0.
Carry Flag (CY): After the execution of an arithmetic instruction if a carry is produced, the carry flag CY is set to 1, otherwise it is 0. The carry flag is set or reset in case of addition as well as subtraction. After the addition of 2 8-bit numbers is performed if the result is greater than 8-bits, a carry is produced, and the carry flag is set to 1. In case of subtraction, if the borrow occurs, the carry flag is set to 1. Thus carry flag holds the carry out of the most significant bit position resulting from the execution of an arithmetic operation.

Flag Register
Parity Flag (P): The parity status flag P is set to 1, if the result of an arithmetic or logical operation contains even number of 1s. It is reset i.e., it is 0, if the result contains odd number of 1s Auxiliary Carry Flag (AC): The Auxiliary Carry flag (AC) holds carry out of the lower most nibble to the next nibble i.e., from bit position 3 to the bit position 4 resulting from the execution of an arithmetic operation. Zero Flag (Z): The Zero status flag (Z) is set to 1, if the result of an arithmetic or logical operation is 0.If the result is not zero,the flag is reset i.e, set to 0.

Flag Register
Sign Flag (S): The Sign flag S is set to 1, if the result of an arithmetic or logical operation executed is negative. If the result is positive it is reset i.e., set to 0. The sign flag has its significance only when signed arithmetic operation is performed. To represent a signed number the most significant bit is reserved by the programmer to represent the sign of a number i.e., the MSB is used as a sign bit which represents the sign of the number, if the number is negative the sign bit is 1 and if the number is positive the sign bit is 0. For an 8-bit signed number only 7-bits are used to represent the magnitude of the number.

Flag Register
Sign Flag (S): After the execution of signed arithmetic operation, the MSB of the result represents its sign.The sign flag acquires the value of the MSB of the result following the execution of the signed arithmetic operation. Hence, it represents the sign of the result. For unsigned arithmetic operations, all the 8-bits are used to represent the magnitude of the number. After the execution of an arithmetic operation, all the 8-bits of the result represents its magnitude. Thus the sign flag has no significance in unsigned arithmetic operations. For logical operations also the sign bit has no significance, as the sign flag is set or reset depending on the value of the MSB of the result, it is set or reset on the value of MSB of the result of logical operations also.

Flag Register
Sign Flag (S): The sign flag is affected in the similar way for an signed arithmetic operation of 16-bit, 32-bit or more. In case of 16-bit operation 15-bits are used for representing the magnitude of the number and the 16th bit is used for representing the sign of the number. similarly in case of 32-bit number 31-bits are used for representing the magnitude and 1-bit is used for representing the sign of the number.

Flag Register
Effect on the flag register for example of CB + E9 CB = 1 1 0 0 1 0 1 1 E9 = 1 1 1 0 1 0 0 1 1 -------------------10110100 There is a carry from bit position 3 to bit position 4 thus AC = 1(set) There is a carry from bit position 7 to bit position 8 thus CY = 1(set) There is a non zero result thus Z = 0 There are even number of 1s thus P = 1 MSB = 1 thus S = 1.

Functional unit of 8085


The other functional blocks other than the ALU and other registers is as follows: 1. Internal Data Bus 2. Serial I/O Control 3. Interrupt Control 4.Timing and Control 5. Address Buffer and Address / Data Buffer Internal Data Bus: The internal data bus is 8-bits inside and carries instructions and data between the CPU registers.

Functional unit of 8085


Serial I/O Control : Generally the Data flowing between microprocessor will be either parallel or serial, but for some devices it is necessary to accept data serially and output data serially and if there is a provision built in in the microprocessor for this purpose it is very efficient. In 8085 there is such provision through SID and SOD pins. The SID pin is used for accepting serial data input. The SOD pin is used for serial output.

Functional unit of 8085


Interrupt Control: For handling the interrupts of 8085 this block is provided. There is provision of both hardware and software interrupts in INTEL 8085 microprocessor. Hardware Interrupts: There are five hardware interrupt inputs namely TRAP, RST 7.5, RST 6.5, RST 5.5, INTR. TRAP has the highest priority, followed by RST 7.5, RST 6.5, RST 5.5. INTR has the lowest priority. When these hardware interrupts are used they are to be enabled by enabling EI flip-flop using software instruction EI (Enable Interrupt) in the main program. The use of instruction EI enables all the interrupts.

Functional unit of 8085


The instruction DI (disable Interrupts) is used to disable all the interrupts except the non-maskable interrupt TRAP The system reset also resets the interrupt enable flag(flipflop). When an interrupt line goes high the processor completes its current instruction and saves the program counter on the stack. It also resets the Interrupt enable flip-flop before taking up ISR so that further occurrence of any interrupt is avoided during the execution of current ISR, as all the interrupts except TRAP can be prevented by resetting the EI flip-flop. Thus the resetting of EI flip-flop can be done using three different ways : By software instruction DI, System reset or By recognition of an interrupt request.

Functional unit of 8085


Before the program returns back from the ISR to the main program all the interrupts are to be enabled using the instruction EI before RET instruction in the ISR. Software Interrupts: There is provision for Software interrupts also for 8085 microprocessor using RST n where n = 1,2.7. When RST n instruction is inserted in a program , the program is executed upto the point where RST n has been inserted. This is used in debugging of a program.

Functional unit of 8085


The interrupts of the 8085 microprocessor are vectored interrupts and the program control is transferred automatically to a particular address which is known as vector address of the interrupt. Interrupt Call-location in HEX
TRAP 0024 RST 7.5 003C RST 6.5 0034 RST 5.5 002C RST 7.5,RST 6.5, RST5.5 are maskable interrupts. These interrupts are enabled by software using instructions EI and SIM ( Set Interrupt Mask). The execution of the instruction SIM enables / Disables interrupts according to the bit Pattern of the accumulator.

Functional unit of 8085


Accumulator contents for a SIM instruction:

SOD SOE
Serial Output Data

R 7.5 MSE M 7.5 M 6.5 M 5.5


RST 5.5 MASK RST 6.5 MASK RST 7.5 MASK

SOD Enable

MASK SET ENABLE Reset RST 7.5 Undefined

Functional unit of 8085


RST n RST 0 RST 1 RST 2 RST 3 RST 4 RST 5 RST 6 RST 7 HEX-Code C7 CF D7 DF E7 EF F7 FF CALL-Locations 0000 0008 0010 0018 0020 0028 0030 0038

Functional unit of 8085


Timing and Control: This section is a part of the CPU and generates timing and control signals for the execution of instructions. Basically this section includes an oscillator and controller sequence. The control signals of this unit controls data flow between CPU and peripherals; and controls the entire operations of the microprocessor and the peripherals connected to it. Address Buffer and Address / Data Buffer: The contents of stack pointer or program counter can be loaded into these buffers. These buffers drive the external address bus and address-data bus. The internal data bus is also connected to the address / data buffer to send or receive the data.

Data and Address Bus


The INTEL 8085 is an 8-bit microprocessor. Its data bus is 8-bit wide and hence, 8 bits of data can be transmitted in parallel from or to the microprocessor. The INTEL 8085 requires a 16-bit wide address bus as the memory address are of 16-bits. The 8 most significant bits of the address are transmitted by the address bus, A-bus (pins A8 A15). The 8 least significant bits of the address are transmitted by Address / Data bus, AD- bus ( pins AD0 AD7). The Address / Data bus transmits data and address at different moments. At a particular moment it transmits either data or address. Thus the AD bus operates in time shared mode. This technique is known as Time Multiplexing .

Pin Configuration Of 8085


VSS
VCC X1 X2 _______ Reset In Reset Out __ IO/M AD0 AD7

A8 A15
CLK OUT HOLD

S0
S1 __ RD ___ WR ALE SID SOD READY

INTEL 8085

HLDA
TRAP RST 7.5 RST 6.5 RST 5.5 INTR ____ INTA

Pin Configuration Of 8085


The logical pin out of an 8085 microprocessor consists of an 40-pin DIP package. The pins of the 8085 microprocessor can be categorized int the following groups: Address bus Data bus Control and Status signals Power Supply and Frequency signals Externally initiated signals Serial I/O ports

Pin Configuration Of 8085


Address Bus: (A8 A15) Output and Tri-stated lines These are the address bus and are used for the most significant bits of the memory address or 8-bits of I/O address Multiplexed Address / Data Bus : ( AD0 AD7) Bi-directional and Tri-stated lines These are time multiplexed address / data bus I.e., they serve dual purpose. They are used for the least significant 8-bits of memory address or I/O address during the first clock cycle of the machine cycle. For the remaining period of the machine cycle they are used to carry data to/from the specified location or device.

Pin Configuration Of 8085


Control and Status signals: ___ This group of signals includes two control signals ( RD ___ __ and WR), three status signals ( IO/M , S1 and S0) to identify the nature of the operation, and one special signal (ALE) to indicate the beginning of the operation. These signals are as follows: ALE Address Latch Enable: Output and Tri-stated line It is a Address Latch Enable signal. It goes high during the first clock cycle of a machine cycle and enables the lower 8 bits of the address to be latched either into the memory or external latch.

Pin Configuration Of 8085


___ RD : Read Output and a tri-stated line It is a signal to control read operation When it goes low the microprocessor reads the data from the selected memory location or an I/O device. ___ WR : Write Output and Tri-stated line It is a signal to control Write operation When it goes low the microprocessor writes the data into the selected memory or I/O device.

Pin Configuration Of 8085


. __ IO/M : I/O or Memory indicator Output and Tri-stated line. It is a status signal which distinguishes whether the Address is for Memory or I/O. When it goes high the address is for an I/O device and when it goes low the address on the address bus is for a memory location. S1 and S0 : Bus state/ status indicator Output lines. The status output signals from microprocessor and these signals gives the information about the various types of operations that take place.

Pin Configuration Of 8085


. S1 0 0 1 1 S0 0 1 0 1 Operations HALT WRITE READ FETCH

Pin Configuration Of 8085


Power Supply and Clock Frequency Signals The power supply and frequency signals are as follows: VCC : + 5 V Power Supply VSS : Ground Reference X1 and X2 : Crystal or RC Connections Input lines These are terminals to be connected to an external crystal oscillator which drives an internal circuitry of the microprocessor to produce a suitable clock for the operation of microprocessor. CLK(Out) : Clock signal Output line It is a Clock Output for user,which can be used for other digital ICs. Its frequency is same at which processor operates.

Pin Configuration Of 8085


Externally Initiated Signals including Interrupts: There are five Interrupt signals associated with 8085 microprocessor along with an acknowledge signal for these interrupts. apart from the interrupt signals there are the following externally initiated signals associated with 8085 microprocessor pin configuration they are HOLD HLDA READY RESET OUT _________ RESET IN

Pin Configuration Of 8085


INTERRUPT Signals TRAP , RST 5.5, RST 6.5, RST 7.5 INTR : (INPUT) It is an interrupt request signal. Among all the interrupts this has the least priority, when it goes high the program counter does not increment its contents.The microprocessor suspends its normal sequence of instructions after completing the instruction in hand and then it jumps to the starting address of the ISR after saving the contents of required registers into stack. The INTR line is sampled in the last state of the last machine cycle of the instruction being executed. The microprocessor acknowledges the interrupt signal and issues an (INTA) signal. The INTR is enabled or disabled by software. An interrupt is used by I/O devices to transfer data to the microprocessor with out wasting its time.

Pin Configuration Of 8085


(INTA) : Output It is an Interrupt Acknowledgement sent by the microprocessor after INTR is received. HOLD: Input It indicates that another device is requesting for the use of address and data bus.Having received a HOLD request the microprocessor relinquishes the use of the buses as soon as the current machine cycle is completed. Internal processing may continue, the processor regains the buses after the removal of HOLD signal. When a HOLD is acknowledged,address bus, data bus, (RD), (WR) and IO/(M) are Tri-stated.

Pin Configuration Of 8085


HLDA : Output It is a signal for HOLD acknowledgement. It indicates that the HOLD request has been received. The HLDA goes low after the HOLD signal goes low. The CPU takes over the buses after Half clock cycle of removal of HLDA signal. READY : Input It is used by the microprocessor to sense whether a peripheral is ready to transfer data or not. A slow peripheral may be connected to the microprocessor through the Ready line. If READY is high the peripheral is ready.If it is low the microprocessor waits till it goes high.

Pin Configuration Of 8085


RESET OUT : Output Indicates that CPU is being reseted, and is used by the microprocessor to reset the other sub-systems in the microprocessor based system. (RESET IN) : Input It resets the program counter to zero. It also resets interrupt enable and HLDA flip-flops. It does not affect any other flag or register except the instruction register. The CPU is held in the reset condition as long as RESET is applied.

Pin Configuration Of 8085


Serial I/O ports The 8085 microprocessor has two signals for serial communication i.e., SID and SOD SID: Serial Input Data (Input) It is data line for serial input. The data on this line is loaded into the 7th bit of the accumulator when RIM instruction is executed. SOD : Serial Output Data (Output) It is a data line for serial output. The 7th bit of the accumulator is output on SOD line when SIM instruction is executed.

You might also like