0% found this document useful (0 votes)
12 views4 pages

Addressing Modes

4

Uploaded by

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

Addressing Modes

4

Uploaded by

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

Addressing modes in computer architecture specify how to access data stored in memory, registers, or in

the instruction itself. Each mode provides a different way for the processor to locate and handle data,
which is crucial for instruction execution. Here are some common types of addressing modes:

1. Immediate Addressing Mode

Description: The operand (data) is directly specified in the instruction itself.

Example: ADD R1, #5 (here, #5 is the immediate data to be added).

Usage: Quick access to constants or values that do not change, without needing memory access.

2. Direct (Absolute) Addressing Mode

Description: The address of the operand is specified directly in the instruction.

Example: LOAD R1, 5000 (here, 5000 is the memory address where the operand is stored).

Usage: Accesses data stored in a specific memory location; requires memory access.

3. Indirect Addressing Mode

Description: The instruction contains a pointer to the address of the operand. This pointer is stored in a
register or memory.

Example: LOAD R1, (R2) (here, R2 contains the memory address where the operand is stored).

Usage: Allows dynamic memory access, useful for accessing data structures like arrays or linked lists.
4. Register Addressing Mode

Description: The operand is stored in a register, and the instruction specifies the register where it’s
located.

Example: ADD R1, R2 (here, both operands are stored in registers R1 and R2).

Usage: Fast access to data within CPU registers, no memory access needed.

5. Register Indirect Addressing Mode

Description: The register contains the address of the operand in memory, indirectly accessing memory
through a register.

Example: LOAD R1, (R2) (where R2 holds the memory address of the operand).

Usage: Commonly used for accessing data structures where addresses change dynamically.

6. Indexed Addressing Mode

Description: The final address of the operand is determined by adding a constant value (index) to a base
address in a register.

Example: LOAD R1, 100(R2) (here, R2 holds a base address, and 100 is the offset).

Usage: Useful for accessing arrays, where each element is a fixed offset from a base address.
7. Base-Register Addressing Mode

Description: Similar to indexed addressing, but the base address is stored in a register and can be
dynamically adjusted.

Example: MOV A, B(R0) (here, R0 holds the base address, and B is the offset).

Usage: Common in systems with relocatable code segments or in position-independent code.

8. Relative Addressing Mode

Description: The address of the operand is determined by adding an offset to the current program
counter (PC) value.

Example: JMP LABEL (where LABEL is a relative address based on the PC).

Usage: Primarily used for branching or jumping within code, as it allows code to be position-
independent.

9. Implicit Addressing Mode

Description: The operand’s address is implied by the instruction, and no specific operand is mentioned.

Example: CMA (Complement Accumulator) — the instruction inherently refers to the accumulator
register.
Usage: Simplifies instructions, often used in stack-based or accumulator-based architectures.

10. Auto-increment / Auto-decrement Addressing Mode

Description: The register holding the address is automatically incremented or decremented after
accessing the operand.

Example: LOAD R1, (R2)+ (where R2 is incremented after accessing its address).

Usage: Efficient for accessing consecutive elements in arrays, often used in looping constructs.

Each addressing mode serves specific use cases in programming and computer architecture, optimizing
speed, memory efficiency, and flexibility in accessing data and executing instructions.

You might also like