SlideShare a Scribd company logo
1 of 17
ADDRESSING
MODES
MUKTA GARG
ASSISTANT PROFESSOR
ADVANCED EDUCATIONAL INSTITUTE
www.advanced.edu.in
www.advanced.edu.in
THE ADDRESSING MODE
Specifies a rule for interpreting or modifying the address field of the instruction before the operand is
actually referenced.
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.
www.advanced.edu.in
COMPUTERS USE ADDRESSING MODE TECHNIQUES FOR THE PURPOSE OF ACCOMODATING 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.
www.advanced.edu.in
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:-
1. Fetch the instruction from memory
2. Decode the instruction, and
3. Execute the instruction.
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 that is to be 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.
www.advanced.edu.in
PROGRAM COUNTER:
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.
www.advanced.edu.in
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.
www.advanced.edu.in
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.
Note: 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.
www.advanced.edu.in
www.advanced.edu.in
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 2k 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
www.advanced.edu.in
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’.
www.advanced.edu.in
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.
www.advanced.edu.in
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 calculation to generate the effective address:
Effective address= address part of instruction+content of CPU register
RELATIVE ADDRESSMODE
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 i.e.
automatically converted to the register indirect mode of operation.
www.advanced.edu.in
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.
www.advanced.edu.in
NUMERICAL EXAMPLE
PC=200
R1=400
XR=100
AC
LOAD TO AC
MODE
ADDRESS=500
NEXT INSTRUCTION
450
700
800
900
325
300
ADDRESS
MEMORY
200
201
202
399
400
500
600
702
200www.advanced.edu.in
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
www.advanced.edu.in
Mukta Garg
Assistant Professor
Advanced Educational Institute
Advanced Educational Institutions,
70 km Milestone,
Delhi-Mathura Road, Dist. Palwal, Haryana-121105
+91–1275–398400, 302222
Rahul.sharma90@gmail.com
www.advance.edu.in
www.advanced.edu.in

More Related Content

What's hot

Microprogram Control
Microprogram Control Microprogram Control
Microprogram Control Anuj Modi
 
Instruction Set Architecture
Instruction Set ArchitectureInstruction Set Architecture
Instruction Set ArchitectureDilum Bandara
 
Types of Instruction Format
Types of Instruction FormatTypes of Instruction Format
Types of Instruction FormatDhrumil Panchal
 
Input Output Organization
Input Output OrganizationInput Output Organization
Input Output OrganizationKamal Acharya
 
Processor Organization and Architecture
Processor Organization and ArchitectureProcessor Organization and Architecture
Processor Organization and ArchitectureVinit Raut
 
8086 microprocessor-architecture
8086 microprocessor-architecture8086 microprocessor-architecture
8086 microprocessor-architectureprasadpawaskar
 
Stack organization
Stack organizationStack organization
Stack organizationchauhankapil
 
Modes Of Transfer in Input/Output Organization
Modes Of Transfer in Input/Output OrganizationModes Of Transfer in Input/Output Organization
Modes Of Transfer in Input/Output OrganizationMOHIT AGARWAL
 
Addressing modes
Addressing modesAddressing modes
Addressing modesAsif Iqbal
 
Control Units : Microprogrammed and Hardwired:control unit
Control Units : Microprogrammed and Hardwired:control unitControl Units : Microprogrammed and Hardwired:control unit
Control Units : Microprogrammed and Hardwired:control unitabdosaidgkv
 
Instruction cycle
Instruction cycleInstruction cycle
Instruction cycleKumar
 

What's hot (20)

Instruction cycle
Instruction cycleInstruction cycle
Instruction cycle
 
Microprogram Control
Microprogram Control Microprogram Control
Microprogram Control
 
Instruction Set Architecture
Instruction Set ArchitectureInstruction Set Architecture
Instruction Set Architecture
 
Addresing modes
Addresing modesAddresing modes
Addresing modes
 
addressing modes
addressing modesaddressing modes
addressing modes
 
