HP 80: What the heck is going on behind the curtain? - Printable Version +- HP Forums ( https://www.hpmuseum.org/forum)+-- Forum: HP Calculators (and very old HP Computers) ( /forum-3.html)+--- Forum: General Forum ( /forum-4.html)+--- Thread: HP 80: What the heck is going on behind the curtain? ( /thread-14064.html) |

HP 80: What the heck is going on behind the curtain? - Dave Britten - 11-27-2019 10:35 PM
I got my HP 80 up and running today (battery pack just arrived in the mail), and I expected some quirks given that it's the first financial calculator, but some of the precise sequences of steps you have to follow to carry out certain operations are just bizarre. For example: there are no stat registers. The Sigma+ key keeps the sums of x and x^2 in stack X and Z, and n in Y. So if you disturb the stack, you break your sums. But the black-box behavior goes much deeper than just Sigma+. If you press mean-x to calculate descriptive stats, then you get the mean of x in stack X, and standard deviation in stack Y. Meanwhile, Z still has the sum of x^2, and n is now in T. So since you've clobbered your stat registers, you might think you can't continue entering data after calculating the descriptive stats, right? Nope! Press Shift-mean-x (the ->Sigma function) and now the sum of x is back in X, and n is back in Y. From here, you can continue using Sigma+/- to accumulate data. This reversal seems to happen instantly, unlike the forward calculation of mean and standard deviation, which makes it seem like it's pulling the numbers back out of temporary registers, but if you disturb the stack before doing this, you don't get the correct n or sum of x back on the stack. The TL (trend-line, i.e. linear regression) function does similarly weird things, again keeping its intermediate figures out in the open on the stack. It accepts Y values only, assuming evenly spaced X values starting at 0 and incrementing by 1. First, the TL key is used to store the successive Y values. When you've entered all your data, press Shift-TL (Compute). Now you enter a starting x value and press n, and then press TL as many times as you want to calculate successive data points at incrementing values of x. If you mess up that "happy path" of keystrokes, you get very unpredictable results. Then there's craziness like the sum-of-years-digits/amort calculations requiring you to store the starting period minus one in the sole storage memory, then store the final period in n, followed by immediately storing the total number of periods into n again. You follow that with a very specific sequence of i, PMT, and Sigma+ to get accumulated interest and balance. Has anybody dumped/disassembled the ROM in this thing to figure out what crazy hidden values and state flags it's using behind the scenes? There are so many keys that seem like they totally change their effect on the machine depending on context and other unknown state information. Regardless, it's a really cool machine, and banging out TVMs, date calculations, and percentages is all perfectly intuitive and lacking in mystery. RE: HP 80: What the heck is going on behind the curtain? - Paul Dale - 11-27-2019 10:49 PM
(11-27-2019 10:35 PM)Dave Britten Wrote: Press Shift-mean-x (the ->Sigma function) and now the sum of x is back in X, and n is back in Y. From here, you can continue using Sigma+/- to accumulate data. This reversal seems to happen instantly, unlike the forward calculation of mean and standard deviation, which makes it seem like it's pulling the numbers back out of temporary registers... The reversal is multiplying the average by n and rearranging the stack. I doubt anything is stored in a temporary register. Pauli RE: HP 80: What the heck is going on behind the curtain? - Dave Britten - 11-27-2019 10:57 PM
(11-27-2019 10:49 PM)Paul Dale Wrote:(11-27-2019 10:35 PM)Dave Britten Wrote: Press Shift-mean-x (the ->Sigma function) and now the sum of x is back in X, and n is back in Y. From here, you can continue using Sigma+/- to accumulate data. This reversal seems to happen instantly, unlike the forward calculation of mean and standard deviation, which makes it seem like it's pulling the numbers back out of temporary registers... That does appear to be what's going on, based on a bit more playing. Shift-mean-x copies T to Y, then also multiplies X by T. Sigma+ adds X to Y, X^2 to T, increments Z, and drops the stack, losing the last entered x value and copying sum of x^2 from T to Z. Sigma- presumably does the same, with subtraction and decrementing instead. RE: HP 80: What the heck is going on behind the curtain? - Dave Britten - 11-28-2019 03:16 AM
So I hadn't realized until digging up this old thread that the HP 80 doesn't have financial registers - just four stack registers and the independent constant register. Everything is on the stack, and the machine is thus very sensitive about the order that you enter variables. Thus the only behind-the-scenes tricks appear to be the status bits that indicate which variables have been "stored" (i.e. which keys you've pressed so far). You get exactly the same (correct) results calculating a payment amount in either of these two ways: 360 n 4.75 ENTER 12 / i 141000 PV PMT 360 i 4.75 ENTER 12 / n 141000 PV PMT The calculator sees that you've pressed PMT without entering any new data, then since you pressed n, i, and PV before that (in no particular order), it branches off to calculate PMT under the assumption that n, i, and PV are in Z, Y, and X respectively. I'd be really curious to know which keystrokes change the status bits, and how these bits affect the different code paths when computing a result. Not particularly intuitive, but it's certainly a massive improvement over the old analog alternatives! RE: HP 80: What the heck is going on behind the curtain? - teenix - 11-28-2019 09:31 AM
(11-28-2019 03:16 AM)Dave Britten Wrote: I'd be really curious to know which keystrokes change the status bits, and how these bits affect the different code paths when computing a result. Not sure if it is what you need, but the emulator at http://www.teenix.org will let you play around behind the scenes of the HP80. As well as the emulator, you need to download the HP80 module as well. cheers Tony RE: HP 80: What the heck is going on behind the curtain? - Dave Britten - 11-28-2019 12:59 PM
(11-28-2019 09:31 AM)teenix Wrote:(11-28-2019 03:16 AM)Dave Britten Wrote: I'd be really curious to know which keystrokes change the status bits, and how these bits affect the different code paths when computing a result. That was going to be my next step. Whether or not I can actually make sense of what it's doing remains to be seen, of course! But the Trace feature ought to help quite a bit. RE: HP 80: What the heck is going on behind the curtain? - SlideRule - 11-28-2019 07:30 PM
An excerpt from The Actuary,vol 9 no. 5, pg. 6, May 1975 "Letters Negative Interest Sir: I have recently derived the two compound interest identities given below and am sure that many readers of The Actuary can benefit from these formulas. I have found them extremely helpful when one is dealing with a Hewlett-Packard Model 80 (HP- 80) electronic calculator. The identities are as follows: … (see article for hand-written equations) … My own realization of these identities was not connected with the above mathematical derivation, however. One day I was working with the pre-programmed immediate annuity and forborne annuity function keys of my HP-80 calculator in the solution of interest-adjusted net costs. I mistakenly pressed the incorrect keys while, at the same time, having entered the wrong data into the calculator. To my surprise, I had solved for the interest rate of an immediate annuity instead of the related forborne annuity due. This “interest rate” turned out to be the negative discount rate corresponding to an interest rate i. I guess not all discoveries are the result of much consideration of carefully thought out ideas!" Presentient? ENJOY! BEST! SlideRule |