Why IA32 does not allow memory to memory mov?

前端 未结 4 1574
面向向阳花
面向向阳花 2020-12-01 11:11

In Intel architecture IA32, instructions like movl, movw does not allow operands that are both memory locations. For example, instruction movl (%eax), (%edx) is not permitte

4条回答
  •  情书的邮戳
    2020-12-01 11:35

    RAM supports input and output, but not copying. Therefore a memory-to-memory move would actually be a memory-to-CPU-to-memory move. It would in theory be possible to implement such an instruction, but it probably wasn't because it wouldn't be very practical.

    Here are some of the things that would need to be considered to implement such an instruction:

    • What temporary storage location do we use? A register?

    • If we use a register, which one do we hijack?

    Not providing such an instruction leaves the above questions up to the programmer.

提交回复
热议问题