使用 __asm 函数编译一个简单的 c 文件时,我收到以下错误消息。似乎无法识别“MSP”。我可以在注释掉“MRS R0,MSP”后构建。我在这里缺少什么?谢谢。
Invoking: Arm C Compiler for Embedded 5.6.6'
armcc.exe --cpu=Cortex-R5 --arm --apcs=interwork -O0 -g --md --depend_format=unix_escaped -c -o "main.o" "main.c"
"main.c", line 26: Error: A1616E: Instruction, offset, immediate or register combination is not supported by the current instruction set
26 00000000 MRS R0, MSP
我的main.c
:
__asm uint32_t A( void )
{
MRS R0, MSP
LDR R0, [R0,#8]
BX lr
}
int main()
{
A();
return 0;
}