Complete Computer Knowledge Portal

Wednesday, June 19, 2013

Addressing Modes

Addressing modes are the way to identify operands in machine language instructions. It defines how to calculate effective address of operand with the information held in registers and/or constants contained by a machine instruction.
Some commonly used addressing modes are as follows:

Implied Mode: In this addressing mode operands are specified implicitly in the definition of instruction. E.g. complement Accumulator. In this instruction operand in the accumulator is implicitly defined in the instruction.
Example: CLA
 
Immediate Mode: In this addressing mode operand is specified in the instruction itself. Hence instruction contains operand instead of Address field. These addressing modes are used for the initialization of registers to a constant value.
Example: MOV R2, 123

Register Mode: In this type of addressing mode operands are used from the registers of CPU. An n bit field can specify 2n Registers.
Example: MOV R3, R2; R3 = R2

Register Indirect Mode: In this type of addressing mode instruction specify the register from CPU which contains the address of operand. Hence CPU register contains the address of operand rather than operand itself.
Example: LD R3,[R2] ; R3=contents of memory, address in R2

Direct Addressing Mode: In this type of addressing mode defined operand is in the memory and instruction carries the address of the memory location that contains operand.
Example: MOV A, 30H

Indirect Addressing Mode: In this type of addressing mode address field of instruction defines the address of memory location that contains the effective address of the operand.
Example: MOV A,@R1

Auto increment or Auto Decrement Addressing Mode: In this type of addressing mode operand are in CPU registers. Instruction fetches one operand and in next fetch register value is either incremented or decremented.

Relative Addressing Mode: This type of addressing mode adds Program counter contents to address field of instruction to get effective address of the operand.

Indexed Addressing Mode: In this type of addressing mode contents of index register are added to address field of instruction to get the effective address of the operand.

Base Register Addressing Mode: In this type of addressing mode contents of base register are added to obtain the effective address of the operand.

No comments:

Post a Comment