In RPN mode,

 

 

 

Starts subroutine here.

 

 "! 

 

Enters A.

 

 "! 

 

Enters B.

 

 "! 

 

Enters C.

 

 "! 

 

Enters D.

 

 

 

Recalls the data.

 

 

 

 

 

 

 

 

 

 

 

 

 

 º

 

A2.

 

 % 

€ M

A2 + B2.

N €

 % 

€ O

A2 + B2 + C2

P €

 % 

€ QA2 + B2 + C2+ D2

R €

 º

 

A2 + B2 + C2 + D2

 

 !

 

Returns to main routine.

 

  

 MOQ Nested subroutine

 

 º65¸

 

 

 

 º

 

Adds x2.

 

 -

 

NPR   !

 

Returns to subroutine S.
Branching (GTO)

As we have seen with subroutines, it is often desirable to transfer execution to a part of the program other than the next line. This is called branching.

Unconditional branching uses the GTO (go to) instruction to branch to a program label. It is not possible to branch to a specific line number during a program.

13–4Programming Techniques