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.
Hello,
I was wondering how to use routines in a subroutine (called nested subroutines?).
For example, let's say I have
MOV r0, #0 start BL firstLoop stop B stop firstLoop ADD r0, r0, #1 CMP r0, #0 BEQ isZero BNE notZero BX LR ;This doesn't return me back to start isZero ;Code B firstLoop notZero ;Code B firstLoop
How do I go about doing something like this? I wan't to use something like a for loop in my firstLoop subroutine but by doing so, it apparently updates the LR so if I use BX LR once the for loop is done, it doesn't return me back to the very start. From what I've seen I need something like a push subroutine?
Thank you very much