error A2070: invalid instruction operands

后端 未结 2 2037
自闭症患者
自闭症患者 2020-12-02 01:36

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)

re         


        
相关标签:
2条回答
  • 2020-12-02 02:15

    For the most part, x86 instructions may use at most one memory operand. For a memory-memory move, use a temporary register:

    mov [reg1], [reg2] # illegal
    
    mov tmp, [reg2] # ok
    mov [reg1], tmp
    
    0 讨论(0)
  • 2020-12-02 02:16

    mem, mem is not a valid combination of operands. Use a register as an intermediate, e.g.:

    mov eax,[edi]
    mov [esi],eax
    

    Alternatively, if you can swap esi and edi you could use movsd:

    movsd        ; dword [edi] = dword [esi]; esi += 4; edi += 4
    

    (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).

    0 讨论(0)
提交回复
热议问题