The Intel 8085 is a popular 8-bit microprocessor that was first introduced in 1976.
It was
widely used in a variety of applications, from early personal computers to embedded systems.
Here are some important notes about the Intel 8085 microprocessor:
1. Architecture: The Intel 8085 is an 8-bit microprocessor, which means it processes
data in 8-bit chunks. It has a 16-bit address bus, allowing it to address up to 64KB of
memory.
2. Registers: The 8085 has six general-purpose registers, labelled B, C, D, E, H, and L.
These registers can be used individually or in pairs (e.g., B and C can be used as a 16-
bit BC register).
3. Accumulator: The A register is also known as the accumulator and is used for most
arithmetic and logical operations. It's also the implicit destination for many
instructions.
4. Flag Register: The 8085 has a flag register that stores information about the results of
operations. The flags represent various conditions such as carry, zero, sign, parity, and
others.
5. Instruction Set: The 8085 has a rich instruction set that includes data transfer
instructions, arithmetic instructions, logical instructions, control instructions, and
more.
6. Addressing Modes: The 8085 supports various addressing modes, including
immediate, direct, register, and indirect addressing modes. This flexibility allows it to
work with different types of data and memory locations.
7. Clock Speed: The 8085 microprocessor typically operates at a clock speed of 3 MHz.
Some variations or newer versions might operate at different clock speeds.
8. Interrupts: The 8085 supports interrupt handling. It can handle five different types of
interrupts, including TRAP, RST 7.5, RST 6.5, RST 5.5, and INTR.
9. Memory Interfacing: The 8085 can address up to 64KB of memory. It uses a 16-bit
address bus and an 8-bit data bus. Memory and I/O interfacing are typically
accomplished through various instructions.
10. Assembly Language Programming: Programming the 8085 involves writing code in
assembly language, which is a low-level language. Assembly language instructions
correspond directly to machine code instructions.
11. Instruction Execution: The 8085 executes instructions in a fetch-decode-execute
cycle. It fetches an instruction from memory, decodes it, performs the operation, and
then updates the program counter.
12. Peripherals and Applications: The 8085 microprocessor has been used in various
applications, including early personal computers, traffic light control systems,
industrial automation, and more.
1
These are some of the fundamental aspects of the Intel 8085 microprocessor. Understanding
these points will provide you with a good foundation for working with the 8085 and
programming it in assembly language.
The architecture of the Intel 8085 microprocessor is a crucial aspect of understanding how
this 8-bit microprocessor works. Here's a detailed note on the architecture of the Intel 8085:
1. 8-Bit Data Bus: The 8085 microprocessor features an 8-bit data bus, which means it
can process data in 8-bit chunks or bytes. This data bus is used for transferring data
between the microprocessor and memory or peripherals.
2. 16-Bit Address Bus: The 8085 has a 16-bit address bus, allowing it to address up to
64KB of memory. It can access 2^16 (64,536) unique memory locations. The 16-bit
address bus is significant for the microprocessor's ability to access a wide range of
memory and I/O devices.
3. Registers:
Accumulator (A): The accumulator is the primary register used for most
arithmetic and logical operations. It is often the implicit destination for many
instructions.
General-Purpose Registers (B, C, D, E, H, L): These six 8-bit registers can
be used individually or paired up (B-C, D-E, H-L) to form three 16-bit
registers. These general-purpose registers are used for data manipulation and
temporary storage.
Stack Pointer (SP): The 16-bit stack pointer register is used to manage the
stack. It points to the memory location where data is pushed and popped
during subroutine calls and returns.
Program Counter (PC): The program counter is a 16-bit register that stores
the memory address of the next instruction to be fetched and executed.
4. Flag Register: The flag register holds various condition flags that reflect the results
of arithmetic and logical operations. These flags include:
Zero (Z): Set if the result of an operation is zero.
Sign (S): Reflects the sign of the result (set if negative).
Parity (P): Set if the number of set bits in the result is even.
Carry (CY): Set if an operation generates a carry out of the most significant
bit.
Auxiliary Carry (AC): Used for binary-coded decimal (BCD) arithmetic.
Overflow (O): Used for signed numbers to detect overflow in operations.
5. Registers and Their Usage:
A Register: The accumulator is used for most arithmetic and logical
operations.
2
B and C Registers (BC Pair): Often used as a 16-bit data transfer register.
D and E Registers (DE Pair): Similar to BC, used for 16-bit data transfer.
H and L Registers (HL Pair): Commonly used for 16-bit memory
addressing.
SP, PC: Stack pointer and program counter, respectively, are used for
controlling program flow.
6. Instruction Set: The 8085 microprocessor has a comprehensive instruction set,
including data transfer, arithmetic, logical, control, and input/output instructions.
These instructions are encoded as machine code and executed by the microprocessor.
7. Clock Speed: The 8085 typically operates at a clock speed of 3 MHz, although
variations and later models may have different clock speeds.
8. Addressing Modes: The 8085 supports various addressing modes, including
immediate, direct, register, and indirect addressing modes, offering flexibility in data
manipulation and memory access.
9. Interrupts: The 8085 supports various interrupt handling mechanisms, allowing the
microprocessor to respond to external events and service interrupt requests from
devices.
10. Memory Interfacing: The 8085 communicates with memory and I/O devices through
instructions that transfer data between registers and memory locations. Memory is
organized as a linear address space, and instructions facilitate read and write
operations.
Understanding the architecture of the Intel 8085 microprocessor is essential for programming
it in assembly language and interfacing it with various peripherals and memory devices. It
forms the foundation for working with this classic 8-bit microprocessor.
ALU
The Arithmetic and Logic Unit (ALU) in the Intel 8085 microprocessor is a critical
component responsible for performing arithmetic and logical operations on data. Here's an
overview of the ALU in the Intel 8085:
1. Function: The ALU performs various arithmetic and logical operations on data that
are fetched from memory or registers. It is designed to carry out operations such as
addition, subtraction, AND, OR, XOR, complementation, and shifting, among others.
2. 8-Bit ALU: The ALU in the Intel 8085 is an 8-bit ALU, which means it can operate
on 8-bit data at a time. This matches the data width of the microprocessor's data bus.
3. Input: The ALU takes inputs from the accumulator (A) and another register (often a
general-purpose register or a memory location) or immediate data. The data to be
operated upon is loaded into the ALU.
3
4. Output: After performing an operation, the ALU provides the result back to the
accumulator (A) if A is one of the operands. The result can also be stored in a register
or memory location, as determined by the instruction being executed.
5. Arithmetic Operations: The ALU can perform addition and subtraction. In the case
of subtraction, the two's complement method is used. The carry flag is often used to
manage carry and borrow in arithmetic operations.
6. Logical Operations: The ALU can perform logical operations such as AND, OR, and
XOR. These operations are essential for bitwise manipulation of data.
7. Shifting Operations: The ALU can perform logical shifts, including left shifts and
right shifts, which are crucial for manipulating binary data.
8. Flags: The ALU in the Intel 8085 updates various condition flags in the flag register
based on the result of its operations. These flags include the Zero flag (Z), Sign flag
(S), Parity flag (P), Carry flag (CY), Auxiliary Carry flag (AC), and Overflow flag
(O).
9. Conditional Branching: The ALU's result and the state of the condition flags are
often used in conditional branching instructions to determine whether a branch should
be taken based on the outcome of a previous operation.
10. Comparison Operations: By subtracting two values, the ALU can be used to
perform comparisons. The results of these comparisons can determine the
relationships between numbers, such as equality or relative magnitude.
11. Data Manipulation: The ALU is used for data manipulation and transformation in
various ways, making it an essential component for performing computations in
assembly language programs.
The ALU is a crucial part of the Intel 8085 microprocessor, responsible for executing most of
the arithmetic and logical operations that are specified by the microprocessor's instructions. It
plays a central role in data processing and control flow within the microprocessor.
In the context of microprocessors, including the Intel 8085, "flags" refer to individual binary
indicators that reflect the outcome or status of various operations or conditions. The flags in
the Intel 8085 microprocessor are stored in a special 8-bit register known as the flag register.
These flags are often used to control program flow and make decisions based on the results of
operations. Here are the key flags in the Intel 8085 microprocessor:
1. Zero Flag (Z): This flag is set if the result of an operation is zero. It is cleared if the
result is non-zero. Program flow can be controlled based on the state of this flag.
2. Sign Flag (S): The sign flag reflects the sign of the result of an operation. It is set if
the most significant bit of the result is 1 (indicating a negative number) and cleared if
it's 0 (indicating a positive number).
3. Parity Flag (P): The parity flag is set if the number of set bits (1s) in the result is
even. It is cleared if the number of set bits is odd. Parity checking is often used in data
communication and error detection.
4
4. Carry Flag (CY): The carry flag is set if an operation generates a carry out of the
most significant bit. It is used for multi-byte addition and subtraction. For example, it
can indicate an overflow in an addition operation.
5. Auxiliary Carry Flag (AC): This flag is used for binary-coded decimal (BCD)
arithmetic. It is set if there is a carry out of the low nibble (4 bits) of the result. BCD
arithmetic is used for working with decimal numbers.
6. Overflow Flag (O/V): The overflow flag is used for signed numbers and indicates if
an operation has caused a two's complement overflow. It's set when the result is too
large to be represented in the given number of bits.
These flags play a significant role in controlling program execution. Conditional branch
instructions often examine these flags to decide whether to jump to a new location in the
program or continue executing the next instruction. For example, you might jump to an error-
handling routine if the zero flag is set, indicating an error condition.
Programmers need to be mindful of these flags when writing assembly language programs, as
they are used for decision-making and ensuring correct program behavior. Understanding the
impact of various instructions on these flags is crucial for effective programming with the
Intel 8085 microprocessor.
The Intel 8085 microprocessor has a standard set of pins used for various functions, including
data and address bus connections, control signals, and power supply. Below is the pin
configuration of the Intel 8085 microprocessor:
1. A15-A8 (Address Bus): These pins are used to transmit the most significant 8 bits of
the 16-bit memory address during the address phase of the machine cycle.
2. AD7-AD0 (Data Bus): These pins are used to transmit 8-bit data between the
microprocessor and memory or peripherals.
3. S0 and S1 (Status Lines): These pins are used to indicate the status of the
microprocessor. They provide information about the type of operation currently being
performed.
4. A19/S3 (Address Status Lines): The A19 pin is used for addressing memory
locations beyond 64KB in some variations. In the original 8085, this pin was labeled
as S3 and used for status information.
5. RD (Read): This pin is used to signal that the microprocessor is performing a read
operation. It is active low, meaning it goes low when a read operation is initiated.
6. WR (Write): This pin is used to signal that the microprocessor is performing a write
operation. It is active low, meaning it goes low when a write operation is initiated.
7. IO/M (Input/Output and Memory): This pin determines whether the operation is an
input/output operation or a memory operation. It is low for memory operations and
high for input/output operations.
5
8. S2 (Status Line): S2 is one of the status lines that provides additional information
about the microprocessor's status during machine cycles.
9. CLK (Clock): The clock input is used to provide the timing signal to synchronize the
microprocessor's operation. It typically operates at a frequency of 3 MHz.
10. RESET IN (Reset Input): This pin is used for resetting the microprocessor. When a
high voltage is applied to this pin, the microprocessor is reset.
11. VCC (+5V): This pin is connected to a +5V power supply, providing the required
operating voltage to the microprocessor.
12. GND (Ground): This is the ground connection, providing the reference voltage for
the microprocessor.
13. Hold and Hold Acknowledge (HLDA and HOLD): These pins are used for
interrupt handling. When another device requests control of the system bus, the
HLDA signal indicates that the microprocessor is in a hold state, and HOLD is used
by the requesting device to initiate the hold request.
14. Interrupt Request (INTR): This pin is used for interrupt requests. External devices
can use this pin to request an interrupt, causing the microprocessor to service the
interrupt.
15. Serial Output Data (SID) and Serial Input Data (SOD): These pins are used for
serial data communication. The 8085 microprocessor can send and receive serial data
through these pins.
16. READY: The READY input is used to slow down the microprocessor's operation.
When this pin is high, the microprocessor waits for it to go low before executing the
next instruction.
17. Hold Acknowledge Out (HLDA): This pin is used to acknowledge the hold request
initiated by another device.
18. Two Ground Pins (GND): Additional ground connections.
Please note that the pin configuration may vary slightly depending on the manufacturer and
package type. The above description provides a general overview of the typical pin
configuration of the Intel 8085 microprocessor. It's essential to consult the specific datasheet
or documentation for the particular variant you are working with for precise details.
INSTRUCTIONS
The Intel 8085 microprocessor has a rich set of instructions that allow you to perform a wide
range of operations, from simple data transfers to complex arithmetic and logical
calculations. Below is an overview of the categories of instructions in the Intel 8085
instruction set:
1. Data Transfer Instructions:
6
MOV: Move data from a source register/memory location to a destination
register/memory location.
MVI: Move immediate data (8-bit) into a register or memory location.
LXI: Load immediate data (16-bit) into register pairs.
LDA and STA: Load Accumulator and Store Accumulator to memory.
LHLD and SHLD: Load H and L Registers and Store H and L Registers with
a 16-bit address.
2. Arithmetic Instructions:
ADD, ADC: Add two registers or memory locations (with carry).
SUB, SBB: Subtract two registers or memory locations (with borrow).
INR and DCR: Increment and decrement a register/memory location.
DAD: Double Add - Add two register pairs.
CMA and CMC: Complement Accumulator and Complement Carry.
DAA: Decimal Adjust Accumulator (for BCD arithmetic).
INX and DCX: Increment and decrement register pairs.
DCX and INX: Decrement and increment register pairs.
3. Logical Instructions:
ANA, XRA, ORA: Perform logical AND, XOR, and OR operations between
the accumulator and another register/memory location.
CPI: Compare with Immediate (similar to subtraction but without storing the
result).
4. Rotate Instructions:
RLC and RRC: Rotate Accumulator Left/Right through Carry.
RAL and RAR: Rotate Accumulator Left/Right through Accumulator and
Carry.
5. Branching Instructions:
NOP: No operation (used for timing and alignment).
HLT: Halt the microprocessor.
DI and EI: Disable and enable interrupts.
SIM and RIM: Set and read status information of interrupt system.
6. Stack Instructions:
PUSH and POP: Push and pop register pairs onto/from the stack.
7
XTHL: Exchange stack pointer with HL register pair.
SPHL: Load stack pointer from HL register pair.
HLTS: Halt and Stack Pointer Transfer.
7. Control Instructions:
NOP: No operation (used for timing and alignment).
HLT: Halt the microprocessor.
DI and EI: Disable and enable interrupts.
SIM and RIM: Set and read status information of interrupt system.
8. Input/Output Instructions:
IN and OUT: Input and output data from/to specified ports.
STAX and LDAX: Store Accumulator and Load Accumulator from specified
addresses in memory.
XCHG: Exchange HL register pair with DE register pair.
9. Conditional Branching Instructions:
JMP: Jump unconditionally.
CALL: Call a subroutine.
RET: Return from subroutine.
Conditional jumps like JZ, JNZ, JP, JM, etc., based on the condition flags.
10. Interrupt Instructions:
RST: Restart the microprocessor at specific memory locations.
DI and EI: Disable and enable interrupts.
These are some of the key instructions in the Intel 8085 microprocessor's instruction set. Each
instruction performs a specific operation, and programmers use these instructions to write
assembly language programs that control the microprocessor's behavior and perform various
tasks. The exact syntax and usage of these instructions can vary, so it's essential to consult the
microprocessor's documentation or a reference guide for detailed information.
OPCODE AND OPEARANDS
In computer programming and assembly language, an "opcode" and "operands" are
fundamental components of an instruction that dictate what operation the CPU should
perform and what data or registers should be used as input for that operation. These terms are
relevant to both the Intel 8085 microprocessor and general assembly language programming:
8
1. Opcode:
The opcode is a short mnemonic or code that represents the specific operation
or instruction that the CPU should execute.
In assembly language, opcodes are typically written in human-readable text
form to specify what action the CPU should take. For example, "ADD,"
"MOV," "SUB," "JMP" are opcodes.
The opcode is an essential part of an assembly language instruction and is
usually the first part of an instruction.
In machine code, opcodes are represented as binary values or hexadecimal
codes that the CPU directly interprets.
2. Operands:
Operands are the data or registers that are involved in the operation specified
by the opcode. They are the parameters or inputs for the instruction.
The number of operands and their format (e.g., registers, memory addresses,
constants) can vary based on the opcode and the specific instruction.
For example, in the instruction ADD A, B, "ADD" is the opcode, and "A" and
"B" are the operands. This instruction adds the value of register A to register
B.
Operands are usually separated from the opcode by commas in assembly
language instructions.
Here's an example of how opcodes and operands work in Intel 8085 assembly language:
assemblyCopy code
ADD A, B ; ADD opcode with two operands, A and B MOV C, 42H ; MOV opcode with one
operand, C, and an immediate value, 42H SUB M ; SUB opcode with one operand, M (which
means memory location) JMP LABEL ; JMP opcode with one operand, LABEL (an address)
In the examples above:
"ADD," "MOV," "SUB," and "JMP" are the opcodes that specify the operations.
"A," "B," "C," "M," and "LABEL" are the operands, representing registers, memory
locations, or labels (for branching).
The specific combinations of opcodes and operands, as well as their meanings, are defined in
the instruction set architecture of the CPU (in this case, the Intel 8085). Programmers use
these opcodes and operands to write assembly language programs that control the
microprocessor's behavior and perform various tasks.
INSTRUCTION WORD SIZE
9
The instruction word size of the Intel 8085 microprocessor is 8 bits (1 byte). Each instruction
in the Intel 8085 assembly language is encoded as an 8-bit binary value, which is fetched
from memory and executed by the microprocessor. These 8 bits are used to specify the
operation (opcode) and any associated operands or addressing modes.
Because the instruction word size is 8 bits, the Intel 8085 has a relatively compact and
efficient instruction set, which is typical of 8-bit microprocessors. This compactness makes it
suitable for embedded systems and other applications with limited memory and processing
capabilities.
10