Branching (gto) – HP 33s User Manual

Page 188

Advertising
background image

13–4

Programming

Techniques

In RPN mode,

 

Starts subroutine here.

 "! 

Enters A.

 "! 

Enters B.

 "! 

Enters C.

 "! 

Enters D.

 

Recalls the data.

 

 

 

 º



A

2

.

 % 

€ M

A

2

+ B

2

.

N €

 % 

€ O

A

2

+ B

2

+ C

2

P €

 % 

€ Q

A

2

+ B

2

+ C

2

+ D

2

R €



º

2

2

2

2

D

C

B

A

+

+

+

 !

Returns to main routine.

   

 MOQ

Nested subroutine

  º65¸

  º



  -

Adds

x

2

.

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.

Advertising