SlideShare a Scribd company logo
2
Most read
4
Most read
16
Most read
ADDRESSING MODES
THE OPERATION FIELD OF AN INSTRUCTION SPECIFIES THE OPERATION TO BE PERFORMED. THIS OPERATION MUST BE EXECUTED ON THE DATA STORED IN COMPUTER REGISTERS OR THE MEMORY WORDS. THE WAY THE OPERANDS ARE CHOSEN DURING PROGRAM EXECUTION IS DEPENDENT ON THE  ADDRESSING MODE OF THE INSTRUCTION. THE 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 ACCOMODATING THE FOLLOWING PURPOSES:- 1.) 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. 2.) To reduce the number of bits in the addressing field of the instructions.
To understand the various addressing modes, It is imperative that we understand the basic operation cycle of the computer.  The control unit of a computer is designed to go through an instruction cycle that is divided into 3 major parts:- Fetch the instruction from memory Decode the instruction and Execute the instruction.
Now to complete the above mentioned process we need to study some terminology that forms a important part of instruction cycle. ♣  PROGRAM COUNTER: ¤  There is 1 register in the computer called the program counter or PC that keeps track of the instructions in the program stored in memory. ¤ PC holds the address of the instructions to be executed next and is incremented each time an instruction is fetched from memory. ¤ The decoding of the instruction is done in the next step tells which operation is to be performed, the addressing mode of the instruction, and the location of the operands. ¤   The computer then executes the instruction and returns to the step1, i.e. to fetch the next instruction.
♣  MODE FIELD: An example of an instruction format with a distinct addressing mode field is shown below: Opcode  Mode  Address  The mode field is used to locate the Operands needed for the operation. There may or may not be the address field in the instruction.
Although most addressing modes modify the address field of the instruction, there are two modes that need no address field at all: 1.) Implied mode 2.) Immediate mode. IMPLIED MODE: In this mode the operands are specified implicitly in the definition of the instruction. For example:- “ compliment 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.
Immediate 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. The operand field contains the actual operand to be used in conjunction with the operation specified in the instruction. -- 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.
Register mode: In this mode the operands are in registers that reside within the C.P.U. The particular register is selected from the register field in the instruction. A K-bit field can specify any one of 2 k  registers. Register indirect 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. Advantage: The address field of the instruction uses fewer bits to select a register than would have been required to specify a memory address directly.
Auto increment or auto decrement : 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. For that we need to know about the concept of ‘EFFECTIVE ADDRESS’.
Effective address: 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. DIRECT ADDRESS 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.
INDIRECT ADDRESS 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. Some addressing modes requires the following  to calculate the effective address: Effective address= address part of instruction+ content of CPU register
RELATIVE ADDRESS MODE In this mode the content of the program counter 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 . INDEXED ADDERESSING MODE In this mode the content of an index register 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 ic automatically converted to the register indirect mode of operation.
BASE REGISTER ADDRESSING MODE In this mode the content of a base register 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. When programs and data are moved from one segment of memory to another.
NUMERICAL EXAMPLE PC=200 R1=400 XR=100 AC ADDRESS MEMORY 200 201 202 399 400 500 600 702 800 300 325 900 800 700 450 NEXT INSTRUCTION ADDRESS=500 LOAD TO AC  MODE
ADDRESSING  EFFECTIVE  CONTENT MODE  ADDRESS  TO AC DIRECT ADDRESS   500   800 IMMEDIATE OPERANDS   201   500 INDIRECT ADDRESS   800   300 RELATIVE ADDRESS   702   325 INDEXED ADDRESS   600   900 REGISTER   ----   400 REGISTER INDIRECT   400  700 AUTOINCREMENT   400   700 AUTODECREMENT   399   450

More Related Content

PPTX
Instruction codes
PDF
Addressing modes/Addressing Mode with illustration/ Addressing mode in 8086
PPTX
Instruction Execution Cycle
PPTX
General register organization (computer organization)
PPTX
ADDRESSING MODES
PPTX
Asynchronous Data Transfer.pptx
PPT
Central processing unit and stack organization r013
PPTX
Addressing modes
Instruction codes
Addressing modes/Addressing Mode with illustration/ Addressing mode in 8086
Instruction Execution Cycle
General register organization (computer organization)
ADDRESSING MODES
Asynchronous Data Transfer.pptx
Central processing unit and stack organization r013
Addressing modes

What's hot (20)

PPTX
Types of Addressing modes- COA
PPTX
Types of Instruction Format
PPTX
Microprogrammed Control Unit
PPTX
Interrupts on 8086 microprocessor by vijay kumar.k
PPTX
Register Reference Instructions | Computer Science
PPTX
instruction format and addressing modes
PPTX
bus and memory tranfer (computer organaization)
PPTX
Arithmetic logic shift unit
PPT
Types of instructions
PPT
Instruction codes and computer registers
PPT
Memory & I/O interfacing
PPTX
Microoperations
PPTX
Addressing modes of 8086
PPTX
Addressing sequencing
PPT
Instruction cycle
PPTX
Assembly language
PDF
Addressing modes in computer organization
PPTX
Logical and shift micro operations
DOCX
Control Units : Microprogrammed and Hardwired:control unit
PPTX
Basic Computer Organization and Design
Types of Addressing modes- COA
Types of Instruction Format
Microprogrammed Control Unit
Interrupts on 8086 microprocessor by vijay kumar.k
Register Reference Instructions | Computer Science
instruction format and addressing modes
bus and memory tranfer (computer organaization)
Arithmetic logic shift unit
Types of instructions
Instruction codes and computer registers
Memory & I/O interfacing
Microoperations
Addressing modes of 8086
Addressing sequencing
Instruction cycle
Assembly language
Addressing modes in computer organization
Logical and shift micro operations
Control Units : Microprogrammed and Hardwired:control unit
Basic Computer Organization and Design
Ad

Similar to Addressing modes (20)

PPTX
Addressing modes
PPTX
PPTX
PPT on Addressing Modes.ppt.pptx
PPTX
Addressing modes
PPTX
ADDRESSING MODES.pptx
PPTX
ADDRESSING MODES
PPTX
addressing modes
PPTX
Introduction to Addressing modes in computer memory.pptx
PPTX
UNDERSTANDING ADDRESSING MODES1 IN THE CPU.pptx
PPTX
Addressing Modes.pptx
PPTX
a-m-170612075909.pptx download by student
PPTX
ADDRESSING MODE
PPTX
Addressing Modes
PPTX
module 3 instruction set and control unit
PPTX
Instruction Codes.pptx
PPTX
Instruction Formats in computer architecture.pptx
DOCX
PDF
Lect14 organization
PPTX
Computer Organization and Design.pptx
PPTX
ITEC582-Chapter 13-CO-UNIT-1-IMPORT.pptx
Addressing modes
PPT on Addressing Modes.ppt.pptx
Addressing modes
ADDRESSING MODES.pptx
ADDRESSING MODES
addressing modes
Introduction to Addressing modes in computer memory.pptx
UNDERSTANDING ADDRESSING MODES1 IN THE CPU.pptx
Addressing Modes.pptx
a-m-170612075909.pptx download by student
ADDRESSING MODE
Addressing Modes
module 3 instruction set and control unit
Instruction Codes.pptx
Instruction Formats in computer architecture.pptx
Lect14 organization
Computer Organization and Design.pptx
ITEC582-Chapter 13-CO-UNIT-1-IMPORT.pptx
Ad

More from Mahesh Kumar Attri (20)

PPT
Web technologies
DOC
Plant layout
PPT
application layers
PPT
Multiplexing
PPT
Lect21 09-11
PPT
work measurement
PPTX
production management
PPTX
PPT
Errror Detection and Correction
PPT
Data Communication
PPT
PPT
International marketing
PPT
OSI models
PPT
1.prallelism
PPT
As department
PPT
2.computer org.
PPT
1.prallelism
Web technologies
Plant layout
application layers
Multiplexing
Lect21 09-11
work measurement
production management
Errror Detection and Correction
Data Communication
International marketing
OSI models
1.prallelism
As department
2.computer org.
1.prallelism

