HP Forums
HP-41C Trivia Question - Printable Version

+- HP Forums (https://archived.hpcalc.org/museumforum)
+-- Forum: HP Museum Forums (https://archived.hpcalc.org/museumforum/forum-1.html)
+--- Forum: Old HP Forum Archives (https://archived.hpcalc.org/museumforum/forum-2.html)
+--- Thread: HP-41C Trivia Question (/thread-240393.html)



HP-41C Trivia Question - Dan Grelinger - 03-11-2013

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 - Gene Wright - 03-11-2013

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

-1.234567890E-99

perhaps?


Re: HP-41C Trivia Question - Raymond Wiker - 03-11-2013

A string of 15 characters?


Re: HP-41C Trivia Question - Raymond Wiker - 03-11-2013

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 - Dan Grelinger - 03-11-2013

Close. You need to specify the number of bytes.


Re: HP-41C Trivia Question - Dan Grelinger - 03-11-2013

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


Re: HP-41C Trivia Question - Dan Grelinger - 03-11-2013

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 - PeterP - 03-12-2013

A LBL with 15 characters


Re: HP-41C Trivia Question - Håkan Thörngren - 03-12-2013

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 - Paul Dale - 03-12-2013

What about a branch to a fifteen character alpha string?


- Pauli


Re: HP-41C Trivia Question - Dan Grelinger - 03-12-2013

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 - Dan Grelinger - 03-12-2013

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 - Dan Grelinger - 03-12-2013

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.