What is an effective address?

前端 未结 1 1601
花落未央
花落未央 2021-01-21 14:16

While reading the Intel 64 and IA-32 Architectures Software Developer’s Manual, the operation section for the LEA instruction (load effective address) uses a calculation called

相关标签:
1条回答
  • 2021-01-21 15:01

    Section 3.7.5 (Specifying an Offset) of the same document states:

    The offset part of a memory address can be specified directly as a static value (called a displacement) or through an address computation made up of one or more of the following components:

    • Displacement — An 8-, 16-, or 32-bit value.
    • Base — The value in a general-purpose register.
    • Index — The value in a general-purpose register.
    • Scale factor — A value of 2, 4, or 8 that is multiplied by the index value.

    The offset which results from adding these components is called an effective address. Each of these components can have either a positive or negative (2s complement) value, with the exception of the scaling factor.

    EffectiveAddress calculates an effective address using:

    Base + (Index*Scale) + Displacement
    
    0 讨论(0)
提交回复
热议问题