Memory to memory MOV - Correct Syntax

2019-08-15 17:55发布

问题:

I'm trying to accomplish the following with ASM:

mov [00A30020], [ebx+50]

So, I want to mov the value of ebx+50 into 00A30020, but the compiler says it's an invalid statement.

回答1:

There is no such thing as a memory to memory move (with mov, there is also move string). See this table.

You could load to a temporary register and then store it:

mov   eax, [ebx+50]
mov   [00A30020], eax

or to avoid using any extra registers at the cost of being inefficient:

push  dword [ebx+50]
pop   dword [00A30020]


标签: assembly x86 mov