You can locate the operands of any given instructions either in the CPU registers or in the main memory. In case we place the operand in the main memory, then the available instruction would provide the address of the location in the operand field. Various methods are followed so as to specify the address of the operand. The different modes/methods that are used for specifying the address of the operand in the given instructions are called the addressing modes.
Ultimate Guide to Kickstart your GATE Exam Preparation
Download the e-book now
In this article, we will take a look at the Addressing Modes according to the GATE Syllabus for CSE (Computer Science Engineering). Read ahead to learn more.
Table of Contents
Addressing Modes PDF
Download Full PDF
Addressing Modes
The addressing modes help us specify the way in which an operand’s effective address is represented in any given instruction. Some addressing modes allow referring to a large range of areas efficiently, like some linear array of addresses along with a list of addresses. The addressing modes describe an efficient and flexible way to define complex effective addresses.
The programs are generally written in high-level languages, as it’s a convenient way in which one can define the variables along with the operations that a programmer performs on the variables. This program is later compiled so as to generate the actual machine code. A machine code includes low-level instructions.
A set of low-level instructions has operands and opcodes. An addressing mode has no relation with the opcode part. It basically focuses on presenting the address of the operand in the instructions.
Addressing Modes Types
The addressing modes refer to how someone can address any given memory location. Five different addressing modes or five ways exist using which this can be done.
You can find the list below, showing the various kind of addressing modes:
- Implied Mode
- Immediate Mode
- Register Mode
- Register Indirect Mode
- Autodecrement Mode
- Autoincrement Mode
- Direct Address Mode
- Indirect Address Mode
- Indexed Addressing Mode
Before getting into discussing the addressing modes, one must understand more about the “effective address” term.
Effective Address (EA)
The effective address refers to the address of an exact memory location in which an operand’s value is actually present. Let us now explain all of the addressing modes.
Implied Mode
In the implied mode, the operands are implicitly specified in the definition of instruction. For instance, the “complement accumulator” instruction refers to an implied-mode instruction. It is because, in the definition of the instruction, the operand is implied in the accumulator register. All the register reference instructions are implied-mode instructions that use an accumulator.
Immediate Mode
In the immediate mode, we specify the operand in the instruction itself. Or, in simpler words, instead of an address field, the immediate-mode instruction consists of an operand field. An operand field contains the actual operand that is to be used in conjunction with an operation that is determined in the given instruction. The immediate-mode instructions help initialize registers to a certain constant value.
Register Mode
In the register mode, the operands exist in those registers that reside within a CPU. In this case, we select a specific register from a certain register field in the given instruction. The k-bit field is capable of determining one 2k register.
Register Indirect Mode
In the register indirect mode, the instruction available to us defines that particular register in the CPU whose contents provides the operand’s address in the memory. In simpler words, any selected register would include the address of an operand instead of the operand itself.
The reference to a register is equivalent to specifying any memory address. The pros of using this type of instruction are that an instruction’s address field would make use of fewer bits to select a register than would be require when someone wants to directly specify a memory address.
Autodecrement or the Autoincrement Mode
The Autodecrement or Autoincrement mode is very similar to the register indirect mode. The only exception is that the register is decremented or incremented before or after its value is used to access memory. When the address stored in the register defines a data table in memory, it is very crucial to decrement or increment the register after accessing the table every time. It can be obtained using the decrement or increment instruction.
Direct Address Mode
In the direct address mode, the address part of the instruction is equal to the effective address. The operand would reside in memory, and the address here is given directly by the instruction’s address field. The address field would specify the actual branch address in a branch-type instruction.
Indirect Address Mode
In an indirect address mode, the address field of an available instruction gives that address in which the effective address gets stored in memory. The control fetches the instruction available in the memory and then uses its address part in order to (again) access memory to read its effective address.
Indexed Addressing Mode
In the indexed addressing mode, the content of a given index register gets added to an instruction’s address part so as to obtain the effective address. Here, the index register refers to a special CPU register that consists of an index value. An instruction’s address field defines the beginning address of any data array present in memory.
Video on Addressing Mode
Keep learning and stay tuned to get the latest updates on GATE Exam along with GATE Eligibility Criteria, GATE 2023, GATE Admit Card, GATE Syllabus, GATE Previous Year Question Paper, and more.
Also Explore,
- Types of Instructions in Computer Architecture
- ALU (Arithmetic Logic Unit)
- Control Unit
- Microprogrammed Control Unit
- Instruction Formats
- Memory Hierarchy
- Fully Associative Mapping
- Associative Mapping
- Direct Mapping
- Conversion of Bases to Other Bases
- Flynn’s Classification of Computers
- SIMD
- SISD
- MIMD
- MISD
- De Morgan’s Theorems
Comments