12/14/2014
1
Computer Organization
Instructors :
Dr. Abdul Raouf Khan
Mr.Marwan El-Haj
Addressing Modes
The addressing mode specifies a rule for
interpreting or modifying the address field of
the instruction before the operand is actually
referenced.
In some computers, the addressing mode is
specified with a distinct binary code. Other
computers use a single binary code that
designates both the operation and mode of
the instruction.
12/14/2014
2
Advantages of using Addressing
modes
1. To give programming versatility to the user
by providing such facilities as pointers to
memory, counters for loop control, indexing
of data and program relocation.
2. To reduce the number of bits in the
addressing field of the instruction.
1. Implied Mode
In this mode the operands are specified implicitly in the
definition of the instruction. Needs no address field
for example: CMA (Complement Accumulator)
In fact all register reference instructions that use an
accumulator are implied-mode instructions.
Zero address instructions in a stack organized computer
are implied-mode instructions since the operands are
implied to be on top of the stack
12/14/2014
3
2. Immediate Mode
In this mode the operand is specified in the
instruction itself. Needs no address field
For example ADD 55, here 55 is the data to be
added not the address of the data.
Immediate mode instructions are useful for
initializing registers to a constant value.
3. Register Mode
In this mode the operands are in registers
that reside within the CPU.
For example MOV A, B
ADD C
Where A, B and C are the registers
This modes helps in faster execution.
12/14/2014
4
4. Register Indirect Mode
In this mode, the instruction specifies a
register which contains the address of the
operand.
The advantage is that the address field of the
instruction uses fewer bits to select a register
than would have been required to specify a
memory address directly.
5. 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.
Helps in actual address for branch type
instruction
12/14/2014
5
6. Indirect Address Mode
In this mode the address field of the
instruction gives the address where the
effective address is stored in memory.
7. 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.
Results in a shorter address field
12/14/2014
6
8. Indexed Address Mode
In this mode the content of an index register
is added to the address part of the instruction
to obtain the effective address.
Used to address arrays
9. Base Register Address Mode
In this mode the contents of a base register
is added to the address part of the instruction
to obtain the effective address.
Helps to relocate programs in the memory.
12/14/2014
7
Example continued .

Lect14 organization

  • 1.
    12/14/2014 1 Computer Organization Instructors : Dr.Abdul Raouf Khan Mr.Marwan El-Haj Addressing Modes The addressing mode specifies a rule for interpreting or modifying the address field of the instruction before the operand is actually referenced. In some computers, the addressing mode is specified with a distinct binary code. Other computers use a single binary code that designates both the operation and mode of the instruction.
  • 2.
    12/14/2014 2 Advantages of usingAddressing modes 1. To give programming versatility to the user by providing such facilities as pointers to memory, counters for loop control, indexing of data and program relocation. 2. To reduce the number of bits in the addressing field of the instruction. 1. Implied Mode In this mode the operands are specified implicitly in the definition of the instruction. Needs no address field for example: CMA (Complement Accumulator) In fact all register reference instructions that use an accumulator are implied-mode instructions. Zero address instructions in a stack organized computer are implied-mode instructions since the operands are implied to be on top of the stack
  • 3.
    12/14/2014 3 2. Immediate Mode Inthis mode the operand is specified in the instruction itself. Needs no address field For example ADD 55, here 55 is the data to be added not the address of the data. Immediate mode instructions are useful for initializing registers to a constant value. 3. Register Mode In this mode the operands are in registers that reside within the CPU. For example MOV A, B ADD C Where A, B and C are the registers This modes helps in faster execution.
  • 4.
    12/14/2014 4 4. Register IndirectMode In this mode, the instruction specifies a register which contains the address of the operand. The advantage is that the address field of the instruction uses fewer bits to select a register than would have been required to specify a memory address directly. 5. 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. Helps in actual address for branch type instruction
  • 5.
    12/14/2014 5 6. Indirect AddressMode In this mode the address field of the instruction gives the address where the effective address is stored in memory. 7. 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. Results in a shorter address field
  • 6.
    12/14/2014 6 8. Indexed AddressMode In this mode the content of an index register is added to the address part of the instruction to obtain the effective address. Used to address arrays 9. Base Register Address Mode In this mode the contents of a base register is added to the address part of the instruction to obtain the effective address. Helps to relocate programs in the memory.
  • 7.