Access free live classes and tests on the app
Download
+
Unacademy
  • Goals
    • AFCAT
    • AP EAMCET
    • Bank Exam
    • BPSC
    • CA Foundation
    • CAPF
    • CAT
    • CBSE Class 11
    • CBSE Class 12
    • CDS
    • CLAT
    • CSIR UGC
    • GATE
    • IIT JAM
    • JEE
    • Karnataka CET
    • Karnataka PSC
    • Kerala PSC
    • MHT CET
    • MPPSC
    • NDA
    • NEET PG
    • NEET UG
    • NTA UGC
    • Railway Exam
    • SSC
    • TS EAMCET
    • UPSC
    • WBPSC
    • CFA
Login Join for Free
avtar
  • ProfileProfile
  • Settings Settings
  • Refer your friendsRefer your friends
  • Sign outSign out
  • Terms & conditions
  • •
  • Privacy policy
  • About
  • •
  • Careers
  • •
  • Blog

© 2023 Sorting Hat Technologies Pvt Ltd

NTA UGC NET 2023 » NTA Study Materials » Computer Science » Computer Instructions
doubtsolving_ntaugc

Computer Instructions

Get to know computer instructions, the format, types of instruction, code formats, addressing modes in instructions and the instruction cycle.

Table of Content
  •  

Instructions given to a computer allow it to perform some specific tasks. A basic instruction is divided into three fields – the operation field, the address field and the mode field. The operation field indicates the operation to be performed, the address field indicates the memory location of the operand, and the mode field indicates how the memory address of the operand is determined. Instructions can be divided into various types based on the number of address fields it contains, the instruction format and the instruction code format. When an instruction enters a computer, it goes through an instruction cycle.

Instruction formats

  • Three address instructions

A three-address instruction consists of three address fields. Each address field can specify either a memory operand or a register.

  • Two address instructions

A two-address instruction consists of two address fields. Each address field can specify either a memory operand or a register. This addressing format is most common in commercial computers.

  • One address instructions

A one-address instruction consists of only one address field. For any data manipulation, the accumulator (A) register is used here. 

  • Zero address instructions

A zero-address instruction does not contain any address. A stack organised computer uses this addressing mode. The operations in this addressing mode are performed by instructions such as PUSH and POP. 

Types of instruction code formats

  • Memory reference instructions

This type of instruction is divided into three parts – mode, opcode and address. In a memory reference instruction, the first twelve bits specify an address which stores an operation. The next three bits specify the opcode, and the last bit specifies the addressing mode. 

  • Register reference instructions

This type of instruction is divided into three parts – mode, opcode and register operation. In a register reference instruction, the first twelve bits specify a register operation, the following three bits specify the opcode (111), and the last bit specifies the addressing mode (0). 

  • Input/output instructions

This type of instruction is divided into three parts – mode, opcode and input/output operation. In an input-output reference instruction, the first twelve bits specify an input/output operation, the following three bits specify the opcode (111), and the last bit specifies the addressing mode (1). 

Types of addressing modes in instructions

  • Implicit addressing mode – In this mode, the instruction contains the operand, but indirectly. For example – CMA (Complement accumulator)

  • Immediate addressing mode – In this mode, the instruction contains the operand along with the opcode. For example, MVI B 05

  • Direct addressing mode – In this mode, the address field of the instruction specifies the address of the data to be used in the operation. For example, LDA 2050

  • Indirect addressing mode – In this mode, the address field of the instruction specifies an address. This address contains the data address to be used in the operation. For example, LOAD R1 @500

  • Register addressing mode – In this mode, the instruction specifies a register. This register stores the data which is required for the operation. For example – ADD B

  • Register indirect addressing mode – The instruction specifies a register in this mode. This register stores the address of the data which is to be used in the operation. For example – LDAX B

  • Auto-increment/decrement addressing mode – In this mode, the register is used to access a memory location. After the memory location is accessed, the contents of the register increase by 1. For example – LDA (R1)+, LDA -(R1)

  • Relative addressing mode – In this mode, the sum of the contents that reside within the address field and the program counter gives the effective address of the data

  • Indexed addressing mode – In this mode, the sum of the contents that reside within the address field and the index register gives the effective address of the data

  • Base register addressing mode – In this mode, the sum of the contents that reside within the address field and the base register gives the effective address of the data

Instruction cycle

The steps of an instruction cycle are:

  • Fetch the instruction 

The program counter stores the address of the instruction to execute next. This instruction is fetched from the memory and stored in the instruction register. After the instruction is fetched, the content of the program counter is increased by 1.

  • Decode the instruction

The decoder executes the instruction stored in the instruction register

  • Read effective address

The address of the operand is read from the instruction. In some cases, the operands are read directly from the instruction.

  • Execute the instruction

Information read and decoded from the instruction is passed to the functional unit of the CPU by the control unit. The result of the operation is either sent to an output device or stored in the memory.

Conclusion 

