8085 Instruction Classification by Function
The 8085 microprocessor works with a set of instructions called the instruction set. Each instruction tells the processor what kind of task it should perform. To make it easier to study, these instructions are grouped into categories based on their functionality.
In the 8085 microprocessor, instructions are classified into five groups based on their functionality:
- Data Transfer Instructions – move data.
- Arithmetic Instructions – perform calculations.
- Logical Instructions – perform bit-wise logic and comparisons.
- Branching Instructions – alter program sequence.
- Control Instructions – control the working of the processor.
Brief description is noted in figure 1. Followed by elaborated description of each category with examples.
Figure 1: Brief description of instruction classification based on functionality.
1) Data Transfer Instructions
- These instructions are used to move data from one place to another without changing the data.
- The transfer can happen between registers, from memory to register, register to memory, or between the accumulator and I/O devices.
Example instructions:
- MOV A, B → Copy contents of register B into A.
- LDA 2050H → Load accumulator with data from memory location 2050H.
- STA 3000H → Store contents of accumulator into memory location 3000H.
Note: Only the location of data changes, not the actual data itself.
2) Arithmetic Instructions
- These instructions perform mathematical operations such as addition, subtraction, increment, and decrement.
- Operations are usually performed using the accumulator.
Example instructions:
- ADD B → Add contents of B to the accumulator.
- SUB C → Subtract contents of C from the accumulator.
- INR D → Increase contents of D by 1.
- DCR E → Decrease contents of E by 1.
Note: These instructions help in carrying out basic arithmetic calculations.
3) Logical Instructions
- These instructions perform bit-wise operations like AND, OR, XOR, comparison, and complement.
- They are important for decision-making in programs.
Example instructions:
- ANA B → Logical AND between accumulator and B.
- XRA C → Exclusive OR between accumulator and C.
- CMP D → Compare contents of accumulator with D.
- CMA → Complement (invert) the contents of accumulator.
Note: Logical operations are used in conditions, masking, and control decisions.
4) Branching Instructions
- These instructions change the normal flow of a program.
- Instead of executing the next instruction in sequence, the program “jumps” to a new location depending on conditions.
Example instructions:
- JMP 2050H → Jump to memory location 2050H unconditionally.
- JC 3050H → Jump to 3050H if carry flag is set.
- JNZ 4050H → Jump to 4050H if the result is not zero.
- CALL 5000H → Call a subroutine at 5000H.
- RET → Return from subroutine.
Note: Branching gives flexibility to write programs with loops and decision-making.
5) Control Instructions
- These instructions control the operation of the microprocessor.
- They do not work on data directly but control how the processor should behave.
Example instructions:
- NOP → No operation, used as a delay or for timing adjustment.
- HLT → Halt the processor.
- DI → Disable interrupts.
- EI → Enable interrupts.
Note: These instructions help in managing the overall control of the processor.
FAQs
What do we mean by classification of instructions in 8085?
The instructions of 8085 are grouped into categories based on what kind of task they perform, such as data transfer, arithmetic, logical, branching, or control operations.
How many groups of instructions are there in 8085 based on functionality?
There are five groups:
- Data Transfer Instructions
- Arithmetic Instructions
- Logical Instructions
- Branching Instructions
- Control Instructions
What is the difference between Data Transfer and Arithmetic instructions?
- Data Transfer instructions only move data from one place to another without changing it. Example: MOV A, B
- Arithmetic instructions actually perform mathematical operations like addition, subtraction, increment, and decrement. Example: ADD B
Can you give an example of a Data Transfer instruction?
Yes, MOV A, B is a Data Transfer instruction. It copies the contents of register B into register A.
Which register is mainly used in Arithmetic and Logical operations?
Most arithmetic and logical operations are performed using the accumulator (Register A).
What is the use of Logical instructions in 8085?
Logical instructions perform operations like AND, OR, XOR, compare, and complement. They are very useful in decision-making and bit manipulation tasks.
What is meant by Branching instructions?
Branching instructions are used to change the normal sequence of program execution. They allow jumps, calls, and returns, either conditionally or unconditionally.
Give one example of a conditional branching instruction.
JNZ 2050H is a conditional jump instruction. It will jump to memory location 2050H only if the zero flag is not set (i.e., result is not zero).
What is the function of Control instructions?
Control instructions manage the working of the microprocessor itself. For example:
NOP → No operation
HLT → Halt the processor
EI → Enable interrupts
What is the difference between JMP and CALL instructions?
JMP transfers control directly to a new memory location.
CALL also transfers control but saves the current program counter on the stack so that the program can return back using the RET instruction.