Skip to main content

Addressing Modes & Types of Addressing Modes

Addressing Modes & Types of Addressing Modes


Addressing modes: The different ways of specifying the location of an operand in instruction are called addressing modes.

Types of Addressing Modes: In computer architecture, there are the following types of addressing modes:
  1. Implied / Implicit Addressing Mode
  2. Stack Addressing Mode
  3. Immediate Addressing Mode
  4. Direct Addressing Mode
  5. Indirect Addressing Mode
  6. Register Direct Addressing Mode
  7. Register Indirect Addressing Mode
  8. Relative Addressing Mode
  9. Indexed Addressing Mode
  10. Base Register Addressing Mode
  11. Auto-Increment Addressing Mode
  12. Auto-Decrement Addressing Mode
Types of Addressing Modes
(Types of Addressing Modes)

In this article, we will discuss these addressing modes in detail.

1. Implied Addressing Mode:
In this addressing mode,
  • The definition of the instruction itself specifies the operands implicitly.
  • It is also called an implicit addressing mode.

Examples:
  • The instruction “Complement Accumulator” is an implied mode of instruction.
  • In a stack-organized computer, Zero Address Instructions have implied mode instructions.

2. Stack Addressing Mode:
In this addressing mode,
  • The operand is contained at the top of the stack.

Example:
  • This instruction simply pops out two symbols contained at the top of the stack.
  • The addition of those two operands is performed.
  • The result so obtained after addition is pushed again at the top of the stack.

3. Immediate Addressing Mode:
In this addressing mode,
  • The operand is specified in the instruction explicitly.
  • Instead of the address field, an operand field is present that contains the operand.

Examples:
  • ADD 10 will increment the value stored in the accumulator by 10.
  • MOV R #20 initializes register R to a constant value of 20.

4. Direct Addressing Mode:
In this addressing mode,
  • The address field of the instruction contains the effective address of the operand.
  • Only one reference to memory is required to fetch the operand.
  • It is also called an absolute addressing mode.

Example:
  • ADD X will increment the value stored in the accumulator by the value stored at memory location X.
AC ← AC + [X]

5. Indirect Addressing Mode:
In this addressing mode,
  • The address field of the instruction specifies the address of memory location that contains the effective address of the operand.
  • Two references to memory are required to fetch the operand.

Example:
  • ADD X will increment the value stored in the accumulator by the value stored at the memory location specified by X.
AC ← AC + [[X]]

6. Register Direct Addressing Mode:
In this addressing mode,
  • The operand is contained in a register set.
  • The address field of the instruction refers to a CPU register that contains the operand.
  • No reference to memory is required to fetch the operand.

Example:
  • ADD R will increment the value stored in the accumulator by the content of register R.
AC ← AC + [R]

NOTE:
  • This addressing mode is similar to the direct addressing mode.
  • The only difference is address field of the instruction refers to a CPU register instead of the main memory.

7. Register Indirect Addressing Mode:
In this addressing mode,
  • The address field of the instruction refers to a CPU register that contains the effective address of the operand.
  • Only one reference to memory is required to fetch the operand.

Example:
  • ADD R will increment the value stored in the accumulator by the content of the memory location specified in register R.
AC ← AC + [[R]]

NOTE:
  • This addressing mode is similar to the indirect addressing mode.
  • The only difference is address field of the instruction refers to a CPU register.

8. Relative Addressing Mode:
In this addressing mode,
  • Effective address of the operand is obtained by adding the content of the program counter with the address part of the instruction.
Effective Address = Content of Program Counter + Address part of the instruction

NOTE:
  • Program counter (PC) always contains the address of the next instruction to be executed.
  • After fetching the address of the instruction, the value of the program counter immediately increases.
  • The value increases irrespective of whether the fetched instruction has been completely executed or not.

9. Indexed Addressing Mode:
In this addressing mode,
  • Effective address of the operand is obtained by adding the content of the index register with the address part of the instruction.
Effective Address = Content of Index Register + Address part of the instruction

10. Base Register Addressing Mode:
In this addressing mode,
  • Effective address of the operand is obtained by adding the content of the base register with the address part of the instruction.
Effective Address = Content of Base Register + Address part of the instruction

11. Auto-Increment Addressing Mode:
  • This addressing mode is a special case of Register Indirect Addressing Mode where-

Effective Address of the Operand = Content of Register

In this addressing mode,
  • After accessing the operand, the content of the register is automatically incremented by step size ‘d’.
  • Step size ‘d’ depends on the size of the operand accessed.
  • Only one reference to memory is required to fetch the operand.

Example:
Assume operand size = 2 bytes.
Here,
  • After fetching operand 6B, the instruction register RAUTO will be automatically incremented by 2.
  • Then, updated value of RAUTO will be 3300 + 2 = 3302.
  • At memory address 3302, the next operand will be found.

