Open In App

Data Manipulation Instructions in Computer Organization

Last Updated : 03 Feb, 2025
Comments
Improve
Suggest changes
Like Article
Like
Report

Data manipulation instructions are processor-level commands that perform operations on data stored in memory or registers. They enable tasks like mathematical computations, logical operations, and bit-level manipulations. These instructions modify data to execute program requirements efficiently.

They are broadly categorized into three types:

  1. Arithmetic instructions
  2. Logical and bit manipulation instructions
  3. Shift instructions

Let's discuss them one by one.

Arithmetic instructions

The four basic operations are addition, subtraction, multiplication, and division. Most computers provide instructions for all four operations. Following table shows arithmetic instructions with their usage:

NameMnemonicExampleExplanation
IncrementINCINC B

It will increment the register B by 1  

 B<-B+1

DecrementDECDEC B

It will decrement the register B by 1  

B<-B-1

AddADDADD B

It will add contents of register B to the contents of the  accumulator

 and store the result in the accumulator  

AC<-AC+B

SubtractSUBSUB B

It will subtract the contents of register B from the contents of the 

accumulator  and store the result in the accumulator

AC<-AC-B

MultiplyMULMUL B

It will multiply the contents of register B with the contents of the 

accumulator and store the result in the accumulator

AC<-AC*B

DivideDIVDIV B

It will divide the contents of register B with the contents of the 

accumulator and store the quotient in the accumulator

AC<-AC/B

Add with carry ADDCADDC B 

It will add the contents of register B and the carry flag with the

contents of the accumulator and store the result in the 

accumulator

AC<-AC+ B+ Carry flag

Subtract with borrowSUBBSUBB B

It will subtract the contents of register B and the carry flag from 

the contents of the accumulator and store the result in the 

accumulator

AC<-AC-B-Carry flag

Negate(2's complement)NEGNEG  B

It will negate a value by finding 2's complement of its single operand.

This means simply operand by -1.

B<-B'+1

Read more about Arithmetic instructions in 8085 microprocessor

Logical and Bit Manipulation Instructions

Logical instructions perform binary operations on strings of bits stored in registers. They are helpful for manipulating individual bits or a group of bits. Following table shows logical and bit Manipulation instructions with their usage:

NameMnemonicExampleExplanation
ClearCLRCLR 

It will set the accumulator to 0 

AC<-0

ComplementCOMCOM A

It will complement the accumulator

AC<-(AC)'

ANDANDAND B

It will AND the contents of register B with the contents of accumulator and store 

it in the accumulator

AC<-AC AND B

OROROR B

It will OR the contents of register B with the contents of accumulator and store it

in the accumulator

AC<-AC OR B

Exclusive-ORXORXOR B

It will XOR the contents of register B with the contents of the accumulator and 

store it in the accumulator

AC<-AC XOR B

Clear carryCLRCCLRC

It will set the carry flag to 0

Carry flag<-0

Set carrySETCSETC

It will set the carry flag to 1

Carry flag<-1

Complement carryCOMCCOMC

It will complement the carry flag

Carry flag<- (Carry flag)'

Enable interruptEIEIIt will enable the interrupt
Disable interruptDIDIIt will disable the interrupt

Read about Logical instructions in 8085 microprocessor

Shift Instructions

Shifts are operations in which the bits of a word are moved to the left or right. Shift instructions may specify either logical shifts, arithmetic shifts, or rotate-type operations. Following table shows shift instructions with their usage:

NameMnemonic
Logical shift rightSHR
Logical shift leftSHL
Arithmetic shift rightSHRA
Arithmetic shift leftSHLA
Rotate rightROR
Rotate leftROL
Rotate right through carryRORC
Rotate left through carryROLC

For Shift Instructions, refer to this Reference for Shift Instructions


Next Article

Similar Reads