Probably most people who've used HP Financial Calculators such as the HP-12C are familiar with the top row interactive financial functions that include (in varying orders):

n - number of periods,

i - interest rate of rate of return,

PMT - periodic payment amount,

PV - Present Value,

FV - Future Value.

In nearly every financial calculator there is a dedicated memory register for each of these functions. The only exception is the HP-80, the very first pocket financial calculator that came out in 1973. On the HP-80 the only memory locations are the 4-level stack, the single storage register, plus a couple of internal registers (A&B). As a result, entering a value and then pressing one of the financial functions places that value on the stack.

For example, to find the monthly interest rate on a 36 month loan, you would enter 36 and press n, enter the monthly payment amount and press PMT (negative on later machines), enter the loan amount and press PV. As such, the number of payments is stored in the Z register, payment amount in Y register and the loan (PV) in X. Pressing i gives you the monthly interest rate.

What is fascinating to me is how the HP-80 keeps track of what values are on the stack. For example how would it know that the X register contains the PV and not a FV? I can only guess that when you press one of the financial keys, some sort of flag is set to identify what that value is. Pressing "i" could trigger different functions, depending on what previous values were input.

Has anyone else figured out how this works?

Considering its limited ROM and RAM, which was very expensive at the time, the HP-80 is an amazing little machine with a ton of different functions packed into it. Despite its limitations it yields very accurate results, as long as you enter the values in the correct order.