CLASS PRESENTATION
UNIT-1
Mohammad Asif Iqbal
Assistant Professor,
Deptt of ECE,
JETGI, Barabanki
ADRESSING MODES
LETS BEGAIN WITH AS EXAMPLE..
Suppose we have a two operands instruction
ADD X, Y
X in register
Y in memory
Then, after taking this particular example, we were in fact working out
the series of actions we must take
Next step is to look the various possible ways in which the operands can
be referred to. In other words, what we are talking about is the different
modes in which we can address the data.
That is, modes of addressing the data or referring to the data will usually
be called addressing modes
DIFFERENT TYPES OF ADDRESSING MODE?
Immediate Addressing
Direct Addressing
Indirect Addressing
Register Addressing
Register Indirect Addressing
Relative Addressing
Indexed Addressing
IMMEDIATE ADDRESSING
Operand is given explicitly in the instruction
Operand = Value
e.g. ADD 5
Add 5 to contents of accumulator
5 is operand
No memory reference to fetch data
Fast
Limited range
Instruction
opcode operand
DIRECT ADDRESSING
Address field contains address of operand
Effective address (EA) = address field (A)
e.g. ADD A
Add contents of cell A to accumulator
Look in memory at address A for operand
Single memory reference to access data
No additional calculations to work out effective
address
Limited address space
DIRECT ADDRESSING DIAGRAM
INDIRECT ADDRESSING
Memory cell pointed to by address field contains
the address of (pointer to) the operand
EA = [A]
Look in A, find address (A) and look there for
operand
e.g. ADD (A)
Add contents of cell pointed to by contents of A to
accumulator
INDIRECT ADDRESSING
Large address space
2n where n = word length
May be nested, multilevel, cascaded
e.g. EA = (((A)))
Draw the diagram yourself
Multiple memory accesses to find operand
Hence slower
INDIRECT ADDRESSING DIAGRAM
REGISTER ADDRESSING
Operand is held in register named in
address field
EA = R
Limited number of registers
Very small address field needed
Shorter instructions
Faster instruction fetch
REGISTER ADDRESSING
No memory access
Very fast execution
Very limited address space
Multiple registers helps performance
Requires good assembly programming or
compiler writing
REGISTER ADDRESSING DIAGRAM
REGISTER INDIRECT ADDRESSING
C.f. indirect addressing
EA = [R]
Operand is in memory cell pointed to by
contents of register R
Large address space (2n)
One fewer memory access than indirect
addressing
REGISTER INDIRECT ADDRESSING DIAGRAM
INDEX ADDRESSING
EA = X + [R]
Address field hold two values
X = constant value (offset)
R = register that holds address of memory
locations
or vice versa
(Offset given as constant or in the index register)
Add 20(R1),R2 or Add 1000(R1),R2
INDEX ADDRESSING DIAGRAM
RELATIVE ADDRESSING
A version of displacement addressing
R = Program counter, PC
EA = X + (PC)
i.e. get operand from X bytes away from
current location pointed to by PC
c.f locality of reference & cache usage
AUTO INCREMENT MODE
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 the list
EA=[Ri]; Increment Ri ---- (Ri)+
Eg: Add (R2)+,R0
AUTO DECREMENT MODE
The contents of a register specified in the
instruction are first automatically
decremented and are then used as the
effective address of the operand
Decrement Ri; EA= [Ri] ----- -(Ri)
THANK YOU!

Addressing modes

  • 1.
    CLASS PRESENTATION UNIT-1 Mohammad AsifIqbal Assistant Professor, Deptt of ECE, JETGI, Barabanki
  • 2.
  • 3.
    LETS BEGAIN WITHAS EXAMPLE.. Suppose we have a two operands instruction ADD X, Y X in register Y in memory Then, after taking this particular example, we were in fact working out the series of actions we must take Next step is to look the various possible ways in which the operands can be referred to. In other words, what we are talking about is the different modes in which we can address the data. That is, modes of addressing the data or referring to the data will usually be called addressing modes
  • 4.
    DIFFERENT TYPES OFADDRESSING MODE? Immediate Addressing Direct Addressing Indirect Addressing Register Addressing Register Indirect Addressing Relative Addressing Indexed Addressing
  • 5.
    IMMEDIATE ADDRESSING Operand isgiven explicitly in the instruction Operand = Value e.g. ADD 5 Add 5 to contents of accumulator 5 is operand No memory reference to fetch data Fast Limited range Instruction opcode operand
  • 6.
    DIRECT ADDRESSING Address fieldcontains address of operand Effective address (EA) = address field (A) e.g. ADD A Add contents of cell A to accumulator Look in memory at address A for operand Single memory reference to access data No additional calculations to work out effective address Limited address space
  • 7.
  • 8.
    INDIRECT ADDRESSING Memory cellpointed to by address field contains the address of (pointer to) the operand EA = [A] Look in A, find address (A) and look there for operand e.g. ADD (A) Add contents of cell pointed to by contents of A to accumulator
  • 9.
    INDIRECT ADDRESSING Large addressspace 2n where n = word length May be nested, multilevel, cascaded e.g. EA = (((A))) Draw the diagram yourself Multiple memory accesses to find operand Hence slower
  • 10.
  • 11.
    REGISTER ADDRESSING Operand isheld in register named in address field EA = R Limited number of registers Very small address field needed Shorter instructions Faster instruction fetch
  • 12.
    REGISTER ADDRESSING No memoryaccess Very fast execution Very limited address space Multiple registers helps performance Requires good assembly programming or compiler writing
  • 13.
  • 14.
    REGISTER INDIRECT ADDRESSING C.f.indirect addressing EA = [R] Operand is in memory cell pointed to by contents of register R Large address space (2n) One fewer memory access than indirect addressing
  • 15.
  • 16.
    INDEX ADDRESSING EA =X + [R] Address field hold two values X = constant value (offset) R = register that holds address of memory locations or vice versa (Offset given as constant or in the index register) Add 20(R1),R2 or Add 1000(R1),R2
  • 17.
  • 18.
    RELATIVE ADDRESSING A versionof displacement addressing R = Program counter, PC EA = X + (PC) i.e. get operand from X bytes away from current location pointed to by PC c.f locality of reference & cache usage
  • 19.
    AUTO INCREMENT MODE Theeffective 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 the list EA=[Ri]; Increment Ri ---- (Ri)+ Eg: Add (R2)+,R0
  • 20.
    AUTO DECREMENT MODE Thecontents of a register specified in the instruction are first automatically decremented and are then used as the effective address of the operand Decrement Ri; EA= [Ri] ----- -(Ri)
  • 21.

Editor's Notes

  • #3 “Ant Colony Optimization (ACO) studies artificial systems that take inspiration from the behavior of real ant colonies and which are used to solve discrete optimization problems.”