Subroutine Limits - HP -11C Owner's Handbook Manual

Hide thumbs Also See for HP-11C:
Table of Contents

Advertisement

120
Section 8: Subroutines
Subroutine
Execution trans-
(9](RTN]
Execution trans-
fers to line 000
fers back to main
and halts.
program; pending
return status
cleared.
As you can see, the only difference between using
(go to
subroutine) and
(go to branch) is the transfer of execution
after the [RTN].
After a [GTO], the next
causes execution to transfer to
line 000 and halt; after a [GSB], the next
causes
execution to transfer back to the main program and resume.
Subroutine Limits
A subroutine can call up another subroutine, and that subroutine
can call up yet another subroutine. This "subroutine nesting"' —the
execution of a subroutine within a subroutine—is limited only by
the number of returns ([RTN]) that can be held pending at any one
time in the HP-11C. Here is how the HP-11C operates with nested
subroutines.
Main Program
f
(LBL)2
/
/
/
/
cse)3 |/
(G582
&
End

Advertisement

Table of Contents
loading

Table of Contents