错误A2070:无效的指令操作数 [英] error A2070: invalid instruction operands
本文介绍了错误A2070:无效的指令操作数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
错误在After oop skope中的"mov [esi],[edi]"行中.我该如何解决这个问题? ;节点删除功能(headptr,nodeToremove)
the error is in AfterLoop skope in the line " mov [esi], [edi]" . how can I resolve this issue? ; The function for node removing (headptr, nodeToremove)
removeNode proc
headPtr = 8
nodeToRemove = headPtr + 4
push ebp
mov ebp, esp
push esi
push edi
push ebx
mov esi, headPtr[ebp] ; esi = head of list
mov edi, [esi] ; edi = second item
cmp esi, nodeToRemove[ebp] ; head = nodeToRemove?
jne NextNode
mov edi, esi ; edi ( = currNode) = head
mov esi, [esi] ; new head = head->next
jmp AfterLoop
NextNode:
cmp edi, nodeToRemove[ebp] ; currNode = node to remove?
je AfterLoop
mov esi, edi ; prev node = currNode
mov edi, [edi] ; currNode = currNode->next
jmp NextNode
AfterLoop:
mov [esi], [edi] ; error!!! prev->next = curr->next
pop ebx
pop edi
pop esi
pop ebp
ret 8
removeNode endp
推荐答案
mem, mem
不是操作数的有效组合.使用寄存器作为中介,例如:
mem, mem
is not a valid combination of operands. Use a register as an intermediate, e.g.:
mov eax,[edi]
mov [esi],eax
或者,如果可以交换esi
和edi
,则可以使用movsd
:
Alternatively, if you can swap esi
and edi
you could use movsd
:
movsd ; dword [edi] = dword [esi]; esi += 4; edi += 4
(注意:+= 4
为真,前提是方向标记已清除.否则为-= 4
.在您的情况下这无关紧要,因为紧接着您是pop
esi
和edi
)
(Note: the += 4
is true assuming that the direction flag is clear. Otherwise it will be -= 4
. Shouldn't matter in your case since you pop
esi
and edi
immediatly afterwards).
这篇关于错误A2070:无效的指令操作数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文