The Branch with link instruction
First, we discuss the ARM’s branch and link instruction, bl
, which provides a quick and easy way to call a subroutine without using a stack mechanism.
There are two basic ways of implementing subroutine calls and returns. The classic CISC approach is BSR
(branch to subroutine) and RTS
(return from subroutine). The typical code might be as follows:
bsr abc @ Call the subroutine on the line labeled abc
. . .
. . .
abc: . . . @ Subroutine abc entry point
. . .
rts @ Subroutine abc return to calling point
This is simplicity in action. You call a piece of code, execute it, and return to the instruction after the calling point. Most RISC processors reject this...