main( ) { ... A( ); // Execute instructions in A and continue ... } A( ) { .... } |
We can implement the subroutine call as follows:
main: .... .... BRA A Ret: ... ... A: .... .... .... BRA Ret |
main( ) { ... A( ); // Execute instructions in A and continue ... A( ); // Execute instructions in A and continue } A( ) { .... } |
The implementation would be as follows:
main: .... .... BRA A Ret1: ... ... BRA A Ret2: ... ... ... A: .... .... .... BRA Ret1 |
Problem:
|
|
Analogy: Hansel and Gretel