8085 Features, Internal Architecture & Pin Configuration
Open in the Padhaiko app2.1 Features of 8085
The Intel 8085 is an 8-bit, general-purpose microprocessor introduced in 1976 by Intel Corporation as an advanced upgrade to the earlier 8080. Fabricated using high-density N-channel Silicon Gate (NMOS) technology, it integrates approximately 6,500 transistors onto a single silicon die packaged in a 40-pin Dual In-line Package (DIP).
Key Technical Features of Intel 8085
- 8-Bit Word Architecture: Handles 8-bit binary words natively. Its internal data registers, Accumulator, Arithmetic Logic Unit (ALU), and internal data bus are all 8 bits wide.
- 16-Bit Address Bus (64 KB Memory): The 16-bit address bus (split into high-order
A8–A15and time-multiplexed low-orderAD0–AD7) can uniquely address2^16 = 65,536 bytes(64 KB) of physical memory space spanning from0000HtoFFFFH. - Time-Multiplexed Address/Data Bus: To fit within a standard 40-pin package, the lower 8 address lines (
A0–A7) and the 8 data lines (D0–D7) share eight common bidirectional pins designatedAD0–AD7. The Address Latch Enable (ALE) control strobe demultiplexes these lines externally. - Single Power Supply: Operates from a single +5 V DC power supply relative to ground (
Vss), eliminating the complex triple-voltage power supplies (+5 V, -5 V, +12 V) mandated by the older 8080. - On-Chip Clock Generator: Incorporates an internal clock generator circuit. An inexpensive external quartz crystal, LC tank, or RC network is connected between pins
X1andX2. The internal operating frequency is exactly half the external crystal frequency (a 6.144 MHz crystal yields a standard 3.072 MHz internal CPU clock; 8085A-2 operates at 5 MHz). - Vectored Hardware Interrupt Structure: Features five hardware interrupt pins:
TRAP(highest priority, non-maskable, vectored to0024H),RST 7.5(vectored to003CH),RST 6.5(vectored to0034H),RST 5.5(vectored to002CH), andINTR(lowest priority, maskable, non-vectored handshaking line). - Built-in Serial I/O Interface: Includes two dedicated serial data pins: SID (Serial Input Data) and SOD (Serial Output Data), controlled via the
RIM(Read Interrupt Mask) andSIM(Set Interrupt Mask) instructions without requiring external UART ICs. - DMA Controller Compatibility: Provides
HOLDandHLDA(Hold Acknowledge) lines that interface directly with Direct Memory Access (DMA) controllers (such as the Intel 8257/8237) for high-speed block data transfers between memory and peripheral devices.
2.2 Internal architecture of 8085
The internal architecture of the 8085 microprocessor is organized into seven functional sections interconnected by an internal 8-bit bidirectional CPU data bus:
+-----------------------------------------------------------------------------+
| INTEL 8085 INTERNAL ARCHITECTURE |
| |
| +--------------------+ +--------------------+ +-----------------------+ |
| | Interrupt Control | | Serial I/O Control | | Timing & Control Unit | |
| | - TRAP, RST 7.5 | | - SID (Pin 5) | | - X1, X2, CLK OUT | |
| | - RST 6.5, 5.5 | | - SOD (Pin 4) | | - ALE, RD#, WR# | |
| | - INTR, INTA# | | | | - IO/M#, S1, S0 | |
| +--------------------+ +--------------------+ +-----------------------+ |
| | | ^ |
| +-----------+-----------+-------------------------+ |
| | Internal 8-Bit CPU Data Bus |
| v |
| +-----------------------+ +-------------------+ +---------------------+ |
| | Accumulator (A) | | Temporary Reg (8) | | Flag Register (5) | |
| | 8-bit Register | | (Internal to ALU) | | S, Z, AC, P, CY | |
| +-----------------------+ +-------------------+ +---------------------+ |
| \ / ^ |
| \ / | Status |
| v v | |
| +-------------------------------+ | |
| | Arithmetic Logic Unit (ALU) |--------------------+ |
| +-------------------------------+ |
| | |
| v |
| +-----------------------------------------------------------------------+ |
| | REGISTER ARRAY | |
| | | |
| | +-------------------+-------------------+ +--------------------+ | |
| | | B (8 bits) | C (8 bits) | | Instruction Reg(IR)| | |
| | +-------------------+-------------------+ +--------------------+ | |
| | | D (8 bits) | E (8 bits) | | | |
| | +-------------------+-------------------+ v | |
| | | H (8 bits) | L (8 bits) | +--------------------+ | |
| | +-------------------+-------------------+ | Instruction Decoder| | |
| | | W (8 bits) | Z (8 bits) | | and Machine | | |
| | | (Internal) | (Internal) | | Cycle Encoder | | |
| | +-------------------+-------------------+ +--------------------+ | |
| | | Stack Pointer (SP, 16 bits) | | | |
| | +---------------------------------------+ v | |
| | | Program Counter (PC, 16 bits) | Timing Control Logic | |
| | +---------------------------------------+ | |
| +-----------------------------------------------------------------------+ |
| | Address Buffer (8) | Address/Data Buffer | |
| v v | |
| A15 - A8 (Pins 28-21) AD7 - AD0 (Pins 19-12) | |
+-----------------------------------------------------------------------------+Detailed Functional Components
1. Register Array
- Accumulator (Register A): An 8-bit register that serves as the primary source operand and destination for all ALU arithmetic, logical, I/O, and load/store operations.
- General-Purpose Registers (B, C, D, E, H, L): Six 8-bit programmable registers. They can be used as individual 8-bit working registers or paired as three 16-bit register pairs:
B-CpairD-EpairH-Lpair: Serves as the primary 16-bit Memory Pointer (M) to address any byte in the 64 KB memory space ([HL]).
- Temporary Registers (W and Z): An internal 8-bit register pair used exclusively by the control unit to hold 16-bit addresses or operands during instructions like
XCHGorCALL. They are completely invisible to the programmer. - Program Counter (PC): A 16-bit special-purpose register that always stores the memory address of the next sequential instruction byte to be fetched from memory. It increments automatically after each opcode/operand fetch.
- Stack Pointer (SP): A 16-bit special-purpose register that holds the memory address of the current top of the LIFO (Last-In First-Out) stack structure located in RAM. It is decremented during
PUSHandCALLoperations, and incremented duringPOPandREToperations.
2. Arithmetic and Logic Unit (ALU)
The 8-bit ALU carries out all numerical arithmetic (binary addition, subtraction, increment, decrement) and logical operations (AND, OR, XOR, complement, rotate). Operands arrive from the Accumulator and the internal 8-bit Temporary Register; the calculation result is stored back into the Accumulator, simultaneously updating the five status flags.
3. Flag Register (Status Register)
The 8085 contains an 8-bit status register containing five active 1-bit flip-flops that record conditional outcomes of the latest ALU operation:
Bit: 7 6 5 4 3 2 1 0
+-----+-----+-----+-----+-----+-----+-----+-----+
| S | Z | X | AC | X | P | X | CY |
+-----+-----+-----+-----+-----+-----+-----+-----+
(X = Undefined / Don't Care bit)| Flag Symbol | Bit | Flag Name | Set Condition (Logic 1) | Reset Condition (Logic 0) |
|---|---|---|---|---|
| S | D7 | Sign Flag | Set if MSB (D7) of the ALU result is 1 (indicating a negative number in two's complement). | Reset if D7 of the result is 0 (positive). |
| Z | D6 | Zero Flag | Set if the entire 8-bit ALU result is equal to 00H. | Reset if the ALU result is non-zero. |
| AC | D4 | Auxiliary Carry | Set if a binary carry is generated from bit D3 into bit D4 during arithmetic. Used by DAA (Decimal Adjust Accumulator). | Reset if no carry occurs from bit D3 to D4. Not testable by jump instructions. |
| P | D2 | Parity Flag | Set if the 8-bit result contains an even number of 1s (even parity). | Reset if the result contains an odd number of 1s (odd parity). |
| CY | D0 | Carry Flag | Set if an arithmetic addition generates a carry out of bit D7, or subtraction requires a borrow into D7. | Reset if no carry or borrow occurs out of D7. |
4. Instruction Register and Decoder
During the Opcode Fetch machine cycle, the 8-bit instruction opcode is read from memory over AD0–AD7 and placed into the Instruction Register (IR). The Instruction Decoder decodes the bit patterns and drives the Timing and Control Unit to sequence the required micro-operations.
5. Timing and Control Unit
Generates clock pulses and control strobes to synchronize internal operations and external bus handshakes:
- Control Signals:
RD_bar(Memory/IO Read),WR_bar(Memory/IO Write),ALE(Address Latch Enable). - Status Signals:
IO/M_bar,S1,S0that indicate the current machine cycle type.
| Machine Cycle Type | IO/M_bar | S1 | S0 | Control Strobe |
|---|---|---|---|---|
| Opcode Fetch (OF) | 0 | 1 | 1 | RD_bar = 0 |
| Memory Read (MR) | 0 | 1 | 0 | RD_bar = 0 |
| Memory Write (MW) | 0 | 0 | 1 | WR_bar = 0 |
| I/O Read (IOR) | 1 | 1 | 0 | RD_bar = 0 |
| I/O Write (IOW) | 1 | 0 | 1 | WR_bar = 0 |
| Interrupt Acknowledge (INA) | 1 | 1 | 1 | INTA_bar = 0 |
| Halt (HLT) | Z | 0 | 0 | None (Floating) |
2.3 Pin configurations of 8085
The 8085 is housed in a standard 40-pin Dual In-line Package (DIP). Its pins are divided into six functional groups:
+-------+--+-------+
X1 -- | 1 40 | -- Vcc (+5 V)
X2 -- | 2 39 | -- HOLD
RESET OUT -- | 3 38 | -- HLDA
SOD -- | 4 37 | -- CLK OUT
SID -- | 5 36 | -- RESET IN#
TRAP -- | 6 35 | -- READY
RST 7.5 -- | 7 34 | -- IO/M#
RST 6.5 -- | 8 INTEL 33 | -- S1
RST 5.5 -- | 9 8085 32 | -- RD#
INTR -- | 10 31 | -- WR#
INTA# -- | 11 30 | -- ALE
AD0 -- | 12 29 | -- S0
AD1 -- | 13 28 | -- A15
AD2 -- | 14 27 | -- A14
AD3 -- | 15 26 | -- A13
AD4 -- | 16 25 | -- A12
AD5 -- | 17 24 | -- A11
AD6 -- | 18 23 | -- A10
AD7 -- | 19 22 | -- A9
Vss (GND) -- | 20 21 | -- A8
+------------------+Functional Pin Classification
- Address Bus (
A8–A15, Pins 21–28):- Output lines, tristate. Carries the most significant 8 bits of the 16-bit memory address.
- Multiplexed Address/Data Bus (
AD0–AD7, Pins 12–19):- Bidirectional lines, tristate. During T1 of a machine cycle, they emit the least significant 8 bits of the memory address (
A0–A7). During T2–T4, they serve as the bidirectional 8-bit data bus (D0–D7).
- Bidirectional lines, tristate. During T1 of a machine cycle, they emit the least significant 8 bits of the memory address (
- Control and Status Signals:
- ALE (Address Latch Enable, Pin 30): Output pulse emitted during clock cycle T1 of every machine cycle. A high-to-low transition of ALE signals external latches (e.g., 74LS373) to capture
A0–A7fromAD0–AD7. - RD_bar (Read Control, Pin 32): Active low output indicating memory or an I/O device is to be read onto the data bus.
- WR_bar (Write Control, Pin 31): Active low output indicating data on the data bus is to be written into the addressed memory location or I/O port.
- IO/M_bar (Input-Output / Memory, Pin 34): Output status line. Logic 0 indicates a memory access operation; Logic 1 indicates an I/O access operation.
- S1 (Pin 33) and S0 (Pin 29): Status outputs that identify the exact machine cycle category alongside
IO/M_bar.
- ALE (Address Latch Enable, Pin 30): Output pulse emitted during clock cycle T1 of every machine cycle. A high-to-low transition of ALE signals external latches (e.g., 74LS373) to capture
- Power Supply and Clock Pins:
- Vcc (Pin 40): +5 V DC power supply input.
- Vss (Pin 20): Ground reference (0 V).
- X1, X2 (Pins 1, 2): Input connections for quartz crystal or RC network to set internal operating frequency.
- CLK OUT (Clock Output, Pin 37): Output clock signal at the internal operating frequency (f_clock = f_crystal / 2), used to synchronize peripheral ICs.
- Interrupt and Externally Initiated Signals:
- TRAP (Pin 6): Highest priority, non-maskable, edge-and-level sensitive hardware interrupt (vectored to
0024H). - RST 7.5 (Pin 7): Maskable, positive-edge triggered interrupt (vectored to
003CH). - RST 6.5 (Pin 8): Maskable, active-high level-triggered interrupt (vectored to
0034H). - RST 5.5 (Pin 9): Maskable, active-high level-triggered interrupt (vectored to
002CH). - INTR (Pin 10): General-purpose, active-high maskable interrupt request.
- INTA_bar (Pin 11): Active-low interrupt acknowledge emitted by CPU in response to INTR.
- TRAP (Pin 6): Highest priority, non-maskable, edge-and-level sensitive hardware interrupt (vectored to
- Reset and Bus Control Signals:
- RESET IN_bar (Pin 36): Active-low input. Pulling this pin low resets the Program Counter to
0000H, clears the interrupt mask and instruction registers, tristates the buses, and resets internal flip-flops. Must be held low for at least 3 clock cycles. - RESET OUT (Pin 3): Active-high output indicating the CPU is being reset. Used to reset peripheral chips synchronously.
- HOLD (Pin 39): Active-high input from DMA controllers requesting CPU to relinquish control of system buses.
- HLDA (Pin 38): Active-high output from CPU acknowledging HOLD request and confirming system buses are in the High-Impedance state.
- READY (Pin 35): Active-high input used to interface slow memory or I/O devices. When pulled low during T2, the CPU inserts Wait states (Tw) until READY goes high.
- SID (Pin 5) / SOD (Pin 4): Serial input data line and serial output data line.
- RESET IN_bar (Pin 36): Active-low input. Pulling this pin low resets the Program Counter to
Demultiplexing the Address/Data Bus (AD0–AD7)
Because AD0–AD7 carries address information only during state T1 and switches to data during T2–T4, memory chips cannot connect directly to these lines. An external octal transparent D-latch (such as the 74LS373) must be wired between the CPU and the system bus:
+-------------------------+
| INTEL 8085 CPU |
| |
| A15 - A8 (Pins 21-28) |-------------------> Higher Address Bus (A15-A8)
| |
| AD7 - AD0 (Pins 12-19)|---------+---------> Bidirectional Data Bus (D7-D0)
| | |
| ALE (Pin 30) |---+ |
+-------------------------+ | |
| |
v v
+---------------+
| 74LS373 |
| Octal Latch |
ALE --------> | G (Enable) |
| |
AD7 - AD0 --> | D7 - D0 |
| |
GND --------> | OE# |
| |
| Q7 - Q0 |
+---------------+
|
v
Lower Address Bus (A7 - A0)- During state T1, the CPU outputs the lower 8 address bits (
A0–A7) ontoAD0–AD7and asserts ALE high. The 74LS373 latch enable (G) is driven high, causing the latch outputsQ7–Q0to followD7–D0. - Towards the end of T1, ALE transitions from high to low. This falling edge freezes (latches) the current logic states of
A0–A7ontoQ7–Q0. - During states T2, T3, and T4, the CPU floats the address on
AD0–AD7and uses the pins as the data bus (D0–D7). The 74LS373 continues to hold the stable lower address bits (A0–A7), presenting a full 16-bit static address (A15–A0) to external memory throughout the entire read or write cycle.
Worked Examples
1
An Intel 8085 microprocessor executes the following assembly instruction sequence: MVI A, 79H MVI B, 98H ADD B
- Compute the 8-bit binary sum stored in the Accumulator after
ADD B. - Determine the binary state (0 or 1) of all five status flags: Sign (S), Zero (Z), Auxiliary Carry (AC), Parity (P), and Carry (CY).
- Express the complete 8-bit Flag Register content as a hexadecimal byte, assuming undefined bits (D5, D3, D1) are logic 0.
Binary Conversion and Bitwise Addition: Convert hexadecimal operands to 8-bit binary:
Accumulator (A) = 79H = 0111 1001BRegister B = 98H = 1001 1000B
Perform binary addition bit by bit:
Bit: 7 6 5 4 3 2 1 0
Carry: 1 1 1 1 0 0 0 0
0 1 1 1 1 0 0 1 (79H)
+ 1 0 0 1 1 0 0 0 (98H)
-------------------
Sum: 0 0 0 1 0 0 0 1 (11H) with Carry Out of bit 7 = 1- Lower nibble:
1001B + 1000B = 0001Bwith carry out of bit 3 into bit 4 (AC = 1). - Upper nibble:
0111B + 1001B + 1 = 0001Bwith carry out of bit 7 (CY = 1).
Accumulator receives 0001 0001B = 11H.
Evaluating Each 8085 Status Flag:
Assembling the Flag Register Byte: Flag Register format: S, Z, X, AC, X, P, X, CY where X = 0:
- Bit 7 (S) = 0
- Bit 6 (Z) = 0
- Bit 5 (X) = 0
- Bit 4 (AC) = 1
- Bit 3 (X) = 0
- Bit 2 (P) = 1
- Bit 1 (X) = 0
- Bit 0 (CY) = 1
Binary bit pattern: 0001 0101B. Converting to hexadecimal: 0001B = 1H, 0101B = 5H -> 15H.
- Accumulator contents =
0001 0001B= 11H. - Flags: S = 0, Z = 0, AC = 1, P = 1, CY = 1.
- Flag register byte in hexadecimal = 15H.
2
An 8085 microprocessor system is driven by a 6.144 MHz quartz crystal connected across pins X1 and X2.
- Find the internal operating clock frequency of the microprocessor and the frequency available at the CLK OUT pin.
- Calculate the time duration of one T-state in nanoseconds.
- Determine the execution time in microseconds for:
- A 4 T-state instruction (e.g.,
MOV A, B). - A 7 T-state instruction (e.g.,
MVI A, 32H). - A 10 T-state instruction (e.g.,
IN 01H).
- A 4 T-state instruction (e.g.,
1. Computing the Internal Clock Frequency: The 8085 contains an internal divide-by-2 flip-flop circuit: f_internal = f_crystal / 2. f_internal = 6.144 MHz / 2 = 3.072 MHz. The CLK OUT pin outputs the internal clock frequency: f_CLK_OUT = 3.072 MHz.
2. Computing the Period of One T-State: One T-state corresponds to one period of the internal clock: T = 1 / f_internal = 1 / (3.072 * 10^6 Hz) T = 0.32552 * 10^-6 seconds = 325.52 nanoseconds.
3. Computing Instruction Execution Durations:
- 4 T-State Instruction: T_exec = 4 * 325.52 ns = 1,302.08 ns = 1.302 microseconds.
- 7 T-State Instruction: T_exec = 7 * 325.52 ns = 2,278.64 ns = 2.279 microseconds.
- 10 T-State Instruction: T_exec = 10 * 325.52 ns = 3,255.20 ns = 3.255 microseconds.
- Internal clock frequency and CLK OUT frequency = 3.072 MHz.
- Duration of one T-state = 325.52 ns.
- Execution times: 4 T-states = 1.302 microseconds; 7 T-states = 2.279 microseconds; 10 T-states = 3.255 microseconds.
3
(Tribhuvan University Past exam questions Guide) Draw the internal functional block diagram of the Intel 8085 microprocessor and explain the roles of:
- The Accumulator, Temporary Register, and W-Z register pair.
- The Timing and Control Unit signals: ALE, IO/M_bar, RD_bar, and WR_bar.
- The demultiplexing circuit required to separate AD0–AD7 using an external 74LS373 latch.
1. Internal Registers Functionality:
- Accumulator (A, 8-bit): The primary operating register of the CPU. Holds one of the operands before an ALU operation and always receives the result of arithmetic, logic, and byte-load operations.
- Temporary Register (8-bit): Internal register feeding the second ALU operand input; loaded automatically from memory or general registers. Inaccessible to the programmer.
- W and Z Registers (8 bits each): 16-bit temporary register pair used internally by the control logic to hold 16-bit memory addresses during instructions like
XCHG,CALL, andLHLD. Invisible to assembly language programmers.
2. Timing and Control Signals:
- ALE (Address Latch Enable): Active-high pulse emitted in state T1 of every machine cycle. Its falling edge signals external latches to capture the valid memory address on
AD0–AD7. - IO/M_bar: Status signal distinguishing memory from I/O transactions. When low (0), the operation targets memory; when high (1), it targets an I/O port.
- RD_bar (Read Control): Active-low strobe indicating the selected memory location or I/O port should place data onto the system data bus.
- WR_bar (Write Control): Active-low strobe indicating the data currently on the system data bus is valid and should be latched into the selected memory or I/O location.
3. Demultiplexing AD0–AD7 with 74LS373:
- Connect CPU
AD0–AD7to latch inputsD0–D7and system data bus. - Connect CPU
ALEto latch enable pinG. Connect latch output controlOE_barto GND. - During T1, ALE is high, making the latch transparent. Lower address bits
A0–A7pass to latch outputsQ0–Q7. - As T1 ends, ALE drops low, freezing
A0–A7onQ0–Q7for the remainder of the machine cycle. - During T2–T4,
AD0–AD7pins are free to transport bidirectional dataD0–D7while the latch continuously supplies stable address linesA0–A7.
The 8085 combines an 8-bit Accumulator, temporary registers (Temp, W, Z), and a 16-bit register array with an ALU. Control lines ALE, IO/M_bar, RD_bar, and WR_bar govern memory and I/O bus cycles. An external 74LS373 transparent octal latch clocked by the falling edge of ALE separates static address lines A0–A7 from bidirectional data bus lines D0–D7.
Exercises
Exercises
List any six important features of the Intel 8085 microprocessor. Explain why the address and data bus lines AD0–AD7 are multiplexed and how this affects chip packaging.
Six Key Features of Intel 8085:
- 8-bit general-purpose CPU fabricated using NMOS technology with ~6,500 transistors.
- 16-bit address bus addressing up to 64 KB of memory (
0000H–FFFFH). - Single +5 V DC power supply operation relative to ground.
- On-chip clock generator requiring only an external crystal between X1 and X2 (operating at f_crystal / 2).
- Built-in five-level hardware vectored interrupt structure (TRAP, RST 7.5, RST 6.5, RST 5.5, INTR).
- Integrated serial input (SID) and serial output (SOD) communication lines.
Why AD0–AD7 Lines are Multiplexed:
- In an 8-bit CPU with a 16-bit address bus and an 8-bit data bus, dedicating separate pins for 16 address lines and 8 data lines would require 24 pins solely for bus transfers.
- Adding control lines (RD, WR, ALE, IO/M, S0, S1), interrupts (TRAP, RSTs, INTR, INTA), clock pins (X1, X2, CLK OUT), DMA pins (HOLD, HLDA), reset pins, serial I/O (SID, SOD), and power supply (Vcc, Vss) would exceed 48 pins.
- In 1976, 40-pin Dual In-line Packages (DIP) were the industry-standard, cost-effective packaging format. By multiplexing the lower 8 address lines (
A0–A7) and 8 data lines (D0–D7) onto eight shared pins (AD0–AD7), Intel saved 8 physical IC pins, allowing the entire processor to fit neatly into an economical 40-pin package.
Key features include 8-bit word width, 64 KB addressing, single +5 V supply, on-chip clock generation, five vectored interrupts, and serial I/O. Multiplexing the lower address and data lines as AD0–AD7 saves 8 pins, allowing the processor to fit into a cost-effective standard 40-pin DIP.
Describe the internal architecture of the Intel 8085 microprocessor with a focus on its register structure: Accumulator, general-purpose registers, Program Counter (PC), Stack Pointer (SP), and temporary registers W and Z.
Overview of 8085 Register Structure: The 8085 internal architecture contains twelve registers categorized by function:
- Accumulator (Register A, 8-bit): The primary operating register. It feeds one operand to the ALU and receives the final result of all arithmetic and logical operations.
- General-Purpose Registers (B, C, D, E, H, L, 8-bit each): Used by the programmer to store temporary operands and intermediate variables. They can be operated as single 8-bit registers or paired as three 16-bit register pairs:
BC,DE, andHL. TheHLpair acts as the designated memory pointerM. - Program Counter (PC, 16-bit): Holds the memory address of the next sequential instruction byte to fetch. It increments automatically after each byte fetch.
- Stack Pointer (SP, 16-bit): Holds the memory address of the current top of the LIFO stack maintained in RAM. It decrements by 2 on
PUSHandCALL, and increments by 2 onPOPandRET. - Temporary Registers (W and Z, 8-bit each): An internal 16-bit register pair used exclusively by the control unit to store 16-bit addresses or temporary data during instruction execution (such as
XCHGorCALL). They are invisible to programmers.
The 8085 register array contains an 8-bit Accumulator for ALU operations, six 8-bit general registers (B, C, D, E, H, L) operable individually or as 16-bit pairs (BC, DE, HL as memory pointer M), a 16-bit Program Counter (PC), a 16-bit Stack Pointer (SP), and an internal non-programmable 16-bit temporary pair (W-Z).
Define the five status flags of the Intel 8085 microprocessor. Determine the contents of the Accumulator and the status of all five flags after the execution of the instruction SUB A.
The Five Status Flags of Intel 8085:
- Sign Flag (S): Equal to bit D7 of the ALU result (1 if negative, 0 if positive).
- Zero Flag (Z): Set to 1 if the ALU result is strictly
00H; cleared to 0 otherwise. - Auxiliary Carry (AC): Set to 1 if a carry/borrow occurs between bit D3 and bit D4.
- Parity Flag (P): Set to 1 if the result contains an even number of 1s (even parity); cleared to 0 for odd parity.
- Carry Flag (CY): Set to 1 if an arithmetic addition produces a carry out of D7, or subtraction requires a borrow into D7.
Executing SUB A: The instruction SUB A subtracts the contents of the Accumulator from itself: A <- A - A = 00H = 0000 0000B. Evaluating flags on result 00H:
- Sign Flag (S): Bit D7 is 0 -> S = 0.
- Zero Flag (Z): The result is zero -> Z = 1.
- Auxiliary Carry (AC): Subtraction of identical nibbles (
x - x) produces no borrow -> AC = 0. - Parity Flag (P):
0000 0000Bcontains zero 1s; zero is mathematically an even number -> P = 1. - Carry Flag (CY): No borrow is required out of bit 7 -> CY = 0.
Executing SUB A sets the Accumulator to 00H. The status flags are: Sign S = 0, Zero Z = 1, Auxiliary Carry AC = 0, Parity P = 1, and Carry CY = 0.
Explain the functions of the following 8085 pins:
- ALE (Address Latch Enable)
- IO/M_bar
- READY
- HOLD and HLDA
- RESET IN_bar and RESET OUT
Pin Function Explanations:
- ALE (Pin 30): Positive-going pulse emitted by the CPU during state T1 of every machine cycle. Its falling edge latches the lower 8 address bits (
A0–A7) fromAD0–AD7into an external latch (74LS373). - IO/M_bar (Pin 34): Status output. Logic 0 indicates a memory access cycle (e.g., Memory Read/Write); Logic 1 indicates an I/O device access cycle (e.g., I/O Read/Write).
- READY (Pin 35): Input signal used to synchronize slow memory or I/O devices with the CPU. If READY is logic 0 during T2, the CPU inserts Wait states (Tw) until READY goes high.
- HOLD (Pin 39) & HLDA (Pin 38):
- HOLD: Input from DMA controller requesting the CPU to float its address, data, and control buses.
- HLDA: Output acknowledge from CPU indicating the buses have been relinquished into the High-Impedance state.
- RESET IN_bar (Pin 36) & RESET OUT (Pin 3):
- RESET IN_bar: Active-low input that resets the CPU (clears PC to 0000H, resets interrupt masks, tristates buses).
- RESET OUT: Output from CPU to synchronously reset connected peripheral ICs.
ALE latches lower address bits A0–A7; IO/M_bar selects between memory (0) and I/O (1) bus cycles; READY inserts Wait states for slow peripherals; HOLD/HLDA manage DMA bus arbitration; and RESET IN_bar/RESET OUT handle system initialization.
A high-speed 8085-based industrial controller connects a 12 MHz quartz crystal across pins X1 and X2.
- Determine the internal clock frequency of the microprocessor.
- Calculate the period of one T-state in nanoseconds.
- Compute the execution time of the instruction
CALL 4000H, which requires 5 machine cycles and 18 T-states.
1. Computing Internal Clock Frequency: The internal clock frequency is half the crystal frequency: f_clock = f_crystal / 2 = 12 MHz / 2 = 6.0 MHz = 6 * 10^6 Hz.
2. Period of One T-State: T = 1 / f_clock = 1 / (6 * 10^6 Hz) = 0.16667 microseconds = 166.67 nanoseconds.
3. Execution Time of CALL 4000H: Total T-states = 18 T-states. Execution time = 18 * T = 18 * 166.67 ns = 3,000.06 ns = 3.00 microseconds. (Equivalently: 18 / 6.0 MHz = 3.00 microseconds).
- Internal clock frequency = 6.0 MHz.
- Period of one T-state = 166.67 ns.
- Execution time of
CALL 4000H(18 T-states) = 3.00 microseconds.