How to determine the appropriate MOV instruction suffix based on the operands?

一世执手 提交于 2021-01-16 03:51:07

问题


The answer is 1. movl 2. movw 3. movb 4. movb 5. movq 6. movw

But how do we determine that?


回答1:


Simply look at the destination operand and specify its size.

Case 1 : You are moving the value at address specified by register rsp to the register eax. Therefore, you should use movl which means move a long value. This is done because the eax register is 4 bytes wide which make up a long.

The same applies to the other cases.

  • movb - move byte.
  • movw - move word (2 bytes).


来源:https://stackoverflow.com/questions/57937348/how-to-determine-the-appropriate-mov-instruction-suffix-based-on-the-operands

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!