12
Subroutines and the Stack
A subroutine is a piece of code that is called from a point within a program and executed, and then a return is made to the instruction after the calling point. All computers use subroutines, but some computers provide a programmer with more facilities to implement subroutines than others.
In this chapter, we will look at the ARM’s subroutine handling mechanisms – in particular, the following:
- The special branch and link instruction
- The stack
- A subroutine call and return
- Block move instructions