Addressing Modes | Computer Architecture & Organisation (CAO) - Computer Science Engineering (CSE) PDF Download

Addressing Mode

  • Specifies a rule for interpreting or modifying the address field of the instruction before the operand is actually referenced.
  • Computers use addressing mode techniques for the purpose of accommodating the following purposes:
    • To give programming versatility to the user by providing such facilities as pointers to memory, counters for loop control, indexing of data and various other purposes.
    • To reduce the number of bits in the addressing field of the instructions.
      • Other computers use a single binary for operation & Address
      • The mode field is used to locate the operand.
      • Address field may designate a memory address or a processor register.
      • There are 2 modes that need no address field at all (Implied & immediate modes).

Effective address (EA): 

  • The effective address is defined to be the memory address obtained from the computation dictated by the given addressing mode.
  • The effective address is the address of the operand in a computational-type instruction.

The most well known addressing mode are:

  • Implied Addressing Mode.
  • Immediate Addressing Mode
  • Register Addressing Mode
  • Register Indirect Addressing Mode
  • Auto-increment or Auto-decrement Addressing Mode
  • Direct Addressing Mode · Indirect Addressing Mode
  • Displacement Address Addressing Mode
  • Relative Addressing Mode · Index Addressing Mode
  • Stack Addressing Mode

Implied Addressing Mode·

  • In this mode the operands are specified implicitly in the definition of the instruction.

For example:- CMA - “complement accumulator” is an implied-mode instruction because the operand in the accumulator register is implied in the definition of the instruction. In fact, all register reference instructions that use an accumulator are implied-mode instructions.

Addressing Modes | Computer Architecture & Organisation (CAO) - Computer Science Engineering (CSE)

Immediate Addressing mode:

  • In this mode the operand is specified in the instruction itself. In other words, an immediate-mode instruction has an operand field rather than an address field.
  • This instruction has an operand field rather than an address field. The operand field contains the actual operand to be used in conjunction with the operation specified in the instruction.
  • These instructions are useful for initializing register to a constant value; For example MVI B, 50H

Addressing Modes | Computer Architecture & Organisation (CAO) - Computer Science Engineering (CSE)
It was mentioned previously that the address field of an instruction may specify either a memory word or a processor register. When the address field specifies a processor register, the instruction is said to be in register-mode.
Advantage: no memory reference. Disadvantage: limited operand

Register direct addressing mode:

  • In this mode, the operands are in registers that reside within the CPU.
  • The particular register is selected from the register field in the instruction.

For example MOV A, B

Addressing Modes | Computer Architecture & Organisation (CAO) - Computer Science Engineering (CSE)

Effective Address (EA) = R
Advantage: no memory reference. Disadvantage: limited address space

Register indirect addressing mode: 

  • In this mode the instruction specifies a register in the CPU whose contents give the address of the operand in the memory.
  • In other words, the selected register contains the address of the operand rather than the operand itself.
  • Before using a register indirect mode instruction, the programmer must ensure that the memory address of the operand is placed in the processor register with a previous instruction.

For example LDAX B

Addressing Modes | Computer Architecture & Organisation (CAO) - Computer Science Engineering (CSE)

Effective Address (EA) = (R)
Advantage: Large address space.
The address field of the instruction uses fewer bits to select a register than would have been required to specify a memory address directly.
Disadvantage: Extra memory reference

Auto increment or Auto decrement Addressing Mode: 

  • This is similar to register indirect mode except that the register is incremented or decremented after (or before) its value is used to access memory.
  • When the address stored in the registers refers to a table of data in memory, it is necessary to increment or decrement the registers after every access to the table.
  • This can be achieved by using the increment or decrement instruction. In some computers it is automatically accessed.
  • The address field of an instruction is used by the control unit in the CPU to obtain the operands from memory.
  • Sometimes the value given in the address field is the address of the operand, but sometimes it is the address from which the address has to be calculated.

Direct Addressing Mode

  • In this mode the effective address is equal to the address part of the instruction. The operand resides in memory and its address is given directly by the address field of the instruction.
    For example LDA 4000H

Addressing Modes | Computer Architecture & Organisation (CAO) - Computer Science Engineering (CSE)

Indirect Addressing Mode

  • In this mode the address field of the instruction gives the address where the effective address is stored in memory.
  • Control unit fetches the instruction from the memory and uses its address part to access memory again to read the effective address.

Addressing Modes | Computer Architecture & Organisation (CAO) - Computer Science Engineering (CSE)

Displacement Addressing Mode

  • A very powerful mode of addressing combines the capabilities of direct addressing and register indirect addressing.
  • The address field of instruction is added to the content of specific register in the CPU.

