在X86汇编中,MOV [0012H], [0016H]这种指令是不允许的,至少得有一个操作数是寄存器。当然,这种问题在用高级语言的时候看不到,感觉好像基本上都是从内存到内存啊,为毛到了汇编就不行了???这个问题在stack overflow有个解释不错:
The answer involves a fuller understanding of RAM. Simply stated, RAM can only be in two states, read mode or write mode. If you wish to copy one byte in ram to another location, you must have a temporary storage area outside of RAM as you switch from read to write.
It is certainly possible for the architecture to have such a RAM to RAM instruction, but it would be a high level instruction that in microcode would translate to copying of data from RAM to a register then back to RAM. Alternatively, it could be possible to extend the RAM controller to have such a temporary registerjust for this copying of data, but it wouldnt provide much of a benefit for the added complexity of CPU/Hardware interaction.
CPU对内存,要么读,要么写,这样一来,这种设计就非常合理了。如果想让CPU像访问寄存器那样访问内存,那CPU的频率就要被内存拖垮了……
原文链接点这里