Presented By: Syeda Rida Fatima Taqvi
Presented By: Syeda Rida Fatima Taqvi
Presented By: Syeda Rida Fatima Taqvi
Implied mode
Immediate mode
1-Implied mode:
In this mode the operands are specified implicitly in
the definition of the instruction.
for example: zero address instruction in stack
organized CPU the operation type instruction do
not need an address field. The instruction
ADD
in a stack computer consists of an operation code
only with no address field .There is no need to
specify operands with an address field since all
operands are implied to be in the stack.
2-Immediate Addressing Mode:
In this mode the operand itself specified in the
instruction . In other words
An immediate mode instruction has an
operand rather than an address field . The
operand field contain the actual operand to be
used.
for example:
MOV R # 20
This instruction is used to initialize a register to a
constant.
When the address field specify a processor register the
instruction is said to be in the register mode.
In the register mode the operands are in registers
that resides inside the CPU.
for example:
MOV R1 , R2
opcode Register name
R2
operand
4-Register Indirect Mode:
In this mode the instruction specifies register in the CPU whose content
give the address of the operand in the memory.
OR
The selected register contain the address of the register rather than
operand itself .
for example:
operand
Used in pointers.
5-Autoincrement/Autodecrement Mode:
In this mode E.A of the operand is the content of register
specified in instruction , after / before accessing the operand
the content of the register are automatically
incremented/decremented to the step size d.
This mode is similar to the register indirect mode except that
the register is incre /decr after its value is used.
For example: ADD R1,(R2)+ memory
opcode R
E.A=[R] 1000
E.A=[R]+d R 1001
E.A(1003)
E.A=[R]+2d 1002
operand
This mode is used in loop counter. 1003
6-Direct Addressing Mode:
In this mode E.A / address of operand directly given I n
instruction.
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.
opcode E.A
Operand
value
7-Indirect Addressing Mode:
In this mode address field of an instruction give the address where the
E.A is stored in memory . Control fetch the instruction from memory
and uses its address part to access memory again to read the E.A.
Example:
Memory
opcode
address
memory
E.A
memory
operand
A few addressing modes require that the address
field of the instruction be added to the content of
a specific register in the CPU the effective address
in these modes is obtained from the following
computation:
E.A = address part of the instruction
+ content of CPU register
The CPU register used in the computation may be
the PC(program counter),Index register , Base
register.
In either case we have different
addressing modes.
These modes are:
E.A=2000+1002
E.A= 3002
9-Index Addressing Mode:
In this mode the content of an index register is
added to the address part of the instruction to
obtain the effective address.
Base Register : It is a special CPU register that contains an index
value.
Address field of the instruction defines the beginning address of
data are in memory.
Each operand in array is stored in memory relative to the beginning
address.
The distance b/w the beginning address and the address of the
operand is the index value stored in the register .
Example:
Displacement
opcode
(A) base register
Base
address(B)
E.A=A+B