I've been creating a report on why the JUMP instruction shouldn't be used in the piece of code above and instead CALL/RETURN instructions should be used to navigate through the subroutines.
I understand that the code will never reach back2: because it is using the jump command and would continuously loop between back1: and the calculateNextPower routine.
Would I be correct saying that:
the jump instruction doesn't push the instruction onto a stack and results in you not being able to return to where you've jumped from.
When using call, it prevents you from pushing to many addresses to the stack by recursion like the JUMP instruction would. This can cause a stack overflow/tail recursion and can result in you not getting the result of the calculation until you have returned by using the call and return?
I think that I've made this way more complicated than what it is, read way to many sites and have confused myself on the reasons why it should be used instead of the jump instruction, other than it not being able to get to the "back2:" routine.
Appreciate any help on clearing this up, I'm new to this type of work