Section 6: Branching and Looping 79
Keystrokes Display
t07
04- 22 07
If condition is true,
branches to program line
07.
l2
05- 45 2
If condition is false,
recalls commission rate
of 12.5% from R
2
.
t08
06- 22 08
Branches program to line
08.
l1
07- 45 1
Recalls commission rate
of 10% from R
1
.
k
08- 21
Calculates commission.
Now we'll store the required numbers in registers R
0
, R
1
, and R
2
, and then run
the program, using  so that we can check that the branching occurs
properly. It's good practice with programs containing conditional test
instructions to check that the program branches correctly for all possible
conditions: in this case, if the sale amounts are less than, equal to, or greater
than the test value.
Keystrokes Display
¥
0.000
Sets calculator to Run
mode. (Display shows
result of previous
calculations.)
(Initializing)
´CLEAR Q
0.000
´•2
0.00
Sets display format to
two decimal places.
1000O0
1,000.00
Stores test value in R
0
.
10O1
10.00
Stores 10% commission
rate in R
1
.
12.5O2
12.50
Stores 12.5%
commission rate in R
2
.
(First Data Test)