In this code, there is a subroutine called ``abc''. The definition of a subroutine starts with the words ``define sub'', and ends with the words ``end define sub''. A subroutine is essentially a piece of pseudocode with a name (in this case, ``abc'' is the name). However, code in a subroutine does not execute unless the subroutine is invoked. To invoke a subroutine is also known as to call a subroutine.
In this program, the first to execute is line 4. This is because this line is the first line that is outside a subroutine definition. The next line that executes is line 5. This is where things get interesting. As subroutine ``abc'' is called, control is passed to the subroutine.
However, before passing control we need to remember the statement immediately following the invocation. In this case, it is line 6. After this line number is remmebered, control is transferred to the first line of code in the subroutine. As a result, after line 5, the next line to execute is the first line of code in the subroutine ``abc'', line 2.
Line 2 is the first and last statement in the subroutine. After its completion, we can imagine that we execute line 3. Normally, this is just considered a marker to end the definition of a subroutine. However, when a subroutine is finished, we need to perform a special operation.
When a subroutine completes its code, it needs to ``return'' to the code that invoked it in the first place. However, it does not return to the line that contains the invocation. Instead, it returns to the line following the invocation. This is because if we return to the line of invocation, then the subroutine is called again. This leads to the subroutine being called indefinitely.
In our example, we remember the line following the subroutine is line 6. This is why execution continues on line 6 after line 3.
Note that lines 4 to 6 are collectively the invoker (caller) of the subroutine ``abc''. Subroutine ``abc'' is the invoked (called) subroutine.