EasyManua.ls Logo

HP HP-10C - Page 77

HP HP-10C
122 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
Section 6: Branching and Looping 75
The program line immediately following that containing the conditional test
instruction can contain any instruction; however, the most commonly used
instruction there is t. If a t instruction follows a conditional test
instruction, program execution branches elsewhere in program memory if the
condition is true and continues with the next line in program memory if the
condition is false.
Example: The radioisotope decay program (page 72) can be made to stop
automatically after a specified number of loops by using the ~ condition.
Suppose N at t = 12 days is the last value you need. You can stop execution
automatically at this point by storing the number of loops to be run (3),
subtracting 1 from this number each time the loop is run, and instructing the
program to stop (with a t 00 instruction) when this number equals zero.
The revised program would then look like this
Keystrokes Display
¥
00-
´CLEARM
00-

Table of Contents

Related product manuals