简体   繁体   English

防止在Keil中生成“ BX LR”

[英]Prevent to generate “BX LR” in Keil

How can I force the compiler to not generate the "BX LR" for the return function. 如何强制编译器不为返回函数生成“ BX LR”。 I also set the option --ARM_only(in compiler + assembler + linker) but this is not useful and I have this code at last in axf file. 我还设置了选项--ARM_only(在编译器+汇编器+链接器中),但这没有用,我最终在axf文件中具有此代码。 my target in Keil is set to ARM7TDMI (I can not set my target to ARM7 or any other target without Thumb) so what can we do to prevent generate "BX LR"? 我在Keil中的目标设置为ARM7TDMI(我的目标不能设置为ARM7或没有Thumb的任何其他目标),那么我们该怎么做才能防止生成“ BX LR”?

BX won't switch to Thumb mode if the least significant bit of the target address is 0. In other words, it can be used as a regular branch as well. 如果目标地址的最低有效位为0,则BX不会切换到Thumb模式。换句话说,它也可以用作常规分支。

The instruction cycle times for BX LR and eg MOV PC,LR are also identical (2S + 1N cycles) on the ARM7TDMI, so there's nothing to be won in terms of performance from using one or the other. 在ARM7TDMI上, BX LRMOV PC,LR的指令周期时间也相同(2S + 1N周期),因此,从性能上来讲,使用任何一种都不行。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM