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

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)
Type of Instruction | Length (in bytes) | Structure | Examples | Explanation |
---|---|---|---|---|
One-Byte Instruction | 1 byte | Opcode + Register/Implicit Operand | MOV B, C ADD B CMA | Entire instruction fits in a single byte. No extra memory is needed for data or address. |
Two-Byte Instruction | 2 bytes | 1st 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 Instruction | 3 bytes | 1st 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.
What is a one-byte instruction? Give two examples.
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.
Give two examples of two-byte instructions.
- MVI A, 6B H (Move 6B H into A) and
- ADI 45H (Add 45H to accumulator).
How does the Program Counter (PC) change after execution of instructions of different lengths?
- One-byte instruction → PC increases by 1.
- Two-byte instruction → PC increases by 2.
- Three-byte instruction → PC increases by 3.
In a three-byte instruction, why is the low-order address stored first in memory?
The 8085 follows the little-endian format, where the low-order byte (LSB) is stored before the high-order byte (MSB).
Which type of instructions are commonly one-byte, two-byte, and three-byte?
- 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).
How does instruction length affect execution time?
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.
What is the difference between MVI A, 25H and LDA 2500H in terms of instruction length?
MVI A, 25H → Two-byte (opcode + 8-bit data).
LDA 2500H → Three-byte (opcode + 16-bit memory address).
Can a one-byte instruction access memory? Give an example.
Yes.
Example: MOV A, M is a one-byte instruction but it accesses the memory location pointed by HL register pair.
Do all three-byte instructions involve memory?
No.
Some three-byte instructions involve branching (like JMP, CALL) which use a 16-bit address, not direct memory transfer.