8085 Instruction Classification by Length (1, 2 & 3 Bytes)

In the 8085 microprocessor, every instruction is stored in memory in the form of bytes. A byte is simply 8 bits of data. Depending on how much information an instruction carries, the total length of an instruction can be 1 byte, 2 bytes, or 3 bytes. This classification is very important because it helps us understand how much memory space an instruction will take and how the microprocessor reads and executes it. Figure 1 shows the memory usage for 1, 2, and 3 bytes instructions.8085 Instruction Classification

Fig. 1: memory usage for 1, 2, and 3 bytes instructions

One-Byte Instructions

An instruction is called one-byte when the entire instruction fits in a single 8-bit byte. That one byte holds the opcode and, if needed, the information about operands when those operands are registers or implied by the instruction.
  • These instructions are only 1 byte long.
  • The single byte contains the complete information: the opcode (operation code) as well as the operands (if any are registers or implied).
  • The microprocessor does not need to fetch anything extra from memory.

Examples:

  • MOV B, C → Copies content of register C into register B.
  • ADD B → Adds the content of register B to the accumulator.
  • CMA → Complements the content of the accumulator.

Format of Instruction:

Opcode + Operand (if register-based) are inside a single byte.

Two-Byte Instructions

A two-byte instruction is one that occupies exactly 2 bytes in memory. The first byte contains the opcode (the actual operation to be done). The second byte carries an 8-bit operand, which may be Immediate data (a constant number provided with the instruction), or 8-bit port address (for input/output operations).
  • These instructions are 2 bytes long.
  • The first byte contains the opcode.
  • The second byte contains the operand, usually an 8-bit immediate data or an 8-bit port address.
  • Since the operand is provided along with the instruction, the microprocessor must fetch one extra byte from memory.

Examples:

  • MVI A, 32H → Load the hexadecimal value 32 into the accumulator.
  • ADI 45H → Add immediate data 45H to the accumulator.

Format of Instruction:

Opcode (1 byte) + Immediate Data/Address (1 byte).

Three-Byte Instructions

A three-byte instruction occupies 3 consecutive bytes in memory. First byte Contains the opcode (the operation to be done). Second and third bytes together form a 16-bit operand, usually a memory address.
  • These instructions are 3 bytes long.
  • The first byte contains the opcode.
  • The second and third bytes together represent a 16-bit address (low-order byte first, then high-order byte).
  • These instructions usually involve memory locations or jumps.

Examples:

  • LXI H, 2500H → Load the register pair HL with the address 2500H.
  • JMP 2050H → Jump to the memory location 2050H.
  • LDA 4500H → Load the accumulator with data from memory location 4500H.

Format of Instruction:

Opcode (1 byte) + 16-bit address (2 bytes).

Classification of Instructions Based on Length (8085 Microprocessor)

8085 Instruction Length Classification
Type of InstructionLength (in bytes)StructureExamplesExplanation
One-Byte Instruction1 byteOpcode + Register/Implicit OperandMOV B, C
ADD B
CMA
Entire instruction fits in a single byte. No extra memory is needed for data or address.
Two-Byte Instruction2 bytes1st byte → Opcode
2nd byte → 8-bit Data/Address
MVI A, 32H
ADI 45H
First byte tells the operation, second byte provides immediate data or an 8-bit address.
Three-Byte Instruction3 bytes1st byte → Opcode
2nd + 3rd byte → 16-bit Address (Low-order first, then High-order)
LXI H, 2500H
JMP 2050H
LDA 4500H
Used when the instruction needs a full 16-bit memory address. The processor fetches two extra bytes.
 

 

FAQs

On what basis are instructions of 8085 classified according to length?

Instructions are classified based on how many bytes they occupy in memory. They are divided into one-byte, two-byte, and three-byte instructions.

A one-byte instruction is an instruction where the opcode and operand (if any) are contained in a single byte.

Examples: MOV A, B, ADD C, CMA.

  • MVI A, 6B H (Move 6B H into A) and
  • ADI 45H (Add 45H to accumulator).
  • One-byte instruction → PC increases by 1.
  • Two-byte instruction → PC increases by 2.
  • Three-byte instruction → PC increases by 3.

The 8085 follows the little-endian format, where the low-order byte (LSB) is stored before the high-order byte (MSB).

  • One-byte: Register-to-register data transfer, arithmetic, logical, and control instructions (e.g., MOV, ADD, CMA).
  • Two-byte: Immediate data transfer or arithmetic, and I/O operations (e.g., MVI, ADI, IN).
  • Three-byte: Instructions involving memory addresses or branching (e.g., LDA, STA, JMP).

Longer instructions (two-byte or three-byte) take more time because the processor must fetch additional bytes from memory. One-byte instructions are usually the fastest to execute.

MVI A, 25H → Two-byte (opcode + 8-bit data).

LDA 2500H → Three-byte (opcode + 16-bit memory address).

Yes.

Example: MOV A, M is a one-byte instruction but it accesses the memory location pointed by HL register pair.

No.

Some three-byte instructions involve branching (like JMP, CALL) which use a 16-bit address, not direct memory transfer.

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top