Addressing modes


#1

Describe all the addressing modes


#2

Addressing modes are nothing but the different ways in which the location of an operand can be specified in an instruction.
They are as follows:

i. Immediate mode: In this mode, the operand is specified in the instruction itself.
E.g. Move #200,R0
The above instruction places the value 200 in the register R0.

ii. Register mode:The operand is the contents of a register.
E.g. Move R0, R1
Contents of the R0 register are moved to R1 register.

iii. Absolute mode:The operand is in a memory location; the address of the operand is passed explicitly in the instruction.E.g. Move LOC, R0
Here LOC corresponds to the address from where the contents will be accessed by the processor and placed in R0.

iv. Indirect mode:The effective address (E.A.) of the operands is the contents of a register.
E.g. Add (R1), R0
This instruction fetches the operand from the address, pointed by the contents of the register R1 and adds them to R0.

v. Index mode:The effective address of the operand is calculated by adding a constant value to the contents of a register.
E.g. Move X (R0), R1
Here, Contents at address X+R0 are moved to R1 .X contains a constant value.

vi. Base with index:The effective address is the sum of contents of two registers.
E.g. Move (R0, R1), R2
Here, Contents at address R0+R1 are moved to R2.

vii. Base with index and offset:The effective address is the sum of contents of two registers and a constant. The constant value in this case is often called the offset or the displacement.
E.g. Move X (R0, R1), R2
Contents at address X+R0+R1 are moved to R2.

viii. Relative:The next instruction address is added to the address field to produce the EA.
E.g. Move X (PC), R1
Here, Contents at address X+PC are moved to R1 .X contains a constant value.

ix. Auto increment: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 the next value. E.g. Add (R2) +, R0
Here are the contents of R2 are first used as an E.A. then they are incremented.

x. Auto decrement:The effective address of the operand is the contents of a register specified in the instruction. Before accessing the operand, the contents of this register are automatically decremented and then the value is accessed.E.g. Add - (R2), R0
Here are the contents of R2 are first decremented and then used as an E.A. for the operand which is added to the contents of R0.

For more details https://en.wikipedia.org/wiki/Addressing_mode