不能在寻址模式下减去寄存器? [英] Can't subtract registers in an addressing mode?
问题描述
这是我第一次来这里.
我已经阅读完PC汇编语言,并且正在研究Assembly中RC4加密的实现.我无法理解的是为什么
I finished reading PC Assembly Language and I was working on an implementation of RC4 encryption in Assembly. What I can't comprehend is why
mov eax, [edx+ecx]
有效但是
mov eax, [edx-ecx]
没有.内联汇编器给我此错误消息,
doesn't. The inline assembler gives me this error message,
第二个操作数"中的非恒定表达式
non-constant expression in 'second operand'
那是什么意思?预先感谢.
What does that mean? Thanks in advance.
推荐答案
以下内容很好地总结了x86寻址模式.请注意,没有注册减去注册"形式:维基百科.
The following gives a good summary of x86 addressing modes. Note that there is no "register minus register" form: Wikipedia.
作为解决方法,您可以取反ecx
的内容,然后使用[edx+ecx]
(如果以后需要原始值,则可能必须取反).
As a workaround, you could negate the contents of ecx
then use [edx+ecx]
(you may have to negate it back if you need the original value afterwards).
这篇关于不能在寻址模式下减去寄存器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!