为MOVQ操作数大小不匹配 [英] operand size mismatch for movq

查看:1022
本文介绍了为MOVQ操作数大小不匹配的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图用 GCC objdump的来生成字节codeS的指令序列。
以下是我写的文件 code.S

I am trying to generate the byte codes for instruction sequences by using gcc and objdump. Here is what I write in file code.s:

movq $0x1234567891234567,0x602308

所以,我想在这里做的是把长的数据转换成绝对地址。

So what I wanted to do here is putting a long data into an absolute address.

然后我输入了: GCC -c example.s

这给了我一个错误说:错误: movq'.`

It gave me an error says: Error: operand size mismatch formovq'.`

那么,什么是怎么回事?

So what is going on here?

推荐答案

MOVQ的立即数被限制在32-bit.You需要使用movabsq

Immediate operands of movq are limited to 32-bit.You need to use movabsq

这篇关于为MOVQ操作数大小不匹配的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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