【发布时间】:2015-12-05 08:36:47
【问题描述】:
我尝试了下面的代码,但未能从http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0472f/Cihfhjhg.html 的以下引用中从 r11 读取正确的值
volatile int top_fp;
__asm
{
mov top_fp, r11
}
r11的值为0x20009DCC top_fp的值为0x00000004
[update] 解决方案,我们必须使用嵌入式汇编器:
__asm int getRegisterR11()
{
mov r0,r11
BX LR //return, must not omitted!!!
}
【问题讨论】:
-
你用的是什么工具链?例如,ARM 自己的编译器对内联汇编的支持与 GCC 不同。
-
...什么版本?
-
我使用的是 ARM 的 MDK-ARM 版本 4.72.1.0,带有 ARMCC 编译器。