8085 Microprocessor

8085 Microprocessor

Introduction

Intel Corporation developed the 8085 microprocessor in the late 1970s, which significantly impacted the industry and enabled numerous technological advancements. This article explores the architecture, features, and impact of the 8085 microprocessor, highlighting key aspects like its architecture, pin diagram, instruction set, functional unit, and more.

The 8085 microprocessor, which is an 8-bit microprocessor, was created by Intel in 1976. The 8085 microprocessor belongs to the 8085 family, which also includes the 8080, 8085A, and other variations. The 8085 microprocessor gained popularity and was extensively utilised in a variety of applications, such as personal computers, embedded systems, and industrial control systems. 

Arithmetic Logic Unit (ALU)

The ALU is in charge of executing arithmetic and logical operations on data. It is capable of executing operations like addition, subtraction, logical AND, logical OR, and other functions. The Arithmetic Logic Unit (ALU) processes 8-bit data and generates flags to signify conditions like zero, carry, sign, and parity.

Control and Timing Unit

The control unit manages and directs the operations of the other functional units in the microprocessor. The system generates timing and control signals to coordinate the execution of instructions and oversee data transfers between various units.

The Timing and Control Unit produces essential timing signals to coordinate the operations of the microprocessor. It generates signals like RD (read), WR (write), and other necessary control signals for executing instructions.

Register Set

The 8085 microprocessor contains multiple registers with distinct functions.

● Accumulator (A): The accumulator is an 8-bit register used for arithmetic and logical computations. It retains one of the operands during calculations and saves the outcome.

● General Purpose Rrgisters (B, C, D, E, H, L):

The 8085 microprocessor features six 8-bit general-purpose registers. These registers are used for data manipulation and storage.

The stack pointer, a 16-bit register, indicates the top of the stack. The stack is used for storing return addresses during subroutine calls, along with local variables and other data.

The Programme Counter (PC) is a 16-bit register that stores the memory address of the next instruction to be fetched and executed. It automatically increases after each instruction retrieval, enabling programmes to swiftly execute the subsequent instruction.

● Flag Register (F): The flag register is an 8-bit register that stores flags representing the status of specific conditions following arithmetic and logical operations. The flags are listed below:

The Carry Flag (C) is set when a carry or borrow occurs during arithmetic operations.

The Zero Flag (Z) is set when the outcome of an operation equals zero.

When an operation’s outcome is negative, the Most Significant Bit (MSB) sets the Sign Flag (S).

The Parity Flag (P) is set when the outcome of an operation exhibits even parity.

The Auxiliary Carry Flag (AC) is set when there is a carry or borrow from bit 3 to bit 4 in arithmetic operations.

Address and Data Bus

The microprocessor utilises a bidirectional 16-bit address bus to indicate the memory location or I/O device it wishes to access, enabling a maximum of 64 KB of memory. The system uses an 8-bit bidirectional data bus to transfer data between the microprocessor and memory, or I/O devices.

Addressing Modes in 8085 Microprocessor

The 8085 microprocessor employs different addressing modes to determine the location of data or instructions while executing a programme. The addressing modes dictate the method by which the processor retrieves and obtains operands. Every addressing mode offers versatility in accessing and manipulating data and instructions, enabling efficient programme execution.

Here are the commonly used addressing modes in the 8085 microprocessor:

● Immediate Addressing Mode:

In this mode, the operand is directly specified in the instruction itself.

EX. MVI B, 3EH: Move the data 3EH given in the instruction to the B register.

● Register Addressing Mode:

In this mode, the operand is specified in one of the registers of the microprocessor.

EX. MOV A, B: Move the content of the B register to the A register.

● Direct Addressing Mode:

In this mode, a memory address directly specifies the operand.

EX. LDA 1050H: Load the data available in memory location 1050H into the accumulator.

● Indirect Addressing Mode:

In this mode, the operand is specified indirectly through a register pair, usually HL. The contents of the specified register pair act as a memory address.

● Register Indirect with Displacement Addressing Mode:

In this mode, the operand is specified by adding an 8-bit signed displacement value to the contents of a register pair. The resulting sum is treated as a memory address.

EX. MOV A, M: The A register receives the memory data that the H-L pair has addressed.

● Implied Addressing Mode:

In implied addressing mode, the instruction itself specifies the data to be operated.

EX. CMA: Complement the content of the accumulator.

8085 Microprocessor Instruction Set

The 8085 microprocessor has a comprehensive instruction set that covers a wide range of operations. Here is an overview of the 8085 microprocessor instruction set categories and some representative instructions within each category:

● Data Transfer Instructions:

MOV: Move data between registers, memory, and I/O ports.

MVI: Move immediate data into a register or memory location.

LXI: Load immediate 16-bit data into a register pair.

LDA, STA: Load and store data between the accumulator and memory.

● Arithmetic Instructions:

ADD: Add data to the accumulator.

SUB: Subtract data from the accumulator.

INR, DCR: increment or decrement the value of a register or memory location.

● Logical Instructions:

AND, ORA, XOR: Perform bitwise logical operations on the accumulator with data from registers, memory, or immediate values.

CMP: Compare the accumulator with data from registers, memory, or immediate values.

● Branching Instructions:

JMP: Unconditional jump to a specific memory address.

JC, JNC, JP, JM, JZ, JNZ: Conditional jumps based on the status of the carry flag (C), parity flag (P), sign flag (M), zero flag (Z), etc.

Call: Call a subroutine at a specific memory address.

RET: Return from a subroutine.

● Stack Instructions:

Push and pop: push and pop data onto and from the stack.

XTHL: Exchange stack top with the HL register pair.

● I/O Instructions:

IN, OUT: Input and output data from/to I/O ports.

● Special Instructions:

HLT: Halt the microprocessor.

The 8085 microprocessor is a significant achievement in the evolution of computing, demonstrating the creativity and originality of its developers. Working principles and architecture have significantly influenced the development of modern technology.

Format of 8085 Microprocessor Instructions

An instruction is a directive given to the microprocessor to carry out a specific operation on a defined data set. Every instruction consists of two components: the operation code (opcode), which specifies the task to be executed, and the operand, which contains the data to be manipulated. The operand, or data, can be specified in multiple ways. The data may consist of 8-bit or 16-bit values stored in an internal register, memory location, or address. Some instructions have an implicit operand.

Opcode (1 byte):

The microprocessor must carry out the operation according to the opcode.

Operand(s)( range from 0 to 2 bytes):

The operands supply the essential data or addresses for the instruction. The number of operands and their dimensions vary according to the particular instruction. Some instructions are operand-less, while others may have one or two operands. The operands may consist of immediate values, registers, memory addresses, or a mix of these.

Word size

The 8085 instruction set is categorised into three groups based on word size.

1. One-word or 1-byte instructions 2. Two-word or 2-byte instructions 3. Three-word or 3-byte instructions

In the 8085, “byte” and “word” are synonymous because it is an 8-bit microprocessor. However, instructions are commonly referred to as bytes rather than words.

One-Byte Instructions

A 1-byte instruction includes the opcode and operand in the same byte. The operand(s) are internal registers and are coded into the instruction.

For example:

ADD B  

Here, the operand B is specified, and the accumulator is assumed. Similarly, in the third instruction, the accumulator is assumed to be the implicit operand. These instructions are stored in 8-bit binary format in memory; each requires one memory location.

Two-Byte Instructions

In a two-byte instruction, the first byte specifies the operation code, and the second byte specifies the operand. The source operand is a data byte immediately following the opcode. For example:

MVI A, Data 

Load an 8-bit data MVI byte into the accumulator. The instruction would require two memory locations to store in memory.

Three-Byte Instructions

In a three-byte instruction, the first byte specifies the opcode, and the following two specify the 16-bit address. Note that the second byte is the low-order address, and the third byte is the high-order address.

opcode + data byte + data byte

For example:

JMP 2085H 

Transfer the JMP programme sequence to the memory location 2085H. The 8085 microprocessor follows a specific instruction format for executing instructions. The general instruction format consists of one to three bytes, depending on the instruction type. Here is the breakdown of the 8085 instruction format:

Instruction Cycle

The Instruction Decoder decodes the instructions fetched from memory. It determines the type of instruction being executed and generates control signals accordingly. The decoded instructions guide the microprocessor in executing the appropriate operations.

The 8085 microprocessor has 5 basic machine cycles. They are

Opcode fetch cycle (4T) 

Memory read cycle (3 T) 

Memory write cycle (3 T) 

I/O read cycle (3 T) 

I/O write cycle (3 T)

Pin Diagram

Here’s a brief description of some of the important pins in the 8085 microprocessor pin diagram:

● Vcc: power supply voltage pin (+5V).

● A0-A15: Address bus pins for transmitting the memory address during read and write operations.

● AD0-AD7: Data bus pins for transmitting data between the microprocessor and external memory or I/O devices.

● RD: read control signal, activated by the microprocessor to initiate a read operation. WR: Write control signal, which the microprocessor activates to start a write operation.

● /RESET: Active-low reset input, used to reset the microprocessor to its initial state.

● /INT: Active-low interrupt input, used for external hardware interrupts.

● IO/M: input/output and memory control signal, used to distinguish between I/O and memory operations.

● /IORQ: Active-low input/output request signal, indicating an I/O operation.

● /MREQ: Active-low memory request signal, indicating a memory operation. 

● S0 and S1: Status output pins that indicate the current operating mode of the

microprocessor.

● HLDA: Hold acknowledge output, used to indicate that the microprocessor has recognised the HOLD request.

● HOLD: Hold input to temporarily halt the microprocessor’s operation. 

The 8085 microprocessor pin diagram provides a visual representation of the

connections and functionalities of the different pins on the 8085 microprocessor.

Intel 8085 Programmes

Write an assembly programme to add two numbers

Program

MVI D, 8BH 

MVI C, 6FH 

MOV: A, C

ADD D

OUT PORT1 

HLT

Write an assembly programme to multiply a number by 8

Program

MVI A, 30H 

RRC

RRC 

RRC

OUT PORT1 

HLT

Write an assembly programme to find the greatest between two numbers

Program

MVI B, 30H 

MVI C, 40H 

MOV A, B 

CMP C 

JZ EQU 

JC GRT 

OUT PORT1 

HLT 

EQU: MVI A, 01H 

OUT PORT1 

HLT 

GRT: MOV A, C 

OUT PORT1 

HLT