SI 和 DI 寄存器之间有什么实际区别?

发布于 2024-08-06 03:38:16 字数 17 浏览 2 评论 0原文

我不明白有什么区别。

I don't get what is the difference.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

忘羡 2024-08-13 03:38:16

当您使用 movsb 等指令时,si 被视为源寄存器,而 di 被视为目标目标寄存器。但它们都是普通的 x86 寄存器。

When you are using instructions like movsb, si is considered as the source register, while di is considered as the destination register. But they are both normal x86 registers.

苏别ゝ 2024-08-13 03:38:16

我的程序集有点生锈,但一个是源索引,另一个是目标索引。像movsb这样的指令将从SI指向的内存位置复制一个字节,并将其移动到DI指向的内存位置,然后将两者递增,因此如果要将存储在 SI+1 中的字节复制到 DI+1,只需再执行一条 movsb 指令即可。

My assembly is a bit rusty, but one's the Source Index, the other the Destination Index. An instruction like movsb will copy a byte from the memory location pointed at by SI, and move it to the memory location pointed at by DI, and then increment both, so if you want to copy the byte stored at SI+1 to DI+1, it only takes a further movsb instruction.

水晶透心 2024-08-13 03:38:16

SI 代表源索引。源索引用作指向字符串指令(LODS、MOVS 或 CMPS)中正在读取的当前字符的指针。源索引也可用作在进行间接寻址时添加 Bx 或 Bp 的偏移量。
示例:

MOV [Bx + SI] , Ax  

该指令将 Ax 的内容复制到地址为 Bx 和 SI 之和的内存位置。

DI 代表目标索引,用作指向字符串指令中正在写入或比较的当前字符的指针。

与 SI 一样,它也可用作偏移量。

SI stands for source index. Source index is use as a pointer to the current character being read in a string instruction(LODS,MOVS, or CMPS). Source index is also available as an offset to add Bx or Bp when doing indirect addressing.
example:

MOV [Bx + SI] , Ax  

This instruction copies the contents of Ax into the memory location whose address is the sum of the Bx and SI.

DI stands for destination index, used as a pointer to the current character being written or compared in a string instruction.

It is also available as an offset just like SI.

黎夕旧梦 2024-08-13 03:38:16

如上所述,di 代表目标索引,si 代表源索引,当我们想要从内存中移动数据时,我们使用 si,例如 mov ax,[si]。
当我们想将数据移动到内存时,我们使用 di。例如,mov [di],ax

都是16位寄存器,不能拆分为8位

as told above di stands for destination index and si stands for source index, when we want to move data from memory we use si eg, mov ax,[si].
and when we want to move data to the memory we use di. eg, mov [di],ax

both are 16 bit register and cannot be split into 8 bit

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文