简体   繁体   English

bx lr在ARM汇编语言中做了什么?

[英]What does bx lr do in ARM assembly language?

I can't seem to get my head around what bx lr does and how it differs from bl (label). 我似乎无法理解bx lr的作用以及它与bl(标签)的区别。 I know that bl (label) stores the return address of that function in the link register but I don't know what bx lr does. 我知道bl(标签)将该函数的返回地址存储在链接寄存器中,但我不知道bx lr的作用。

bx stands for branch and exchange instruction set Which means that according to the lsb (least significant bit) of the address to branch to, the processor will treat the next instruction as ARM or as thumb. bx代表分支和交换指令集这意味着根据要分支的地址的lsb(最低有效位),处理器将下一条指令视为ARM或拇指。

As lr usually holds the return address, it means that this is a return from a function, and if the lsb of lr is 1, it will treat the code at that address as thumb, otherwise, it will treat it as ARM. 由于lr通常保存返回地址,这意味着这是函数的返回,如果lr的lsb为1,它将以拇指的形式处理该地址的代码,否则,它将把它视为ARM。

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

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