The HP-67 emulator, starting on program memory

The latest changes in the git repository, under tag v2014-12-10, allow the keypress handler to store keypresses in program memory rather than execute the forms. Code to store and retrieve program steps is now present in the stack module, and the UI handler passes program memory information to the UI for rendering.

One change in behaviour between the physical calculator and the way we’ve implemented programming here is in the handling of multi-keypress numeric constants, such as “12.3”. In the calculator, that number would require 4 program steps to record entirely, one for each character. In the keypress-handling engine, we’ve decided not to pass numbers into the program memory until they have been completed. This is because that arguably makes the program easier to read, and because some UIs can hand in entire numbers, which means that having “1” then “2” as sequential program steps might be interpreted as either the sequence “1” “ENTER” “2”, or the number “12”. To avoid this ambiguity, we declare that all numbers in a program step represent entire, not partial, numbers.

We still have a few more things to do before programming is ready. The ncurses CLI that we’ve written doesn’t actually display program steps yet, that will come soon. We also have to start paying attention to the return codes from keypresses because they will allow us to move the program counter around if the user presses “GOTO”, among other things.