【发布时间】:2012-02-08 05:47:17
【问题描述】:
我有这部分代码是使用 ARMASM 编译的:
/* Software Interrupt */
/* we must save lr in case it is called from SVC mode */
#define ngARMSwi( code) __asm { SWI code,{},{},{lr} }
使用示例: ngARMSwi(0x23);
我尝试将其转换为使用 gcc(代码源 GCC-4.6.2 eabi)进行编译。我找到了这个链接http://www.ethernut.de/en/documents/arm-inline-asm.html,但我找不到正确编译这一行的方法。
我最好的尝试是
#define ngARMSwi( code) __asm__ ("SWI " (code) : : :"lr" )
但我得到编译错误:
error: expected ':' or ')' before '(' token
感谢任何帮助!
【问题讨论】: