如何根据操作数确定合适的MOV指令后缀? [英] How to determine the appropriate MOV instruction suffix based on the operands?

查看:115
本文介绍了如何根据操作数确定合适的MOV指令后缀?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

答案是1. 移动2.电影3.移动4.移动5. movq6. 移动

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

但我们如何确定这一点?

But how do we determine that?

推荐答案

只需查看目标操作数并指定其大小即可.

Simply look at the destination operand and specify its size.

案例 1:您将寄存器 rsp 指定的地址处的值移动到寄存器 eax.因此,您应该使用 movl 这意味着移动一个长值.这样做是因为 eax 寄存器有 4 个字节宽,它构成了一个 long.

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.

同样适用于其他情况.

  • movb - 移动字节.
  • movw - 移动字(2 个字节).

这篇关于如何根据操作数确定合适的MOV指令后缀?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