Types of Instruction Format
Types of Instruction FormatTypes of Instruction Format
Types of Instruction Format
 
Input Output Organization
Input Output OrganizationInput Output Organization
Input Output Organization
 
Processor Organization and Architecture
Processor Organization and ArchitectureProcessor Organization and Architecture
Processor Organization and Architecture
 
8086 microprocessor-architecture
8086 microprocessor-architecture8086 microprocessor-architecture
8086 microprocessor-architecture
 
Memory mapping
Memory mappingMemory mapping
Memory mapping
 
Instruction format
Instruction formatInstruction format
Instruction format
 
Addressing modes
Addressing modesAddressing modes
Addressing modes
 
Stack organization
Stack organizationStack organization
Stack organization
 
Modes Of Transfer in Input/Output Organization
Modes Of Transfer in Input/Output OrganizationModes Of Transfer in Input/Output Organization
Modes Of Transfer in Input/Output Organization
 
Input output interface
Input output interfaceInput output interface
Input output interface
 
Registers
RegistersRegisters
Registers
 
Addressing modes
Addressing modesAddressing modes
Addressing modes
 
Control Units : Microprogrammed and Hardwired:control unit
Control Units : Microprogrammed and Hardwired:control unitControl Units : Microprogrammed and Hardwired:control unit
Control Units : Microprogrammed and Hardwired:control unit
 
pipelining
pipeliningpipelining
pipelining
 
Instruction cycle
Instruction cycleInstruction cycle
Instruction cycle
 

Similar to Addressing modes (20)

ADDRESSING MODES.pptx
ADDRESSING MODES.pptxADDRESSING MODES.pptx
ADDRESSING MODES.pptx
 
PPT on Addressing Modes.ppt.pptx
PPT on Addressing Modes.ppt.pptxPPT on Addressing Modes.ppt.pptx
PPT on Addressing Modes.ppt.pptx
 
Addressing modes
Addressing modesAddressing modes
Addressing modes
 
Addressing Modes.pptx
Addressing Modes.pptxAddressing Modes.pptx
Addressing Modes.pptx
 
ADDRESSING MODE
ADDRESSING MODEADDRESSING MODE
ADDRESSING MODE
 
ADDRESSING MODES.pptx
ADDRESSING MODES.pptxADDRESSING MODES.pptx
ADDRESSING MODES.pptx
 
ADDRESSING MODES
ADDRESSING MODESADDRESSING MODES
ADDRESSING MODES
 
Lect14 organization
Lect14 organizationLect14 organization
Lect14 organization
 
Addressing Modes
Addressing ModesAddressing Modes
Addressing Modes
 
Instruction Codes.pptx
Instruction Codes.pptxInstruction Codes.pptx
Instruction Codes.pptx
 
UNIT-2.pptx
UNIT-2.pptxUNIT-2.pptx
UNIT-2.pptx
 
Cao
CaoCao
Cao
 
CS304PC:Computer Organization and Architecture Session 13 Addressing modes.pptx
CS304PC:Computer Organization and Architecture  Session 13 Addressing modes.pptxCS304PC:Computer Organization and Architecture  Session 13 Addressing modes.pptx
CS304PC:Computer Organization and Architecture Session 13 Addressing modes.pptx
 
Addressing modes, Operations in the instruction set 1.2.3 (1).pptx
Addressing modes, Operations in the instruction set 1.2.3 (1).pptxAddressing modes, Operations in the instruction set 1.2.3 (1).pptx
Addressing modes, Operations in the instruction set 1.2.3 (1).pptx
 
Unit 2
Unit 2Unit 2
Unit 2
 
Unit 2
Unit 2Unit 2
Unit 2
 
Addressing mode
Addressing modeAddressing mode
Addressing mode
 
Instruction-Sets-2.pptx
Instruction-Sets-2.pptxInstruction-Sets-2.pptx
Instruction-Sets-2.pptx
 