Addressing modes

  • 2. THE OPERATION FIELD OF AN INSTRUCTION SPECIFIES THE OPERATION TO BE PERFORMED. THIS OPERATION MUST BE EXECUTED ON THE DATA STORED IN COMPUTER REGISTERS OR THE MEMORY WORDS. THE WAY THE OPERANDS ARE CHOSEN DURING PROGRAM EXECUTION IS DEPENDENT ON THE ADDRESSING MODE OF THE INSTRUCTION. THE ADDRESSING MODE: Specifies a rule for interpreting or modifying the address field of the instruction before the operand is actually referenced.
  • 3. COMPUTERS USE ADDRESSING MODE TECHNIQUES FOR THE PURPOSE OF ACCOMODATING THE FOLLOWING PURPOSES:- 1.) 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. 2.) To reduce the number of bits in the addressing field of the instructions.
  • 4. To understand the various addressing modes, It is imperative that we understand the basic operation cycle of the computer. The control unit of a computer is designed to go through an instruction cycle that is divided into 3 major parts:- Fetch the instruction from memory Decode the instruction and Execute the instruction.
  • 5. Now to complete the above mentioned process we need to study some terminology that forms a important part of instruction cycle. ♣ PROGRAM COUNTER: ¤ There is 1 register in the computer called the program counter or PC that keeps track of the instructions in the program stored in memory. ¤ PC holds the address of the instructions to be executed next and is incremented each time an instruction is fetched from memory. ¤ The decoding of the instruction is done in the next step tells which operation is to be performed, the addressing mode of the instruction, and the location of the operands. ¤ The computer then executes the instruction and returns to the step1, i.e. to fetch the next instruction.
  • 6. ♣ MODE FIELD: An example of an instruction format with a distinct addressing mode field is shown below: Opcode Mode Address The mode field is used to locate the Operands needed for the operation. There may or may not be the address field in the instruction.
  • 7. Although most addressing modes modify the address field of the instruction, there are two modes that need no address field at all: 1.) Implied mode 2.) Immediate mode. IMPLIED MODE: In this mode the operands are specified implicitly in the definition of the instruction. For example:- “ compliment 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.
  • 8. Immediate 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. The operand field contains the actual operand to be used in conjunction with the operation specified in the instruction. -- 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.
  • 9. Register mode: In this mode the operands are in registers that reside within the C.P.U. The particular register is selected from the register field in the instruction. A K-bit field can specify any one of 2 k registers. Register indirect 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. Advantage: The address field of the instruction uses fewer bits to select a register than would have been required to specify a memory address directly.
  • 10. Auto increment or auto decrement : 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. For that we need to know about the concept of ‘EFFECTIVE ADDRESS’.
  • 11. Effective address: 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. DIRECT ADDRESS 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.
  • 12. INDIRECT ADDRESS 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. Some addressing modes requires the following to calculate the effective address: Effective address= address part of instruction+ content of CPU register
  • 13. RELATIVE ADDRESS MODE In this mode the content of the program counter 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 . INDEXED ADDERESSING MODE In this mode the content of an index register 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 ic automatically converted to the register indirect mode of operation.
  • 14. BASE REGISTER ADDRESSING MODE In this mode the content of a base register 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. When programs and data are moved from one segment of memory to another.
  • 15. NUMERICAL EXAMPLE PC=200 R1=400 XR=100 AC ADDRESS MEMORY 200 201 202 399 400 500 600 702 800 300 325 900 800 700 450 NEXT INSTRUCTION ADDRESS=500 LOAD TO AC MODE
  • 16. ADDRESSING EFFECTIVE CONTENT MODE ADDRESS TO AC DIRECT ADDRESS 500 800 IMMEDIATE OPERANDS 201 500 INDIRECT ADDRESS 800 300 RELATIVE ADDRESS 702 325 INDEXED ADDRESS 600 900 REGISTER ---- 400 REGISTER INDIRECT 400 700 AUTOINCREMENT 400 700 AUTODECREMENT 399 450