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
More Related Contents:
- How do I print an integer in Assembly Level Programming without printf from the c library?
- How do AX, AH, AL map onto EAX?
- How to represent hex value such as FFFFFFBB in x86 assembly programming?
- Basic use of immediates vs. square brackets in YASM/NASM x86 assembly
- What does `rep ret` mean?
- Why is there not a register that contains the higher bytes of EAX?
- What is the function of the push / pop instructions used on registers in x86 assembly?
- How to make the kernel for my bootloader?
- Assembly (x86): db ‘string’,0 does not get executed unless there’s a jump instruction
- about assembly CF(Carry) and OF(Overflow) flag
- Why is imul used for multiplying unsigned numbers?
- Assembly Language – How to do Modulo?
- What does “DS:[40207A]” mean in assembly?
- Does it matter where the ret instruction is called in a procedure in x86 assembly
- Does cmpxchg write destination cache line on failure? If not, is it better than xchg for spinlock?
- What is the point of SSE2 instructions such as orpd?
- What’s the purpose of the rotate instructions (ROL, RCL on x86)?
- Why does leave do “mov esp,ebp” in x86 assembly?
- Why isn’t the instruction pointer a normal register usable with MOV or ADD?
- How to tell the length of an x86 instruction?
- Optimize for fast multiplication but slow addition: FMA and doubledouble
- How to force NASM to encode [1 + rax*2] as disp32 + index*2 instead of disp8 + base + index?
- How to tell the length of an x86 instruction?
- In what situation would the AVX2 gather instructions be faster than individually loading the data?
- x86 32 bit opcodes that differ in x86-x64 or entirely removed
- Does Skylake need vzeroupper for turbo clocks to recover after a 512-bit instruction that only reads a ZMM register, writing a k mask?
- How to know if an assembly code has particular syntax (emu8086, NASM, TASM, …)?
- Assembly bubble sort swap
- Why is the Carry Flag set during a subtraction when zero is the minuend?
- how does push and pop work in assembly