Branching (gto) – HP 35s Scientific Calculator User Manual

Page 214

Advertising
background image

14-4

Programming Techniques

In RPN mode,

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 specific
program line (label and line number).

  

Starts subroutine here.

  

Enters A.

  

Enters B.

  

Enters C.

  

Enters D.

  

Recalls the data.

  
  
  
 

A

2

.

  

1

A

2

+ B

2

.

2

  

3

A

2

+ B

2

+ C

2

4

  

5

A

2

+ B

2

+ C

2

+ D

2

6



 

Returns to main routine.

  

 135

Nested subroutine

 
 

 

Adds x

2

.

246 

 

Returns to subroutine S.

2

2

2

2

D

C

B

A

+

+

+

Advertising