3.2 Multiple invocation

The following pseudocode helps to illustrate how a column is allocated, then deallocated, then allocated again.


Listing 2: A subroutine example with two invoke statements
1define sub addOne 
2  xx+ 1 
3end define sub 
4 
5x
6invoke addOne 
7xx+10 
8invoke addOne

When this pseudocode executes, column C is allocated when the invoke statement of line 6 executes. It is deallocated at the end of the subroutine. However, the same column is re-allocated when the subroutine is invoked again on line 8.





A
B C

Explanation





line#
x





pre
?





5
4





6 retline#





7





2
5





3 retline#

At this point, column C is deallocated, making it the leftmost available column again.





7
15





8 retline#

Because column C is the leftmost available column, it is allocated again for the purpose of storing the return line number.





post

The actual return line number is different this time.





2
16





3 retline#





post