Running 2 Youtube Channel : The Masti Adda (Fun based ) : The Knowledge Adda (Knowledge based) : Subscribe for Knowledge with Fun....

Instruction Classification based on Functionality

Written by @
Based on the functionality, the instructions are classified into the following five categories:
1. Data transfer(copy) operations
2. Arithmetic operations
3. Logical Operations
4. Branching Operations
5. Machine Control Operations

1.Data Transfer (Copy) Operations: This group of instructions copies data from a location called source register to another location called destination location. Generally, the contents of the source register are not modified. Although the term data transfer is used for the copy operation, it is misleading because it implies that the contents of the source memory location are destroyed. There are various types of data transfer.
(i). Transferring data between one register/Memory and another register/Memory
MOV A, D-Copies the content of register D to the accumulator.
(ii). Storing a data byte in a register or memory location
MVI C, 66 H-Loads register C with the data 66 H
(iii). Transferring data between a memory location and a register
LDA 2050 H- Loads the contents of memory location 2050 H in accumulator.
(iv). Transferring data between an I/O device and the accumulator
IN PORT1- Transfer data from an input device to the accumulator.

2.Arithmetic Operations:Arithmetic operations include addition, subtraction, increment and decrement. As the 8085 has an accumulator-oriented ALU, one of the data used in the arithmetic operations is stored in the accumulator; the result is also stored in the accumulator. Arithmetic and logical operations can not be executed without the accumulator.
(i)Addition (ADD): The addition instructions of the 8085 add the contents of a register or memory location with the content of accumulator. The result is stored in the accumulator. The Intel 8085 instruction set supports two types of addition instructions with and without carry. The instructions also supports 16-bit addition, the contents of the HL register pair can be added to that of another register pair and the result stored in HL register pair.

(ii)Subtraction (SUB): The instruction set of 8085 supports two types of subtraction-with borrows and without borrow. Like addition, subtraction operation also uses the accumulator as reference. It subtracts the content of a register or memory location from that of the accumulator and stores the result in the accumulator.

(iii)Increment/Decrement: These operations can be used to increment or decrement the contents of any register, register pair, or memory location. Unlike the arithmetic and logical operation, increment and decrement operation need not be based on the accumulator.

3. Logical Operations: Logical instructions are also accumulator-oriented. They require one of the operands to be placed in the accumulator. The other operand can be any register or memory location. The result is stored in the accumulator.

The operations that use two operands are logical AND, OR and EXOR. The operation that uses a single operand is the logical complement or NOT operation.

The instruction set of the 8085 supports rotation of the data stored in the accumulator. The data can be rotated left or right, through the carry or without carry.

The most important 8085 instruction is the compare instruction. This instruction is used to compare register or memory content with the accumulator content. The result of comparison such as equal to, greater than, or less than is reflected in the flag register bits.

4. Branching Operations: These instructions can transfer control of execution from one memory location to another, either conditionally or unconditionally. Branching can take place in the following two ways.
(i)Jump: Conditional jump are an important instruction. These instructions for certain conditions mentioned with instruction or zero or carry flag and alter the program sequence when the condition is met. In addition, the instruction set includes an instruction called unconditional jump.

(ii)Call and Return: These instructions change the sequence of a program either by calling subroutine or returning from a subroutine. The conditional call and return instructions can also condition flags.

5. Machine Control Operations: These instructions can be used to control the execution of other instructions. They include halting the operation of the microprocessor, interrupting program execution.

No comments:

Post a Comment