SlideShare a Scribd company logo
GOOD MORNING
FRIENDS!!!!!
ADDRESSING MODES
By Nithin Santhosh
WHAT IS ADDRESSING MODE?
The different ways in which location of an operand is specified in an instruction are
referred to as “Addressing Modes”.
The different types of generic addressing modes are Immediate, Register,
Absolute(Direct), Indirect, Index, Base with index, Base with index and offset, Relative,
Autoincrement, Autodecrement .
Register Addressing Mode
Register addressing mode involves the use of registers to hold the data to be
manipulated.
Eg : Mov A,R0
Mov R1,R0
Mov Res,R1
In this mode operand is the content of a processor register.
ABSOLUTE MODE(DIRECT MODE)
In the absolute or direct addressing mode, the data is in a ram memory location whose
address is known, and this address is given as a part of the instruction.
Eg : Mov Loc,R1
IMMEDIATE ADDRESSING MODE
In this addressing mode, the source operand is a constant.
In immediate addressing mode, as the name indicates when the
instruction is assembled, the operand comes immediately after the
opcode.
In this addressing mode the data must be immediately
preceded by the pound sign, ‘#’;
INDIRECT ADDRESSING MODE
In this addressing mode, the instruction does not give the operand or
its address explicitly.
This addressing mode provides information from which the memory address
or the operand can be determined. This address is the effective address of
the operand.
When we use this addressing mode here actually the register acts as a pointer, where
pointer is nothing but the register or memory location that contains the address of an
operand.
Continuation…..
Example : Move N,R1
Move #Num1,R2
Clear R0
LOOP: Add (R2),R0
Add #4,R2
Decrement R1
Branch>0 LOOP
Move R0,Sum
INDEX ADDRESSING MODE
This is useful in dealing with lists and arrays.
The effective address of the operand is generated by adding a constant
value to the contents of the register.
The register used may be either a special function register or general purpose
register, the register which we use here is known as “index register”.
We indicate the Index mode symbolically as X(Ri).
Continuation……….
In X(Ri)
X denotes the constant value contained in the instruction
and
Ri is the name of the register involved.
The effective address of the operand is given by
EA = X+[Ri].
The contents of the index registers are not changed in the
process of generating the effective address.
The value X defines an offset also called as a
displacement.
Continuation…….
Move #LIST,R0
Clear R1
Clear R2
Clear R3
Move N,R4
Add 4(R0),R1
Add 8(R0),R2
Add 12(R0),R3
Add #16,R0
Decrement R4
Branch>0 LOOP
Move R1,SUM1
Move R2,SUM2
Move R3,SUM3
LOOP:
RELATIVE ADDRESSING MODE
In this addressing mode the effective address is determined by the Index
mode using the program counter in the place of general purpose register
Ri.
ADDITIONAL MODES
The two additional modes are Autoincrement and Autodecrement mode.
Autoincrementmode – The effective address of the operand is the
contents of a register specified in the instruction. After accessing the
operand, the contents of this register are automatically incremented to
point to the next item in a list. The autoincrement mode is written as
(Ri)+
Autodecrementmode - The contents of a register specified in the
instruction are first automatically decremented and are then used as the
effective address of the operand. The Autodecrementmode is written as
-(Ri)
ADVANTAGE OF INDIRECT OVERDIRECT MODE
In direct addressing mode we cannot use loops, and in case of indirect addressing mode we
can use loop.
QUESTIONS
Registers R1 and R2 of a computer contain the decimal values 1200 and 4600. What is the
effective address of the memory operand in each of the following instructions?
Q1.
i) Load 20(R1),R5
a) 20 b) 4600 c)1220 d)1200
Ans : 1220
ii) Move #3000,R5
a)1220 b)1400 c)4600 d)None of the above
Ans : d) None of the above
iii) Store R5,30(R1,R2)
a)5830 b)5600 c)1200 d)4600
Ans : a)5830
iv) Add -(R2),R5
v) Add (R1)+,R5
a)1200 b)4599 c)1199 d)4600
Ans : b)4599
a)1199 b)1200 c)1198d)1201
Ans : d)1199
Q 2. Identify the addressing modes
i) ADD #6,R1
a)Register b)Absolute(Direct) c)Indirect d)Index e)Immediate
Ans : a) and e)
ii) ADD R1
a)Register b)Absolute(Direct) c)Indirect d)Index e)Immediate
Ans : a)
iii) ADD (R1)+,R5
a)Increment Mode b)Absolute(Direct) c) Autoincrement Mode d)Index e)Immediate
Ans : C) Autoincrement Mode
iv) Load 20(R1),R5
a)Base with index and offset b)Absolute(Direct) c)Indirect d)Index e)Immediate
Ans : d)Index
v) Store R5,30(R1,R2)
a)Base with index and offset b)Absolute(Direct) c)Indirect d)Index e)Immediate
Ans : a)Base with index and offset
Sorting
The process of rearranging the elements so that they are in ascending
or descending order is called as sorting
The various types of sorting are bubble sort, quick sort, insertion
sort etc…
C-Language for bubble sorting
for (j=n-1;j>0;j=j-1)
{
for(k=j-1;k>0;k=k-1)
{
if(List[k]>List[j])
{
Temp=List[k];
List[k]=List[j];
List[j]=Temp;
}
}
}
ALP For Bubble Sorting
Move #LIST,R0
Move N,R1
Subtract #1,R1
OUTER Move R2,R2
Subtract #1,R1
MoveByte (R0,R1),R3
INNER CompareByte R3,(R0,R2)
Branch<=0 NEXT
MoveByte (R0,R2),R4
MoveByte R3,(R0,R2)
MoveByte R4,(R0,R1)
MoveByte R4,R3
NEXT Decrement R2
Branch>=0 INNER
Decrement R1
Branch>0 OUTER
END!!!!!

