What is an effective address?

百般思念 提交于 2019-12-10 22:43:46

问题


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 EffectiveAddress(SRC) which is not defined anywhere else.

What is the definition of effective address and what does EffectiveAddress(SRC) do?


回答1:


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


来源:https://stackoverflow.com/questions/36704481/what-is-an-effective-address

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!