SI 和 DI 寄存器之间有什么实际区别?
我不明白有什么区别。
I don't get what is the difference.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
我不明白有什么区别。
I don't get what is the difference.
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(4)
当您使用 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.
我的程序集有点生锈,但一个是源索引,另一个是目标索引。像
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 bySI
, and move it to the memory location pointed at byDI
, and then increment both, so if you want to copy the byte stored atSI+1
toDI+1
, it only takes a further movsb instruction.SI
代表源索引。源索引用作指向字符串指令(LODS、MOVS 或 CMPS)中正在读取的当前字符的指针。源索引也可用作在进行间接寻址时添加 Bx 或 Bp 的偏移量。示例:
该指令将 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:
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.
如上所述,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