A Programmed GTO Instruction

The GTO label instruction (press {Vlabel) transfers the execution of a running program to the program line containing that label, wherever it may be. The program continues running from the new location, and never automatically returns to its point of origination, so GTO is not used for subroutines.

For example, consider the "Curve Fitting" program in chapter 16. The ! ' instruction branches execution from any one of three independent initializing routines to LBL Z, the routine that is the common entry point into the heart of the program:

 

.

.

.

 ! '

  

.

.

.

 ! '

  

.

.

.

 ! '

'  '

.

.

.

€M

€M

€M

M

Can start here.

Branches to Z.

Can start here.

Branches to Z.

Can start here.

Branches to Z.

Branch to here.

Using GTO from the Keyboard

You can use {Vto move the program pointer to a specified label or line number without starting program execution.

Programming Techniques 13–5

Page 189
Image 189
HP 33s Scientific manual Programmed GTO Instruction, Using GTO from the Keyboard