3.
1 Data-Addressing Modes
Data-addressing modes define how a processor identifies the location of operands used in instructions.
These modes improve program flexibility, efficiency, and performance by allowing different ways of
accessing data in memory or registers.
3.1.1 Register Addressing
Register addressing is one of the fastest addressing modes because operands are stored in CPU
registers. The instruction specifies the register that contains the data.
3.1.2 Immediate Addressing
Immediate addressing includes the operand directly within the instruction, eliminating the need for
memory access.
3.1.3 Direct Data Addressing
Direct addressing contains the memory address of the operand inside the instruction.
3.1.4 Register Indirect Addressing
A register holds the memory address of the operand rather than the operand itself.
3.1.5 Base-Plus-Index Addressing
Uses two registers (base and index) whose values are added to compute the effective address.
3.1.6 Register Relative Addressing
Adds a constant displacement to a register value to compute the effective address.
3.1.7 Base Relative-Plus-Index Addressing
Adds together a base register, an index register, and a displacement value.
3.1.8 Scaled-Index Addressing
Multiplies the index register by a scaling factor (1, 2, 4, 8) before adding to a base register.
3.1.9 RIP Relative Addressing
Uses the current instruction pointer plus a displacement to compute the address. Common in x86-64 for
position■independent code.
3.1.10 Data Structures
Addressing modes are essential for implementing arrays, stacks, linked lists, and records efficiently.