The Museum of HP Calculators

HP Forum Archive 21

[ Return to Index | Top of Index ]

HP-41C Trivia Question
Message #1 Posted by Dan Grelinger on 11 Mar 2013, 4:57 p.m.

What (non-synthetic) HP-41C user code program line is the longest? That is, what single program line requires the most number of bytes (after PACKING)?

Edited: 11 Mar 2013, 6:04 p.m. after one or more responses were posted

      
Re: HP-41C Trivia Question
Message #2 Posted by gene wright on 11 Mar 2013, 5:02 p.m.,
in response to message #1 by Dan Grelinger

has to be a long number with minus signs and exponents.

-1.234567890E-99

perhaps?

            
Re: HP-41C Trivia Question
Message #3 Posted by Raymond Wiker on 11 Mar 2013, 5:08 p.m.,
in response to message #2 by gene wright

Quote:
has to be a long number with minus signs and exponents.

-1.234567890E-99

perhaps?


I think you're right - but I also think that you are allowed (much) more than 10 digits for the mantissa...

                  
Re: HP-41C Trivia Question
Message #4 Posted by Dan Grelinger on 11 Mar 2013, 5:38 p.m.,
in response to message #3 by Raymond Wiker

The HP-41C will not allow more than 10 digits in the mantissa. This applies both when entering a number from the keyboard and when entering a number into a program.

                        
Re: HP-41C Trivia Question
Message #5 Posted by Håkan Thörngren on 12 Mar 2013, 4:59 a.m.,
in response to message #4 by Dan Grelinger

01 5
02 -1.234567890 E-12
03 6

Line 02 is 16 bytes, but since it has two other numbers around it, there will also be an invisible null between the lines (after packing). If you "charge" half of the null to the one before and the other half to the following, that line would cost 16 + 0.5 + 0.5 = 17 bytes.

The second longest is text 15 which takes 16 bytes.

                              
Re: HP-41C Trivia Question
Message #6 Posted by Dan Grelinger on 12 Mar 2013, 9:52 a.m.,
in response to message #5 by Håkan Thörngren

Håkan,

You are correct. The answer is 17 bytes. For each following number, the HP-41C must maintain a null byte (0) to separate the second number from the first. In such a case, I would say that the null byte belongs in its entirety to the number that follows it, as it is there entirely for its purpose. But your way is correct as well and produces the same answer, it is only a different way of accounting for the extra byte.

Congratulations, I hereby declare you an HP-41C Master!

Dan

Edited: 12 Mar 2013, 9:58 a.m.

            
Re: HP-41C Trivia Question
Message #7 Posted by Dan Grelinger on 11 Mar 2013, 5:35 p.m.,
in response to message #2 by gene wright

Close. You need to specify the number of bytes.

      
Re: HP-41C Trivia Question
Message #8 Posted by Raymond Wiker on 11 Mar 2013, 5:05 p.m.,
in response to message #1 by Dan Grelinger

A string of 15 characters?

            
Re: HP-41C Trivia Question
Message #9 Posted by Dan Grelinger on 11 Mar 2013, 5:36 p.m.,
in response to message #8 by Raymond Wiker

That would be 16 bytes, and therefore almost the right answer, but not quite.

                  
Re: HP-41C Trivia Question
Message #10 Posted by PeterP on 12 Mar 2013, 1:32 a.m.,
in response to message #9 by Dan Grelinger

A LBL with 15 characters

                        
Re: HP-41C Trivia Question
Message #11 Posted by Dan Grelinger on 12 Mar 2013, 9:54 a.m.,
in response to message #10 by PeterP

Peter,

From our past correspondence a few years ago, I know you to be a synthetic programming expert.

But, such a label can only be created by synthetic means, and cannot be the correct answer to the question as synthetics was not allowed.

Dan

      
Re: HP-41C Trivia Question
Message #12 Posted by Paul Dale on 12 Mar 2013, 5:05 a.m.,
in response to message #1 by Dan Grelinger

What about a branch to a fifteen character alpha string?

- Pauli

            
Re: HP-41C Trivia Question
Message #13 Posted by Dan Grelinger on 12 Mar 2013, 9:57 a.m.,
in response to message #12 by Paul Dale

Pauli,

The HP-41C will only allow GTO and XEQ branches to global labels of seven characters or less. It would be possible to create a synthetic instruction to attempt to branch to a label with a name that is 15 characters long. However, synthetics was not allowed for this trivia question.

Incidentally, even if a 15 character label was created, the HP-41C would never find it, even with a 15 character branch instruction. The register used to search for labels (Q) will only hold 7 characters.


[ Return to Index | Top of Index ]

Go back to the main exhibit hall