Section 4: Branching; Unconditional Branching And Looping - HP -33E Owner's Handbook Manual

Hide thumbs Also See for HP-33E:
Table of Contents

Advertisement

Section 4
Branching
Unconditional Branching and Looping
You have seen how the nonrecordable operation
.nn can be used
from the keyboard to transfer execution to any line number of program
memory. You can also use the
(go to) instruction as part of a
program.
When the calculator is executing a program and encounters a
nn
instruction, for example, it goes immediately to that line number. By
using a
instruction in your program, you can transfer execution
to any part of the program that you choose. When the calculator executes
a
instruction, it begins execution again at the specified line it
encounters.
Program Memory
r ———
nn
Execution |
branches
to line nn
L — g
Line nn
A
instruction used this way is known as an unconditional branch.
It always unconditionally branches execution from the
instruction
to the specified line number. Later, you will see how a conditional
instruction can be used in conjunction with a
instruction to create
a conditional branch—a branch that depends on the outcome of a test.
A common use of a branch is to create a '*loop'" in a program. For
example, the following program calculates and displays the square roots
of consecutive whole numbers beginning with the number 1. Your
HP-33E continues to compute the square root of the next consecutive
whole number until you press
to stop program execution (or until
the calculator overflows).
46

Advertisement

Table of Contents
loading

This manual is also suitable for:

Hp-33c

Table of Contents