gpt4 book ai didi

gcc - 错误 : junk `bswapl eax movl %eax' after register

转载 作者:行者123 更新时间:2023-12-04 15:44:24 31 4
gpt4 key购买 nike

我在 GAS 源代码中定义了一个 MACRO。但是不是gcc编译的。

下面是我定义的MACRO。

#define MSGSCHEDULE0(index) \
movl (index*4)(%rsi) ,%eax \
bswapl eax \
movl %eax ,(index*4-272)(%rdi)

下面是汇编信息:

error: junk `bswapl eax movl %eax' after register

我想在我的代码中使用这个宏,如下所示:

MSGSCHEDULE0(0)
MSGSCHEDULE0(1)
MSGSCHEDULE0(2)
//...
MSGSCHEDULE0(16)

最佳答案

使用分号向 GAS 发出行尾信号:

#define MSGSCHEDULE0(index) \
movl (index*4)(%rsi),%eax; \
bswapl %eax; \
movl %eax,(index*4-272)(%rdi)

不要忘记寄存器的百分号。

关于gcc - 错误 : junk `bswapl eax movl %eax' after register,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57719536/

31 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com