We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Ignoring specific optimisations, the general solution is to have a "stack" in memory, and to push the old link-register value onto the stack before making another call. Arbitrary depth calls can then be made until memory is exhausted. Example code might be:myfunc PUSH {LR}; store old return address onto the stack BL myfunc; call myfunc again / another procedure POP {LR} ; restore old return address from stack BX LR ; return from myfunchths.
myfunc PUSH {LR}; store old return address onto the stack BL myfunc; call myfunc again / another procedure POP {LR} ; restore old return address from stack BX LR ; return from myfunc