gpt4 book ai didi

assembly - 近指针的隐式段寄存器是如何确定的?

转载 作者:行者123 更新时间:2023-12-02 21:37:44 29 4
gpt4 key购买 nike

Intel 64® and IA-32 Architectures Software Developer's Manual. Volume 1: Basic Architecture 的第 4.3 节中,它说:

A near pointer is a 32-bit offset ... within a segment. Near pointers are used for all memory references in a flat memory model or for references in a segmented model where the identity of the segment being accessed is implied.

这让我想知道:隐含的段寄存器是如何确定的?

我知道 (%eip) 和移位的 (%eip) (例如 -4(%eip))地址使用 %cs 默认情况下,(%esp) 和移位的 (%esp) 地址使用 %ss,但是什么关于(%eax)(%edx)(%edi)(%ebp)等。 ,隐式段寄存器是否也依赖于内存地址操作数出现的指令?

最佳答案

除了您提到的CSSS寄存器访问之外,大多数其他访问都会使用DS段寄存器。我记得有几个异常(exception):

  • 面向字符串的指令将使用 ES 作为“目标”(由 EDI 寄存器隐式寻址)段寄存器
  • 使用EBP寄存器作为“基地址”寄存器的内存访问将使用SS段寄存器。但是,如果将EBP寄存器用作缩放索引寄存器,则使用的段将为DS(除非基址寄存器为ESP)

关于assembly - 近指针的隐式段寄存器是如何确定的?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2877900/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com