HP 12C User Manual page 132

Platinum financial calculator
Hide thumbs Also See for 12C:
Table of Contents

Advertisement

132 Section 9: Branching and Looping
Keystrokes
(RPN mode)
go
gi007
:2
gi008
:1
b
fs
ALG program notes: We'll key the income into the display before running the
program. We'll store it in R
chapter. By keying the income into the display before running the program, we
ensure that it will be in the X-register when the :0 instruction in program line
002 is executed. This instruction will place the test value 20,000 in the X-register
and move the income into the Y-register. The ~ instruction in program line 003
will exchange the numbers in the X- and Y-registers: that is, it will place the income
back into the X-register and place the test value into the Y-register. This is
necessary because when either the :2 instruction in line 007 or the :1
instruction in line 009 is executed, the number in the X-register is moved into the
Y-register; if the ~ instruction were not included, the test value 20,000, rather
than the income, would be in the Y-register when the b instruction in line 010 is
executed.
Keystrokes
(ALG mode)
f[
fs
fCLEARÎ
?9
File name: hp 12c pt_user's guide_English_HDPMF123E27
Printed Date: 2005/8/1
Display
003,
43
34
Tests whether number in X-register
(income) is less than or equal to
number in Y-register (20,000).
004,43, 33, 007
If condition is true, branches to
program line 007.
005,
45
2
If condition is false, recalls 25%
tax rate to X-register.
006,43, 33, 008
Branches to program line 008.
007,
45
1
Recalls 20% tax rate to X-register.
008,
25
Calculates tax.
–190.22
Sets calculator to Run mode.
(Display shows results of running
of previous program.)
so it will be available for the examples in the next
9
Display
007,43, 33, 002
Sets calculator to Program mode.
(Display shows program line at
which execution was halted at
end of preceding example.)
000,
Clears program memory.
001,
44
9
Stores income into register R
Page: 132 of 275
Dimension: 14.8 cm x 21 cm
.
9

Advertisement

Table of Contents
loading

Table of Contents