TVM PROGRAM for the HP-19C/29C/34C/11C/15C
Back to main page If this is useful to you, Email me at: Genewright143@hotmail.com
Have you got an old HP programmable calculator lying around and wish you had a useful program you could run on it? Here's one option. This is a time value of money program that originally appeared in the May 1980 PPC Journal written by Robert Meyer.

The program will run as written on an HP-19C/29C, and with slight modification on an HP-34C, HP-11C, HP-15C. HP-67 users can either use the program provided in the standard pac or modify the one presented here for the HP-19C. HP-41C users should be using the PPC ROM FI program anyway. ;-)

This program is not very sophisticated when it comes to solving for the interest rate and can take up to a minute or so to find it. For all but bizarre financial problems, however, it should be OK. Be patient. If you have the HP-34C applications book, you really should use the program in it for TVM: it uses the Solve function for the interest rate.


Instructions:

1) Key in the program.

2) Initialize by 0, GSB 0 for an ordinary annuity; or a 1, GSB 0 for an annuity due.

3) Input known values as follows, using a zero for unknowns, and negative numbers for cash outflows and positive numbers for cash inflows:

N	STO 1
I(%)	STO 2
PMT	STO 3
PV	STO 4
FV	STO 5
4) Calculate the unknown value:
N	GSB 1
I(%)	GSB 2
PMT	GSB 3
PV	GSB 4
FV	GSB 5
The result appears in the display and in the appropriate storage register.

5) For a new problem, go to step 2. For new values, go to step 3.


Here's the program:
        Line         Keycode
01 	LBL 0        15 13 00
02 	STO.0        23 .0
03 	RTN          15 12
04 	LBL 1        15 13 01
05 	GSB 6        12 06
06	RCL 9        24 09
07	RCL 5        24 05
08	-            41
09	RCL 9        24 09
10	RCL 4        24 04
11	+            51
12	DIV          71
13	LN           14 42
14	RCL 6        24 06
15	LN           14 42
16	DIV          71
17	STO 01       23 01
18	RTN          15 12
19	LBL 2        15 13 02
20	0            00
21	ENTER        31
22	1            01
23	ENTER        31
24	STO 2        23 02
25	%            15 21
26	X<>Y         21
27	LBL 7        15 13 07
28	DIV          71
29	STO+2        23 51 02
30	STO.3        23 .3
31	X<>Y         21
32	STO.1        23 .1
33	GSB 6        12 06
34	RCL 4        24 04
35	-            41
36	STOx.3       23 61 .3
37	STO-.1       23 41 .1
38	RCL.3        24 .3
39	RCL.1        24 .1
40	X NE 0       15 61
41	GTO 7        13 07
42	RCL 2        24 02
43	RTN          15 12
44	LBL 3        15 13 03
45	GSB 6        12 06
46	X<>Y         21
47	RCL 4        24 04
48	-            41
49	RCL 8        24 08
50	DIV          71
51	RCL.2        24 .2
52	X            61
53	STO 3        23 03
54	RTN          15 12
55	LBL 4        15 13 04
56	GSB 6        12 06
57	STO 4        23 04
58	RTN          15 12
59	LBL 6        15 13 06
60	RCL .0       24 .0
61	STO 0        23 00
62	1            01
63	STO 8        23 08
64	RCL 2        24 02
65	%            15 21
66	STOx0        23 61 00
67	STO.2        23 .2
68	ISZ          15 24
69	+            51
70	STO 6        23 06
71	RCL 1        24 01
72	CHS          32
73	Y^X          14 64
74	CHS          32
75	STO 7        23 07
76	STO+8        23 51 08
77	RCL 5        24 05
78	X            61
79	RCL 8        24 08
80	RCL 3        24 03
81	RCL 0        24 0
82	STOx8        23 61 08
83	X            61
84	RCL.2        24 .2
85	DIV          71
86	STO 9        23 09
87	X            61
88	-            41
89	RTN          15 12
90	LBL 5        15 13 05
91	GSB 6        12 06
92	LASTX        14 73
93	RCL 4        24 04
94	+            51
95	RCL 7        24 07
96	DIV          71
97	STO 5        23 05
98	RTN          15 12
That's it. A few of the above lines need some explanation.
Lines 12, 16, 28, 50, 85, and 96 are the Divide function.
Line 40 is the conditional test "X not equal to Zero".
Lines where you see STO.3 are actually storing into memory 13. 
HP used this trick to save instructions in some calculators.
To translate this program to the HP-34C, HP-11C, or HP-15C, a couple of changes are needed:

(a) Lines 36 and 37 cannot be entered on the 34C or the HP-11C. This was something I didn't know until I was keying this into the 34C. Storage register arithmetic is only available on the 34C on the primary registers 0-9. What to do? Replace lines 36-39 of the above program with: ENTER, ENTER, RCL.3, X<>Y, X, RCL.1, LASTX, -, where the X right before the RCL.1 is a Multiply.

(b) Line 68 (ISZ) should be replaced with 1, STO+ 00, RDN, where RDN is Roll Down. This applies to the 34C, 11C, 15C.

(c) for the HP-15C, Change step 40 to be TEST 0 (Which is the HP-15C version of X NE 0), and make the change (b) just given for the 34C.


EXAMPLES: (I apologize for American dollar-based examples ;-) )

(1) Suppose you're going to buy a $200,000 house with a 30 year mortgage, at 8% compounded monthly. What is your monthly house payment?

Initialize: 0, GSB 0.
Key: 360, STO 1, 8 ENTER 12 DIV, STO 2, 200000, STO 4, 0, STO 5, GSB 3.

Answer is : -$1467.53.

Check for proper program entry by doing the following:

GSB 1 should show 360.00
GSB 2 should show 0.67 (which when multiplied by 12 is 8%)
GSB 4 should show 200000.00
GSB 5 should show 0.00

(2) Given the problem above and that you have solved it, suppose you only made payments of $1400 a month? What is the balance left to be paid at the end of the 30 year period?

If you haven't changed any values in memories 1-5 since the last example, key 1400 CHS STO 3. GSB 5.

Answer is -$100,642.70. Wow, better find a way to come up with that extra $67.53 a month.

(3) What is the yield on a 20 year semiannual bond with a coupon rate of 8%, that is currently selling for $900? (Assuming the maturity value is $1000)

Since the bond is semiannual, Initialize: 0, GSB 0. Key 40 STO 1, -40 STO 3, 900 STO 4, -1000 STO 5. GSB 2.

Answer is : 4.5471. This is the semiannual yield, so multiply by 2 and the true yield is 9.09%.


Visitors since 5/10/97