在X86彙編中,MOV [0012H], [0016H]這種指令是不容許的,至少得有一個操做數是寄存器。固然,這種問題在用高級語言的時候看不到,感受好像基本上都是從內存到內存啊,爲毛到了彙編就不行了???這個問題在stack overflow有個解釋不錯:ide
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.this
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.spa
CPU對內存,要麼讀,要麼寫,這樣一來,這種設計就很是合理了。若是想讓CPU像訪問寄存器那樣訪問內存,那CPU的頻率就要被內存拖垮了……設計
原文連接點這裏code