What's the primary difference between branch instruction and branch with link instruction? ARM?
Asked Answered
W

1

14

From what I read, the branch with link is used to perform subroutine call and the registered link is copied back to PC.

Wenda answered 11/10, 2015 at 19:13 Comment(1)
The ARM frame and link registers question is related. It is not a duplicate, but when you go one step beyond this question... it will be your next step in understanding the ARM function call mechanisms that compilers use.Cretaceous
E
21

Branch with link BL copies the address of the next instruction (after the BL) into the link register. The branch instruction doesn't. BL would be used for a subroutine call, so when you want to return to where you were you can branch back to the link register.

Edwinaedwine answered 11/10, 2015 at 19:17 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.