简体   繁体   中英

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). 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.

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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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