ITEC582-Chapter 12.pptx
ITEC582-Chapter 12.pptxITEC582-Chapter 12.pptx
ITEC582-Chapter 12.pptx
 
Cpu execution
Cpu executionCpu execution
Cpu execution
 

Recently uploaded

Online food ordering system project report.pdf
Online food ordering system project report.pdfOnline food ordering system project report.pdf
Online food ordering system project report.pdfKamal Acharya
 
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptxS1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptxSCMS School of Architecture
 
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...Arindam Chakraborty, Ph.D., P.E. (CA, TX)
 
Computer Lecture 01.pptxIntroduction to Computers
Computer Lecture 01.pptxIntroduction to ComputersComputer Lecture 01.pptxIntroduction to Computers
Computer Lecture 01.pptxIntroduction to ComputersMairaAshraf6
 
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Service
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best ServiceTamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Service
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Servicemeghakumariji156
 
Double Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torqueDouble Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torqueBhangaleSonal
 
DC MACHINE-Motoring and generation, Armature circuit equation
DC MACHINE-Motoring and generation, Armature circuit equationDC MACHINE-Motoring and generation, Armature circuit equation
DC MACHINE-Motoring and generation, Armature circuit equationBhangaleSonal
 
Verification of thevenin's theorem for BEEE Lab (1).pptx
Verification of thevenin's theorem for BEEE Lab (1).pptxVerification of thevenin's theorem for BEEE Lab (1).pptx
Verification of thevenin's theorem for BEEE Lab (1).pptxchumtiyababu
 
HAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKAR
HAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKARHAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKAR
HAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKARKOUSTAV SARKAR
 
Employee leave management system project.
Employee leave management system project.Employee leave management system project.
Employee leave management system project.Kamal Acharya
 
School management system project Report.pdf
School management system project Report.pdfSchool management system project Report.pdf
School management system project Report.pdfKamal Acharya
 
Generative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPTGenerative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPTbhaskargani46
 
"Lesotho Leaps Forward: A Chronicle of Transformative Developments"
"Lesotho Leaps Forward: A Chronicle of Transformative Developments""Lesotho Leaps Forward: A Chronicle of Transformative Developments"
"Lesotho Leaps Forward: A Chronicle of Transformative Developments"mphochane1998
 
Thermal Engineering Unit - I & II . ppt
Thermal Engineering  Unit - I & II . pptThermal Engineering  Unit - I & II . ppt
Thermal Engineering Unit - I & II . pptDineshKumar4165
 
Thermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - VThermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - VDineshKumar4165
 
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptxHOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptxSCMS School of Architecture
 
Engineering Drawing focus on projection of planes
Engineering Drawing focus on projection of planesEngineering Drawing focus on projection of planes
Engineering Drawing focus on projection of planesRAJNEESHKUMAR341697
 
Orlando’s Arnold Palmer Hospital Layout Strategy-1.pptx
Orlando’s Arnold Palmer Hospital Layout Strategy-1.pptxOrlando’s Arnold Palmer Hospital Layout Strategy-1.pptx
Orlando’s Arnold Palmer Hospital Layout Strategy-1.pptxMuhammadAsimMuhammad6
 
Online electricity billing project report..pdf
Online electricity billing project report..pdfOnline electricity billing project report..pdf
Online electricity billing project report..pdfKamal Acharya
 

Recently uploaded (20)

Online food ordering system project report.pdf
Online food ordering system project report.pdfOnline food ordering system project report.pdf
Online food ordering system project report.pdf
 
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptxS1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
 
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
 
Computer Lecture 01.pptxIntroduction to Computers
Computer Lecture 01.pptxIntroduction to ComputersComputer Lecture 01.pptxIntroduction to Computers
Computer Lecture 01.pptxIntroduction to Computers
 
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Service
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best ServiceTamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Service
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Service
 
Double Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torqueDouble Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torque
 
DC MACHINE-Motoring and generation, Armature circuit equation
DC MACHINE-Motoring and generation, Armature circuit equationDC MACHINE-Motoring and generation, Armature circuit equation
DC MACHINE-Motoring and generation, Armature circuit equation
 
