问题
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