A computer performs tasks based on the instructions given to it. An instruction consists of a mode field, address field, and operation field. An instruction can be of one of four formats based on the number of addressing fields – zero address instruction, one address instruction, two address instruction and three address instruction. Based on the type of instruction code, an instruction can be of three types – memory reference instructions, register reference instruction and input/output instruction. 

An instruction can have the following addressing modes:

  • Direct addressing mode

  • Indirect addressing mode

  • Implied addressing mode

  • Immediate addressing mode

  • Register addressing mode

  • Register indirect addressing mode

  • Increment/decrement addressing mode

  • Relative addressing mode

  • Base register addressing mode

  • Indexed addressing mode

An instruction cycle consists of the following steps:

  • Fetch the instruction

  • Decode the instruction

  • Read the effective address

  • Execute the instruction

faq

Frequently asked questions

Get answers to the most common queries related to the NTA Examination Preparation.

What are the types of instructions based on operation?

Ans. The types of instructions based on the operations performed by them are: ...Read full

What are the examples of memory reference instructions?

Ans. Example of memory reference instructions are: ...Read full

What are the types of data manipulation instructions?

Ans. Data manipulation instructions are divided into three types –  ...Read full

Give some examples of program control instructions?

Ans. Some program control instructions are – Branch (BR), Return (RET), Jump (JMP), Call (CALL), Skip (SKP), etc....Read full

Ans. The types of instructions based on the operations performed by them are:

  • Data transfer instructions
  • Data manipulation instructions
  • Program control instructions

Ans. Example of memory reference instructions are:

  • ADD B – This instruction adds the contents of register B with the contents of the accumulator. The result is stored in the accumulator.
  • LDA 2000 – This instruction stores the contents of the memory location 2000H into the accumulator.
  • STA 2000 – This instruction stores the contents of the accumulator in the memory location 2000H.

Ans. Data manipulation instructions are divided into three types – 

  • Logical and bit manipulation instruction
  • Arithmetic instruction
  • Shift instruction

 

Ans. Some program control instructions are – Branch (BR), Return (RET), Jump (JMP), Call (CALL), Skip (SKP), etc.

Crack NTA UGC with Unacademy

Get subscription and access unlimited live and recorded courses from India’s best educators


  • Structured syllabus
  • Daily live classes
  • Ask doubts
  • Tests & practice
Learn more

Notifications

Get all the important information related to the NTA UGC Examination including the process of application, important calendar dates, eligibility criteria, exam centers etc.

Application Process
NTA UGC Results
UGC NET Admit Card
UGC NET Eligibility Criteria 2023
UGC NET Exam Pattern 2023: Paper 1 & Paper 2 Marking Scheme
See all

Related articles

Learn more topics related to Computer Science
What is the Instruction Cycle in Computer Architecture

The instruction cycle helps the CPU perform its primary job of expecting tasks. This article will discuss the steps involved in the instruction cycle and an example of the instruction cycle in detail.

What is Data Structure?

Data structure is putting together data in an organised manner. Data is arranged as primitive data structure, non-primitive data structure, and linear data structure.

Types of Registers

Different types of registers are available nowadays. Read this article to learn about Accumulator, MAR, MDR, and more.

Types of Queues and their Applications

Queue is a linear structure in which actions are conducted in a certain order. This article contains the study material notes on the types of queues - linear queue, circular queue, priority queue, dequeue, and their applications.

See all
Access more than

7,940+ courses for NTA-UGC-NET and SET Exams

Get subscription
freeliveclasses_ntaugc
testseries_ntaugcnet
Subscribe Now
.
Company Logo

Unacademy is India’s largest online learning platform. Download our apps to start learning


Starting your preparation?

Call us and we will answer all your questions about learning on Unacademy

Call +91 8585858585

Company
About usShikshodayaCareers
we're hiring
BlogsPrivacy PolicyTerms and Conditions
Help & support
User GuidelinesSite MapRefund PolicyTakedown PolicyGrievance Redressal
Products
Learner appLearner appEducator appEducator appParent appParent app
Popular goals
IIT JEEUPSCSSCCSIR UGC NETNEET UG
Trending exams
GATECATCANTA UGC NETBank Exams
Study material
UPSC Study MaterialNEET UG Study MaterialCA Foundation Study MaterialJEE Study MaterialSSC Study Material

© 2025 Sorting Hat Technologies Pvt Ltd

Unacademy
  • Goals
    • AFCAT
    • AP EAMCET
    • Bank Exam
    • BPSC
    • CA Foundation
    • CAPF
    • CAT
    • CBSE Class 11
    • CBSE Class 12
    • CDS
    • CLAT
    • CSIR UGC
    • GATE
    • IIT JAM
    • JEE
    • Karnataka CET
    • Karnataka PSC
    • Kerala PSC
    • MHT CET
    • MPPSC
    • NDA
    • NEET PG
    • NEET UG
    • NTA UGC
    • Railway Exam
    • SSC
    • TS EAMCET
    • UPSC
    • WBPSC
    • CFA

Share via

COPY