Addressing Modes | Computer Architecture & Organisation (CAO) - Computer Science Engineering (CSE)

Relative Addressing Mode

  • In this mode the content of the program counter (PC) is added to the address part of the instruction in order to obtain the effective address.
  • The address part of the instruction is usually a signed number (either a +ve or a –ve number).
  • When the number is added to the content of the program counter, the result produces an effective address whose position in memory is relative to the address of the next instruction.

Effective Address (EA) = PC + A

Indexed Addressing Mode

  • In this mode the content of an index register (XR) is added to the address part of the instruction to obtain the effective address.
  • The index register is a special CPU register that contains an index value.
  • Note: If an index-type instruction does not include an address field in its format, the instruction is automatically converted to the register indirect mode of operation.

Effective Address (EA) = XR + A

Base Register Addressing Mode 

  • In this mode the content of a base register (BR) is added to the address part of the instruction to obtain the effective address.
  • This is similar to the indexed addressing mode except that the register is now called a base register instead of the index register.
  • The base register addressing mode is used in computers to facilitate the relocation of programs in memory i.e. when programs and data are moved from one segment of memory to another.

Effective Address (EA) = BR + A

Stack Addressing Mode 
The stack is the linear array of locations. It is some times referred to as push down list or last in First out (LIFO) queue. The stack pointer is maintained in register.

Addressing Modes | Computer Architecture & Organisation (CAO) - Computer Science Engineering (CSE)

Let us try to evaluate the addressing modes with as example.

Addressing Modes | Computer Architecture & Organisation (CAO) - Computer Science Engineering (CSE)

Addressing Modes | Computer Architecture & Organisation (CAO) - Computer Science Engineering (CSE)

The document Addressing Modes | Computer Architecture & Organisation (CAO) - Computer Science Engineering (CSE) is a part of the Computer Science Engineering (CSE) Course Computer Architecture & Organisation (CAO).
All you need of Computer Science Engineering (CSE) at this link: Computer Science Engineering (CSE)
20 videos|86 docs|48 tests

Top Courses for Computer Science Engineering (CSE)

FAQs on Addressing Modes - Computer Architecture & Organisation (CAO) - Computer Science Engineering (CSE)

1. What are addressing modes in IT and software?
Ans. Addressing modes in IT and software refer to the techniques used by computer processors to access and manipulate data. These modes determine how the processor interprets and retrieves data from memory or registers.
2. How many types of addressing modes are there in IT and software?
Ans. There are several types of addressing modes in IT and software, including immediate addressing, direct addressing, indirect addressing, indexed addressing, and relative addressing. Each mode has its own way of specifying the location of data.
3. What is immediate addressing mode in IT and software?
Ans. Immediate addressing mode is a type of addressing mode where the operand is directly specified in the instruction itself. The data is not stored in memory or registers but is directly used by the instruction. It is often used for constants or literals.
4. Can you explain indirect addressing mode in IT and software?
Ans. Indirect addressing mode is a type of addressing mode where the operand is the address of a memory location that contains the actual data. The processor first retrieves the address from the specified location and then retrieves the data from that address. It is useful when the data is stored in a different location than the instruction itself.
5. How does indexed addressing mode work in IT and software?
Ans. Indexed addressing mode is a type of addressing mode where the operand is the sum of a base address and an offset or index value. The base address points to the start of a data structure, and the offset or index value specifies the position of the desired data within that structure. It allows efficient access to data structures like arrays or lists.
20 videos|86 docs|48 tests
Download as PDF
Explore Courses for Computer Science Engineering (CSE) exam

Top Courses for Computer Science Engineering (CSE)

Signup for Free!
Signup to see your scores go up within 7 days! Learn & Practice with 1000+ FREE Notes, Videos & Tests.
10M+ students study on EduRev
Related Searches

Addressing Modes | Computer Architecture & Organisation (CAO) - Computer Science Engineering (CSE)

,

pdf

,

Viva Questions

,

shortcuts and tricks

,

Exam

,

ppt

,

Sample Paper

,

Addressing Modes | Computer Architecture & Organisation (CAO) - Computer Science Engineering (CSE)

,

mock tests for examination

,

Summary

,

Objective type Questions

,

Semester Notes

,

Free

,

MCQs

,

Previous Year Questions with Solutions

,

Addressing Modes | Computer Architecture & Organisation (CAO) - Computer Science Engineering (CSE)

,

past year papers

,

video lectures

,

Extra Questions

,

practice quizzes

,

study material

,

Important questions

;