问题解决:由于嵌套过程中会出现寄存器冲突
正确例程:
int func (int val) {
int val2;
__asm
{
mov val2,0xffff0000
mov val,val,lsl #16
}
return val val2;
}
内嵌汇编的错误 -凯发app
问题类别:arm 开发工具 > mdk-arm | 浏览次数:7007 |
发布日期:2012/4/23 17:33:09 | 文章来源:米尔科技 |
回复日期:2012/5/7 11:34:01 |
realview mdk3.05以上
代码如下: int func (int val) { __asm { mov r7,0xffff0000 mov r0,r0,lsl #16 add r0,r0,r1 } return val; } 错误提示: warning: #1267-d: implicit physical register r7 should be defined as a variable warning: #1267-d: implicit physical register r0 should be defined as a variable error: #549: variable "r0" is used before its value is set warning: #1267-d: implicit physical register r1 should be defined as a variable error: #549: variable "r1" is used before its value is set warning: #177-d: variable "val2" was declared but never referenced