NOTE:
In auto-increment addressing mode,
  • First, the operand value is fetched.
  • Then, the instruction register RAUTO value is incremented by step size ‘d’.

12. Auto-Decrement Addressing Mode:
  • This addressing mode is again a special case of Register Indirect Addressing Mode where-

Effective Address of the Operand = Content of Register – Step Size

In this addressing mode,
  • First, the content of the register is decremented by step size ‘d’.
  • Step size ‘d’ depends on the size of the operand accessed.
  • After decrementing, the operand is read.
  • Only one reference to memory is required to fetch the operand.
Example:
Assume operand size = 2 bytes.
Here,
  • First, the instruction register RAUTO will be decremented by 2.
  • Then, the updated value of RAUTO will be 3302 – 2 = 3300.
  • At memory address 3300, the operand will be found.
NOTE:
In auto-decrement addressing mode,
  • First, the instruction register RAUTO value is decremented by step size ‘d’.
  • Then, the operand value is fetched.


Comments

Popular posts from this blog

Object Oriented and Relational Database

Object Relational and Object-Oriented Database What Is Object Relational Database? An object-relational database (ORD) is a database management system (DBMS) that’s composed of both a relational database (RDBMS) and an object-oriented database (OODBMS). An object-relational database acts as an interface between relational and object-oriented databases because it contains aspects and characteristics from both models. Object-oriented database (ORD) serves two main purposes: It connects the divide between relational databases and the object-oriented modeling techniques that are usually used in programming languages like C#, Java and C++. It bridges the gap between conceptual data modeling techniques for relational and object-oriented databases like entry-relationship diagram (ERD) and object-relational mapping (ORM). What Is Object Oriented Database? An object-oriented database is organized around objects rather than actions and data rather than logic. Therefore, an object database is a d...

What is the monitor? How many types and what is it? Details about CRT, LCD and LED monitors.

मॉनिटर क्या है? कितने प्रकार का होता है और क्या होता है? सीआरटी, एलसीडी और एलईडी मॉनिटर के बारे में विवरण। मॉनिटर क्या है? = मॉनिटर वह पार्ट्स है जो कंप्यूटर सिस्टम के साथ टीवी जैसा दिखता है। मॉनिटर कंप्यूटर सिस्टम का एक बहुत ही महत्वपूर्ण आउटपुट डिवाइस है। इसे डिस्प्ले डिवाइस के नाम से भी जाना जाता है। कंप्यूटर पर हम जो भी कार्य करते हैं उन्हें इस मॉनिटर के माध्यम से देखा जा सकता है, इसलिए मॉनिटर को विजुअल डिस्प्ले यूनिट कहा जाता है। मॉनिटर अलग-अलग साइज में आते हैं जैसे- 14 इंच, 15 इंच, 17 इंच, 19 इंच आदि। (Image by - Google Images) मॉनिटर कितने प्रकार के होते हैं? = रंग प्रदर्शन के आधार पर मॉनिटर्स को दो श्रेणियों में विभाजित किया जा सकता है। 1) मोनोक्रोम मॉनिटर (Monochrome Monitor), 2) कलर मॉनिटर (Color Monitor) । *  वर्तमान में मोनोक्रोम मॉनिटर का उपयोग शायद ही ध्यान देने योग्य है। अब हर जगह कलर मॉनिटर का इस्तेमाल किया जाता है। 1) मोनोक्रोम मॉनिटर (Monochrome Monitor) = इस प्रकार का मॉनिटर केवल सादा-काला चित्र प्रदर्शित करता है। वर्तमान में मोनोक्रोम मॉनिटर बहुत कम उपयोग होता ...

Normalization Types in DBMS

Normalization Types in DBMS First Normal Form (1NF) A relation will be 1NF if it contains an atomic value.  It states that an attribute of a table cannot hold multiple values. It must hold only single-valued attribute. First normal form disallows the multi-valued attribute, composite attribute, and their combinations. Example: Relation EMPLOYEE is not in 1NF because of multi-valued attribute EMP_PHONE. EMPLOYEE table: EMP_ID EMP_NAME EMP_PHONE EMP_STATE 14 John 7272826385, 9064738238 UP 20 Harry 8574783832 Bihar 12 Sam 7390372389, 8589830302 Punjab The decomposition of the EMPLOYEE table into 1NF has been shown below: EMP_ID EMP_NAME EMP_PHONE EMP_STATE 14 John 7272826385 UP 14 John 9064738238 UP 20 Harry 8574783832 Bihar 12 Sam 7390372389 Punjab 12 Sam 8589830302 Punjab Second Normal Form (2NF) In the 2NF, relational must be in 1NF.  In the second normal form, all non-key attributes are fully functional dependent on the primary key  Example: Let's assume, a school can ...