Verification of thevenin's theorem for BEEE Lab (1).pptx
Verification of thevenin's theorem for BEEE Lab (1).pptxVerification of thevenin's theorem for BEEE Lab (1).pptx
Verification of thevenin's theorem for BEEE Lab (1).pptx
 
HAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKAR
HAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKARHAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKAR
HAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKAR
 
Employee leave management system project.
Employee leave management system project.Employee leave management system project.
Employee leave management system project.
 
School management system project Report.pdf
School management system project Report.pdfSchool management system project Report.pdf
School management system project Report.pdf
 
Generative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPTGenerative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPT
 
"Lesotho Leaps Forward: A Chronicle of Transformative Developments"
"Lesotho Leaps Forward: A Chronicle of Transformative Developments""Lesotho Leaps Forward: A Chronicle of Transformative Developments"
"Lesotho Leaps Forward: A Chronicle of Transformative Developments"
 
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak HamilCara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
 
Thermal Engineering Unit - I & II . ppt
Thermal Engineering  Unit - I & II . pptThermal Engineering  Unit - I & II . ppt
Thermal Engineering Unit - I & II . ppt
 
Thermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - VThermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - V
 
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptxHOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
 
Engineering Drawing focus on projection of planes
Engineering Drawing focus on projection of planesEngineering Drawing focus on projection of planes
Engineering Drawing focus on projection of planes
 
Orlando’s Arnold Palmer Hospital Layout Strategy-1.pptx
Orlando’s Arnold Palmer Hospital Layout Strategy-1.pptxOrlando’s Arnold Palmer Hospital Layout Strategy-1.pptx
Orlando’s Arnold Palmer Hospital Layout Strategy-1.pptx
 
Online electricity billing project report..pdf
Online electricity billing project report..pdfOnline electricity billing project report..pdf
Online electricity billing project report..pdf
 

Addressing modes

  • 1. ADDRESSING MODES MUKTA GARG ASSISTANT PROFESSOR ADVANCED EDUCATIONAL INSTITUTE www.advanced.edu.in
  • 2. www.advanced.edu.in THE ADDRESSING MODE Specifies a rule for interpreting or modifying the address field of the instruction before the operand is actually referenced. 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.
  • 3. www.advanced.edu.in COMPUTERS USE ADDRESSING MODE TECHNIQUES FOR THE PURPOSE OF ACCOMODATING 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.
  • 4. www.advanced.edu.in 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:- 1. Fetch the instruction from memory 2. Decode the instruction, and 3. Execute the instruction.
  • 5. 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 that is to be 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. www.advanced.edu.in PROGRAM COUNTER:
  • 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. www.advanced.edu.in
  • 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. www.advanced.edu.in
  • 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. Note: 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. www.advanced.edu.in
  • 9. www.advanced.edu.in 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 2k 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 www.advanced.edu.in 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. www.advanced.edu.in 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. www.advanced.edu.in 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 calculation to generate the effective address: Effective address= address part of instruction+content of CPU register
  • 13. RELATIVE ADDRESSMODE 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 i.e. automatically converted to the register indirect mode of operation. www.advanced.edu.in
  • 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. www.advanced.edu.in
  • 15. NUMERICAL EXAMPLE PC=200 R1=400 XR=100 AC LOAD TO AC MODE ADDRESS=500 NEXT INSTRUCTION 450 700 800 900 325 300 ADDRESS MEMORY 200 201 202 399 400 500 600 702 200www.advanced.edu.in
  • 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 www.advanced.edu.in
  • 17. Mukta Garg Assistant Professor Advanced Educational Institute Advanced Educational Institutions, 70 km Milestone, Delhi-Mathura Road, Dist. Palwal, Haryana-121105 +91–1275–398400, 302222 Rahul.sharma90@gmail.com www.advance.edu.in www.advanced.edu.in