我在GAS源代码中定义了MACRO。但是它不是由gcc编译的。
以下是我定义的MACRO。
#define MSGSCHEDULE0(index) \
movl (index*4)(%rsi) ,%eax \
bswapl eax \
movl %eax ,(index*4-272)(%rdi)
以下是汇编程序消息:
错误:注册后出现垃圾'bswapl eax movl%eax'
我想在我的代码中使用此宏:
MSGSCHEDULE0(0)
MSGSCHEDULE0(1)
MSGSCHEDULE0(2)
//...
MSGSCHEDULE0(16)
答案 0 :(得分:1)
使用分号向GAS发送行尾信号:
#define MSGSCHEDULE0(index) \
movl (index*4)(%rsi),%eax; \
bswapl %eax; \
movl %eax,(index*4-272)(%rdi)
别忘了寄存器的百分号。