Monday, March 23, 2015

Addressing Modes and Formats

 Different Addressing mode are:-

 

1. Immediate addressing mode
2. Direct addressing mode
3. Indirect addressing mode
4. Register addressing mode
5. Register Indirect addressing mode
6. Displacement addressing mode

 

1. Immediate Addressing mode




 
                          Instruction


     Opcode
      Operand

 

  • Operand is part of instruction.
  • Operand = address field.
  • Eg Add 5
              >  Add 5 to contents of accumulator
              >  5 is operand
  • No memory reference to fetch data
  • fast
  • Limited range

2. Direct Addressing mode


           
Direct addressing
Fig:- Direct addressing
                             
  • Address field contains address of operand
  • Effective address (EA) = address field(A)
  • Eg Add A
                 >Add contents of cell A to accumulator
                  >Look in memory reference at address A for operand
  • Single memory reference to access data.
  • No additional calculations to work out effective address.
  • limited address space

3. Indirect Addressing mode



Indirect addressing
Indirect addressing
  • Memory location pointed by address field contains the address of operand.
  • Effective address(EA)=(A) look in A,find address(A) and look there for operand.
  • Eg ADD (A) :- Add contents of cell pointed to by contents of A to Accumulator.
  • Multiple memory accesses to find operand.
  • Hence slower.

4. Register Addressing mode



Register addressing mode
Register addressing mode
  • Operand is held in register named in address field.
  • EA = R.
  • Limited number of registers.
  • Very small address field needed.
                - Shorter instructions.
                - Faster operand fetch.
                - No memory reference,hence fast execution
                - Very limited space.

5. Register indirect addressing mode


Register Indirect addressing mode
Register Indirect addressing mode


  • EA=R
  • Operand is in memory cell pointed to by contents of register R.
  • Larger address space.
  • Similar to indirect addressing but one fewer memory access than indirect accessing.

6. Displacement Addressing 



Displacement addressing mode
Displacement addressing mode
  • EA=A+(R)
  • Address field hold two values
                - A=base value
                - R= Register that holds displacement.
                   or vice versa.

7. Relative addressing


  • A version of displacement addressing.
  • R=Program counter, PC
  • EA= A+(PC)

8. Base register addressing

  • A holds displacement.
  • R holds pointer to base address.
  • R may be explicit or implicit.

9. Stack addressing

  • A=base
  • R=displacement.
  • EA=A+R
  •  Good for accessing arrays

No comments:

Post a Comment