【问题标题】:What does the instruction LODS DWORD PTR DS:[ESI]?指令 LODS DWORD PTR DS:[ESI] 是什么意思?
【发布时间】:2014-05-16 18:12:08
【问题描述】:

我有以下汇编指令(你也可以在标题中看到):

 LODS DWORD PTR DS:[ESI]

在一个网站上我发现:

 The lods instruction is unique among the string instructions. 
 You will never use a repeat prefix with this instruction. 
 The lods instruction copies the byte or word pointed at by ds:si 
 into the al, ax, or eax register, after which it increments or 
 decrements the si register by one, two, or four. 

但我不明白这一点:我如何确定字节或字被复制到寄存器 al、ax 或 eax 中的哪个。

谁能详细解释一下

【问题讨论】:

  • 另外,您不使用 rep 前缀的原因是您需要在重复之前以某种方式检查加载的值。

标签: assembly


【解决方案1】:

操作的大小决定了针对哪个寄存器以及 ESI 寄存器前进了多远。对于LODS DWORD,加载了一个双字(32 位)数据,这意味着 32 位 EAX 寄存器。 LODS WORD 将是 16 位到 16 位 AX 寄存器,LODS BYTE 将是 8 位 AL。

【讨论】:

  • 通常缩写为“lodsb”、“lodsw”和“lodsd”。
  • 啊啊啊...好吧。所以寄存器的选择取决于“DWORD”、“WORD”或“BYTE”,对吧?意思就是你写“DWORD”,然后把[ESI]里面的值存入EAX寄存器,以此类推……好的,谢谢
猜你喜欢
  • 2011-03-14
  • 2010-10-05
  • 2012-08-21
  • 2015-01-25
  • 2013-03-05
  • 2014-03-02
  • 2021-09-18
  • 1970-01-01
  • 2018-04-09
相关资源
最近更新 更多