Time Value of Money

Description

This program computes the time value of money similar to the HP-12C financial calculator.

The user definable function keys A-E behave much like the (n,i,PV,PMT,FV) keys on the HP-12C financial calculator. You enter any three of these values (pressing it's function key) and compute the 4th or 5th value by pressing CLx followed by the function key of the missing value, and the R/S key. The difference is on the HP12C you don't need to press the R/S key, but otherwise this program behaves exactly like the HP-12C. If you set Flag(0), calculations are based on payments at the Beginning of the payment period, (Like "g Beg" on the HP-12C). If you clear Flag(0), calculations are based on payments at the End of the payment period (Like "g End" on the HP-12C).

Examples:

Program Resources

Labels

Name Description Name Description
 A Number of compounding periods (n)  0 Internal subroutine label. Used as error indicator.
 B Interest per compounding period (i)  1 Internal subroutine label
 C Present Value of annuity (PV)  2 Internal subroutine label
 D Payment (PMT)  3 Internal subroutine label
 E Future Value (FV)  4 Internal subroutine label

Storage Registers

Name Description Name Description
 0 Used during calculations  5 Saves (FV)
 1 Saves (n)  6 Used during calculations
 2 Saves (i)  7 Used during calculations
 3 Saves (PV)  8 Used during calculations
 4 Saves (PMT)

Flags

Number Description
0 Set = "g Beg", Cleared = "g End"
1 Used during calculations

Program

Line Display Key Sequence Line Display Key Sequence Line Display Key Sequence
000 037 42.21. 4 f LBL 4 074 43. 4. 1 g SF 1
001 42.21.11 f LBL A 038 26 EEX 075 1 1
002 44 1 STO 1 039 2 2 076 45 2 RCL 2
003 31 R/S 040 20 × 077 43 14 g %
004 32 1 GSB 1 041 44 2 STO 2 078 42.21. 3 f LBL 3
005 43 36 g LSTx 042 43 32 g RTN 079 44 8 STO 8
006 45.20. 0 RCL × 0 043 42.21.13 f LBL C 080 1 1
007 45 5 RCL 5 044 44 3 STO 3 081 44 0 STO 0
008 34 x↔y 045 31 R/S 082 40 +
009 30 046 32 1 GSB 1 083 43.30. 4 g TEST x≤0
010 43 36 g LSTx 047 32 2 GSB 2 084 22 0 GTO 0
011 45.40. 3 RCL + 3 048 16 CHS 085 44 6 STO 6
012 43 20 g x=0 049 44 3 STO 3 086 43. 6. 0 g F? 0
013 22 0 GTO 0 050 43 32 g RTN 087 44 0 STO 0
014 10 ÷ 051 42.21.14 f LBL D 088 45 1 RCL 1
015 16 CHS 052 44 4 STO 4 089 16 CHS
016 43.30. 4 g TEST x≤0 053 31 R/S 090 14
017 22 0 GTO 0 054 1 1 091 44 7 STO 7
018 43 12 g LN 055 44 4 STO 4 092 1 1
019 45 6 RCL 6 056 32 1 GSB 1 093 34 x↔y
020 43 12 g LN 057 45 3 RCL 3 094 30
021 10 ÷ 058 32 2 GSB 2 095 43 20 g x=0
022 44 1 STO 1 059 34 x↔y 096 22 0 GTO 0
023 43 32 g RTN 060 10 ÷ 097 45.20. 0 RCL × 0
024 42.21.12 f LBL B 061 16 CHS 098 45 4 RCL 4
025 44 2 STO 2 062 44 4 STO 4 099 45.10. 8 RCL ÷ 8
026 31 R/S 063 43 32 g RTN 100 20 ×
027 48 . 064 42.21.15 f LBL E 101 43. 6. 1 g F? 1
028 2 2 065 44 5 STO 5 102 43 32 g RTN
029 36 ENTER 066 31 R/S 103 45.40. 3 RCL + 3
030 26 EEX 067 32 1 GSB 1 104 42.21. 2 f LBL 2
031 16 CHS 068 45.40. 3 RCL + 3 105 45 5 RCL 5
032 3 3 069 45.10. 7 RCL ÷ 7 106 45.20. 7 RCL × 7
033 43. 5. 1 g CF 1 070 16 CHS 107 40 +
034 42.10. 3 f SOLVE 3 071 44 5 STO 5 108 43 32 g RTN
035 22 4 GTO 4 072 43 32 g RTN
036 22 0 GTO 0 073 42.21. 1 f LBL 1