0% found this document useful (0 votes)
26 views8 pages

M3 Yash Allabadi

This document discusses various addressing modes used in computer instructions: 1) Immediate addressing specifies the operand directly in the instruction field rather than an address. Direct addressing uses an address field containing the operand's memory location. 2) Implied addressing implicitly defines the operands from the instruction itself. Indirect addressing uses the address field to point to the location holding the operand's address. 3) Register addressing modes specify the operand is contained in a register - either directly with register direct or indirectly with register indirect addressing the register holding the operand's address.

Uploaded by

degijon661
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
26 views8 pages

M3 Yash Allabadi

This document discusses various addressing modes used in computer instructions: 1) Immediate addressing specifies the operand directly in the instruction field rather than an address. Direct addressing uses an address field containing the operand's memory location. 2) Implied addressing implicitly defines the operands from the instruction itself. Indirect addressing uses the address field to point to the location holding the operand's address. 3) Register addressing modes specify the operand is contained in a register - either directly with register direct or indirectly with register indirect addressing the register holding the operand's address.

Uploaded by

degijon661
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 8

Case study-3

Addressing Modes
Addressing Modes– The term addressing modes refers to the way in which the operand of
an instruction is specified. The addressing mode specifies a rule for interpreting or
modifying the address field of the instruction before the operand is actually executed.

Immediate Addressing Mode

In this addressing mode,


 The operand is specified in the instruction explicitly.
 Instead of address field, an operand field is present that contains the operand.
Examples-

 ADD 10 will increment the value stored in the accumulator by 10.


 MOV R #20 initializes register R to a constant value 20.

Implied Addressing Mode-

In this addressing mode,


 The definition of the instruction itself specify the operands implicitly.
 It is also called as implicit addressing mode.

Examples-

 The instruction “Complement Accumulator” is an implied mode instruction.


 In a stack organized computer, Zero Address Instructions are implied mode
instructions.
 since operands are always implied to be present on the top of the stack.

Direct Addressing Mode-


In this addressing mode,
 The address field of the instruction contains the effective address of the operand.
 Only one reference to memory is required to fetch the operand.
 It is also called as absolute addressing mode.

Example-

 ADD X will increment the value stored in the accumulator by the value stored at
memory location X.
AC ← AC + [X]
Indirect Addressing Mode-
In this addressing mode,
 The address field of the instruction specifies the address of memory location that
contains the effective address of the operand.
 Two references to memory are required to fetch the operand.

Example-
 ADD X will increment the value stored in the accumulator by the value stored at
memory location specified by X.
AC ← AC + [[X]]
Register Direct Addressing Mode-

In this addressing mode,


 The operand is contained in a register set.
 The address field of the instruction refers to a CPU register that contains the
operand.
 No reference to memory is required to fetch the operand.

Example-

 ADD R will increment the value stored in the accumulator by the content of register
R.
AC ← AC + [R]

NOTE-
It is interesting to note-
 This addressing mode is similar to direct addressing mode.
 The only difference is address field of the instruction refers to a CPU register instead
of main memory.

Register Indirect Addressing Mode-

In this addressing mode,


 The address field of the instruction refers to a CPU register that contains the
effective address of the operand.
 Only one reference to memory is required to fetch the operand.

Example-

 ADD R will increment the value stored in the accumulator by the content of memory
location specified in register R.
AC ← AC + [[R]]
NOTE-
It is interesting to note-
 This addressing mode is similar to indirect addressing mode.
 The only difference is address field of the instruction refers to a CPU register.

Relative Addressing Mode-

In this addressing mode,


 Effective address of the operand is obtained by adding the content of program
counter with the address part of the instruction.

Effective Address
= Content of Program Counter + Address part of the instruction
NOTE-

 Program counter (PC) always contains the address of the next instruction to be
executed.
 After fetching the address of the instruction, the value of program counter
immediately increases.
 The value increases irrespective of whether the fetched instruction has completely
executed or not.

Indexed Addressing Mode-

In this addressing mode,


 Effective address of the operand is obtained by adding the content of index register
with the address part of the instruction.

Effective Address
= Content of Index Register + Address part of the instruction
Base Register Addressing Mode-

In this addressing mode,


 Effective address of the operand is obtained by adding the content of base register
with the address part of the instruction.

Effective Address
= Content of Base Register + Address part of the instruction
Stack Addressing Mode-

In this addressing mode,


 The operand is contained at the top of the stack.

Example-

ADD
 This instruction simply pops out two symbols contained at the top of the stack.
 The addition of those two operands is performed.
 The result so obtained after addition is pushed again at the top of the stack.

You might also like