【问题标题】:Stack pointer as an index register堆栈指针作为索引寄存器
【发布时间】:2015-09-12 12:18:31
【问题描述】:

为什么栈指针(esp/rsp)不能像[esi + esp*4]那样作为索引寄存器使用?

【问题讨论】:

    标签: assembly x86 cpu-registers machine-code addressing-mode


    【解决方案1】:

    这就是指令集的制作方式。 ESP(即100b)的 SIB 编码已用于表示 none 而不是1。通常ESP 是堆栈指针,因此用作基址寄存器,它确实具有有效的编码。用任何因素对其进行缩放通常没有意义,因此牺牲编码通常不是问题。


    1. 参见表 2-3。 Intel® 64 and IA-32 Architectures Software Developer's Manual Volume 2: Instruction Set Reference, A-Z 中带有 SIB 字节的 32 位寻址形式

    【讨论】:

      猜你喜欢
      • 2021-06-10
      • 2013-06-30
      • 2014-03-02
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-12-23
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多