Moonlanding program for the HP-15C

Description

This program simulates landing a rocket on the moon.

You Press the A function key to start the game then wait for the countdown to reach zero (0) then press the R/S key to interrupt the automatic decent and enter a new Fuel-Burn number.

A Fuel-Burn number of 3 will maintain your decent rate. Burnig more than 3 units of fuel will decrease your decent rate while buring less than 3 units will increase your decent rate. The objective is to have a velocity of zero when your altitude reaches zero feet.

The First number that flashes in the display shows a number in the form -DD.AAAA format where DD is the decent rate (negative means falling) and AAAA is your altitude. The second number that flashes is your remaining fuel.

Press the R/S key when the countdown reaches zero (0) or do nothing to allow the rocket to accelerate without a burn.

The display blinks when the game is over. The blinking value shows your decent rate at the time of impact. If your impact velocity is less than 2 feet per second you probably survived!

Program Resources

Labels

Name Description
 A Start Game with 120 units of fuel (easy mode)
 B Start Game with 60 units of fuel (hard mode)
 0 # Internal subroutine label
 4 # Internal subroutine label
 6 # Internal subroutine label
 7 # Internal subroutine label
 9 # Internal subroutine label

Storage Registers

Name Description
 6 Altitude
 7 Velocity
 8 Fuel Remaining
 9 Acceleration

Flags

Number Description
9 Blinks when game is over

Program

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