HP-41 program.



#6

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


#7

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).

#8

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.

rdb.


#9

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.

#10

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.


Possibly Related Threads...
Thread Author Replies Views Last Post
  HP-41(CL): The easiest way to transfer FOCAL programs from a Linux PC to the HP-41 Geir Isene 13 1,334 12-05-2013, 02:40 AM
Last Post: Hans Brueggemann
  HP Prime: run a program in another program Davi Ribeiro de Oliveira 6 620 11-11-2013, 08:28 PM
Last Post: Davi Ribeiro de Oliveira
  Updated PPC DVD Version 2.10: HP-41 Searchable Program Files and Scannable Barcode Jake Schwartz 3 463 09-27-2013, 09:51 PM
Last Post: Olivier (Wa)
  Looking for PLTMX80 program for HP- 41 Ángel Martin 1 225 10-19-2012, 05:21 AM
Last Post: Ángel Martin
  New 41 model to use rom of "big" program Olivier De Smet 4 417 10-03-2012, 07:35 PM
Last Post: Brian Walsh
  Editable PDF Docs for HP-41 Program Documentation? Namir 8 592 03-08-2012, 11:13 PM
Last Post: John Robinson
  HP-41 Ohms Law Program Jeff Davis 45 2,515 12-28-2010, 09:23 PM
Last Post: Ren
  HP-41: Sail boat parameter program Geir Isene 0 180 11-24-2010, 01:37 PM
Last Post: Geir Isene
  HP-41 Program conversion to Text files Jeff Davis 9 694 01-28-2008, 02:54 AM
Last Post: Christoph Klug
  HP-41 MCODE: Making an MCODE program call another MCODE program Geir Isene 10 778 01-13-2008, 05:58 AM
Last Post: Raymond Del Tondo

Forum Jump: