这是什么总成呢? [英] What does this assembly do?
问题描述
代表STOS DWORD PTR [EDI]
有关 ECX
重复,存储 EAX $ C $的内容C>进入其中,
EDI
点,递增或递减 EDI
(根据方向标志)由每次4个字节。通常情况下,这是用于 memset的
型的操作。
一般情况下,该指令被简单地写代表STOSD
。有经验的组装codeRS知道刚才看到,上面提到的所有细节。 : - )
ETA的完整性(感谢公共卫生机构):每一次迭代, ECX
减1,当它达到零,循环停止。对于 STOS
,你会看到的唯一的事情是, ECX
末被清除。但是,对于中汽南方
或类似,其中 REPZ
/ REPNZ
prefixes使用, ECX
可以是大于零,如果耗尽前操作停止 ECX
字节/字/凡是
在你问之前,中汽南方
用于实施和strchr
型的操作。 :-P
rep stos dword ptr [edi]
For ecx
repetitions, stores the contents of eax
into where edi
points to, incrementing or decrementing edi
(depending on the direction flag) by 4 bytes each time. Normally, this is used for a memset
-type operation.
Usually, that instruction is simply written rep stosd
. Experienced assembly coders know all the details mentioned above just by seeing that. :-)
ETA for completeness (thanks PhiS): Each iteration, ecx
is decremented by 1, and the loop stops when it reaches zero. For stos
, the only thing you will observe is that ecx
is cleared at the end. But, for scas
or the like, where the repz
/repnz
prefixes are used, ecx
can be greater than zero if the operation stopped before exhausting ecx
bytes/words/whatevers.
Before you ask, scas
is used for implementing strchr
-type operations. :-P
这篇关于这是什么总成呢?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!