The Museum of HP Calculators

HP Forum Archive 04

[ Return to Index | Top of Index ]

HP-41 program.
Message #1 Posted by Nick Markov on 22 Dec 2000, 9:04 p.m.

In the software library for the HP-41c, the moon rocket lander program has the following listing.

10 LBL 09 11 RCL 06 12 7DSP4 13 E4 14 / 15 RCL 07

This is a program ported to the HP-41 from the HP-67. Does anybody what line 12 and 13 are? How to key them in on a HP-41?

Thanks, Nick

Re: HP-41 program.
Message #2 Posted by Steve(USA) on 23 Dec 2000, 12:34 a.m.,
in response to message #1 by Nick Markov

I don't have time for a few days to verify, but maybe one of the smart people out there could confirm "Synthetic Programming"? (Just a random guess).

Re: HP-41 program.
Message #3 Posted by r. d. bärtschiger. on 23 Dec 2000, 2:40 a.m.,
in response to message #1 by Nick Markov

Instruction at line 12 is an hp67 or hp97 instruction for DSP4. The 41 equivilent is FIX 4. Line 13 is simply 1e4, i.e. 10,000. There was some way, I don't at the moment recall just how, to enter exponants without the leading 1. E4 is the same as 1E4 except that is uses one less byte, as I recall. On a 41 simply enter FIX 4 & EEX 4. Hopes this helps.


Moon landing simulators and display mode
Message #4 Posted by Andrés C. Rodríguez (Argentina) on 23 Dec 2000, 7:26 a.m.,
in response to message #3 by r. d. bärtschiger.

As I recall, the moon landing simulator for the HP67 was an "improved" version of the simulator for the HP25. The -67 version included the use of the PSE (Pause) function with live keyboard, so to give you four seconds to enter the amount of fuel that you are willing to burn on each program iteration.

On the HP25, the program stopped, waiting for input, and it was up to the user to enter the value and press R/S. On the HP67, the more sophisticated Pause function allowed for a value to be entered without stopping the program; and if the user did not enter a value, the program just keep running with a default value (possibly 0 in this case).

Since the Pause function had a 1 second duration, the 4 second interval was obtained repeating Pause instructions, possible with a looping construct such as DSZ (Decrement and Skip when Zero), which allowed "en passant" for a countdown display (4...3...2...1...) with almost no programming cost. (Oh, such elegant solutions from the golden time where memory was counted byte by byte and not "by the gig")

Since PSE works on this same way on the HP41, the program will work on it; keep in mind that the PSE instruction works differently on a HP42 (no live keyboard)

Another improvement this program received when ported from the HP25 to the 67 was to take into account the mass of fuel already burnt, so the Lunar Module mass decreased on each iteration.

With regard to the display mode, and taking into account that the 7DSP 4 instruction appears at the beginning of the program (which suggests an initialization routine, not part of a main loop), I assume that the display mode is set once when the program starts, and will not change during the "flight". So a FIX 4 instruction will be OK. If the program works the same way than in the HP25, the display will change to FIX 0 if the module crashed on the moon. FIX 0 should be interpreted as a Game Over message. On the next run, the display will revert to FIX 4.

I hope this will help, I was very interested on such simulators at the time, but these comments come from my memory, and there may be some missing detail.

Re: HP-41 program.
Message #5 Posted by bill duncan on 23 Dec 2000, 2:48 a.m.,
in response to message #1 by Nick Markov

Line 12 is one of the 67/97 compatibility commands available if you have a card reader plugged in. It changes the number of significant display digits without changing the display mode. (eg. if you are in engineering mode, or scientific mode, it won't change.)

Line 13 is just entering the exponent, eg. pressing "EEx" and then a "4". Actually it's a little more complicated, because normally doing this will automatically enter it as "1 E4" on the program line. However there is a way to "eat" the "1" and have the same effect, thereby saving some memory. But for your application, this probably isn't a concern.

I'm not familiar with the program, but if you don't have a card reader, you can probably easily program a replacement routine for the "7DSP4" function by testing flag 40 and 41.

You may not even need to do that however.

If the program doesn't actually change modes, then just use the display mode it uses. eg. if it is always in fix mode, then just "FIX 4". Or "SCI 4" or "ENG 4". Whatever.

[ Return to Index | Top of Index ]

Go back to the main exhibit hall