More Related Content

PPTX
Addressing modes
PPTX
Computer Organisation - Addressing Modes
PPT
Instruction cycle
PPT
Instruction codes and computer registers
PDF
Addressing modes/Addressing Mode with illustration/ Addressing mode in 8086
PPTX
ADDRESSING MODE
PPS
Registers and-common-bus
PPTX
3.programmable interrupt controller 8259
Addressing modes
Computer Organisation - Addressing Modes
Instruction cycle
Instruction codes and computer registers
Addressing modes/Addressing Mode with illustration/ Addressing mode in 8086
ADDRESSING MODE
Registers and-common-bus
3.programmable interrupt controller 8259

What's hot (20)

PPTX
memory reference instruction
PPTX
Arithmetic logic shift unit
PPT
Central processing unit and stack organization r013
PPTX
Instruction set of 8086
PPTX
Addressing modes ppt
PPTX
Logical and shift micro operations
PDF
Addressing modes of 80386
PPTX
Stack organization
PPTX
Computer registers
PPTX
Segment registers
DOCX
Arm7 Interfacing examples
PPTX
Logical, Shift, and Rotate Instruction
PPTX
Register transfer language
PPTX
Computer organization and architecture
PDF
Program execution, straight line sequence and branching
PPT
1.ADDRESSING MODES OF 8086.ppt
PPTX
Lecture 28 , 29 & 30(instruction set & addressing mode of 8086.pptx
PPS
Cache memory
PPT
Addressing modes
memory reference instruction
Arithmetic logic shift unit
Central processing unit and stack organization r013
Instruction set of 8086
Addressing modes ppt
Logical and shift micro operations
Addressing modes of 80386
Stack organization
Computer registers
Segment registers
Arm7 Interfacing examples
Logical, Shift, and Rotate Instruction
Register transfer language
Computer organization and architecture
Program execution, straight line sequence and branching
1.ADDRESSING MODES OF 8086.ppt
Lecture 28 , 29 & 30(instruction set & addressing mode of 8086.pptx
Cache memory
Addressing modes
Ad

Viewers also liked (11)

PPTX
Addressing modes
PDF
Databus - Abhishek Bhargava & Maheswaran Veluchamy - DevOps Bangalore Meetup...
PPTX
Databus: LinkedIn's Change Data Capture Pipeline SOCC 2012
PPTX
5.4 Data Bus
PPTX
Addressing mode & data transfer instruction of 8085
PDF
Assembly Language Programming By Ytha Yu, Charles Marut Chap 10 ( Arrays and ...
PPTX
Addressing mode
PPT
Addressing modes
PPT
Addressing mode of 8051
PPTX
BASIC COMPUTER ARCHITECTURE
PDF
Introduction to Databus
Addressing modes
Databus - Abhishek Bhargava & Maheswaran Veluchamy - DevOps Bangalore Meetup...
Databus: LinkedIn's Change Data Capture Pipeline SOCC 2012
5.4 Data Bus
Addressing mode & data transfer instruction of 8085
Assembly Language Programming By Ytha Yu, Charles Marut Chap 10 ( Arrays and ...
Addressing mode
Addressing modes
Addressing mode of 8051
BASIC COMPUTER ARCHITECTURE
Introduction to Databus
Ad

Similar to Addressing modes (20)

PPTX
Addressing modes of 8051
PPTX
Addressing Modes.pptx
PPT
Advanced computer architect lesson 3 and 4
PDF
Addressing modes to specify how the operands are accessed efficiently
PPTX
CH13-COA10e update Addressing mode of instruction.pptx
PPTX
Computer architecture addressing modes and formats
PPTX
Module 3.1_Instruction Types and Addressing modes.pptx
PPTX
Anshika 1111.pptx
PPT
Lecture 06
PPTX
csopptvhghjgluilyuiyuilyuiuiyuyuyuiyuy1.pptx
PPTX
Address
PPTX
UNIT-2.pptx
PPSX
Addressing modes presentation
PDF
Addressing modes in computer organization
DOCX
Assignment on different types of addressing modes
PPT
Instruction format
DOCX
Addressing modes Breifly
PPTX
MSc 1st year Computer system organization.pptx
PPTX
Different addressing modes in microcontrollers
PPTX
Lecture 10
Addressing modes of 8051
Addressing Modes.pptx
Advanced computer architect lesson 3 and 4
Addressing modes to specify how the operands are accessed efficiently
CH13-COA10e update Addressing mode of instruction.pptx
Computer architecture addressing modes and formats
Module 3.1_Instruction Types and Addressing modes.pptx
Anshika 1111.pptx
Lecture 06
csopptvhghjgluilyuiyuilyuiuiyuyuyuiyuy1.pptx
Address
UNIT-2.pptx
Addressing modes presentation
Addressing modes in computer organization
Assignment on different types of addressing modes
Instruction format
Addressing modes Breifly
MSc 1st year Computer system organization.pptx
Different addressing modes in microcontrollers
Lecture 10

Addressing modes

  • 3. WHAT IS ADDRESSING MODE? The different ways in which location of an operand is specified in an instruction are referred to as “Addressing Modes”. The different types of generic addressing modes are Immediate, Register, Absolute(Direct), Indirect, Index, Base with index, Base with index and offset, Relative, Autoincrement, Autodecrement .
  • 4. Register Addressing Mode Register addressing mode involves the use of registers to hold the data to be manipulated. Eg : Mov A,R0 Mov R1,R0 Mov Res,R1 In this mode operand is the content of a processor register.
  • 5. ABSOLUTE MODE(DIRECT MODE) In the absolute or direct addressing mode, the data is in a ram memory location whose address is known, and this address is given as a part of the instruction. Eg : Mov Loc,R1
  • 6. IMMEDIATE ADDRESSING MODE In this addressing mode, the source operand is a constant. In immediate addressing mode, as the name indicates when the instruction is assembled, the operand comes immediately after the opcode. In this addressing mode the data must be immediately preceded by the pound sign, ‘#’;
  • 7. INDIRECT ADDRESSING MODE In this addressing mode, the instruction does not give the operand or its address explicitly. This addressing mode provides information from which the memory address or the operand can be determined. This address is the effective address of the operand. When we use this addressing mode here actually the register acts as a pointer, where pointer is nothing but the register or memory location that contains the address of an operand.
  • 8. Continuation….. Example : Move N,R1 Move #Num1,R2 Clear R0 LOOP: Add (R2),R0 Add #4,R2 Decrement R1 Branch>0 LOOP Move R0,Sum
  • 9. INDEX ADDRESSING MODE This is useful in dealing with lists and arrays. The effective address of the operand is generated by adding a constant value to the contents of the register. The register used may be either a special function register or general purpose register, the register which we use here is known as “index register”. We indicate the Index mode symbolically as X(Ri).
  • 10. Continuation………. In X(Ri) X denotes the constant value contained in the instruction and Ri is the name of the register involved. The effective address of the operand is given by EA = X+[Ri]. The contents of the index registers are not changed in the process of generating the effective address. The value X defines an offset also called as a displacement.
  • 11. Continuation……. Move #LIST,R0 Clear R1 Clear R2 Clear R3 Move N,R4 Add 4(R0),R1 Add 8(R0),R2 Add 12(R0),R3 Add #16,R0 Decrement R4 Branch>0 LOOP Move R1,SUM1 Move R2,SUM2 Move R3,SUM3 LOOP:
  • 12. RELATIVE ADDRESSING MODE In this addressing mode the effective address is determined by the Index mode using the program counter in the place of general purpose register Ri.
  • 13. ADDITIONAL MODES The two additional modes are Autoincrement and Autodecrement mode. Autoincrementmode – The effective address of the operand is the contents of a register specified in the instruction. After accessing the operand, the contents of this register are automatically incremented to point to the next item in a list. The autoincrement mode is written as (Ri)+ Autodecrementmode - The contents of a register specified in the instruction are first automatically decremented and are then used as the effective address of the operand. The Autodecrementmode is written as -(Ri)
  • 14. ADVANTAGE OF INDIRECT OVERDIRECT MODE In direct addressing mode we cannot use loops, and in case of indirect addressing mode we can use loop.
  • 15. QUESTIONS Registers R1 and R2 of a computer contain the decimal values 1200 and 4600. What is the effective address of the memory operand in each of the following instructions? Q1. i) Load 20(R1),R5 a) 20 b) 4600 c)1220 d)1200 Ans : 1220
  • 16. ii) Move #3000,R5 a)1220 b)1400 c)4600 d)None of the above Ans : d) None of the above iii) Store R5,30(R1,R2) a)5830 b)5600 c)1200 d)4600 Ans : a)5830
  • 17. iv) Add -(R2),R5 v) Add (R1)+,R5 a)1200 b)4599 c)1199 d)4600 Ans : b)4599 a)1199 b)1200 c)1198d)1201 Ans : d)1199
  • 18. Q 2. Identify the addressing modes i) ADD #6,R1 a)Register b)Absolute(Direct) c)Indirect d)Index e)Immediate Ans : a) and e) ii) ADD R1 a)Register b)Absolute(Direct) c)Indirect d)Index e)Immediate Ans : a)
  • 19. iii) ADD (R1)+,R5 a)Increment Mode b)Absolute(Direct) c) Autoincrement Mode d)Index e)Immediate Ans : C) Autoincrement Mode iv) Load 20(R1),R5 a)Base with index and offset b)Absolute(Direct) c)Indirect d)Index e)Immediate Ans : d)Index
  • 20. v) Store R5,30(R1,R2) a)Base with index and offset b)Absolute(Direct) c)Indirect d)Index e)Immediate Ans : a)Base with index and offset
  • 21. Sorting The process of rearranging the elements so that they are in ascending or descending order is called as sorting The various types of sorting are bubble sort, quick sort, insertion sort etc…
  • 22. C-Language for bubble sorting for (j=n-1;j>0;j=j-1) { for(k=j-1;k>0;k=k-1) { if(List[k]>List[j]) { Temp=List[k]; List[k]=List[j]; List[j]=Temp; } } }
  • 23. ALP For Bubble Sorting Move #LIST,R0 Move N,R1 Subtract #1,R1 OUTER Move R2,R2 Subtract #1,R1 MoveByte (R0,R1),R3 INNER CompareByte R3,(R0,R2) Branch<=0 NEXT MoveByte (R0,R2),R4 MoveByte R3,(R0,R2) MoveByte R4,(R0,R1) MoveByte R4,R3 NEXT Decrement R2 Branch>=0 INNER Decrement R1 Branch>0 OUTER