The other day (December 20, 2012 to be exact; just a day before the world was supposed to come to an end according to some Mayan calendar), a gift package arrived in the mail, all the way from Germany. In it, a kit for an emulator of an old East German desktop programmable calculator, the Robotron K-1003, which dates back to 1978 or thereabouts.

VEB Robotron (the abbreviation VEB stands for Volkseigener Betrieb, or People-owned Enterprise), based in Dresden, was East Germany's largest electronics manufacturer. Among other things, it manufactured calculators, desktop computers and mainframe computers as well. This included the K-1000 line of desktop calculators. Of these, the K-1003 had the most memory and also featured a built-in printer.

These K-1000 machines present a curious mix of features. The size, the ability to print (albeit not display) alphanumeric characters remind me of the SR-60 from Texas Instruments. But the reverse polish logic definitely smells like HP. On the other hand, the calculator only has a 3-level stack (a non-trivial limitation compared to the 4-level stack of HP calculators). It also has guard digits (the internal precision is 12 decimal digits, of which 10 are displayed) which is again reminiscent of Texas Instruments devices.

In 2012, Michael Berger from Germany decided to resurrect this design. He created an emulator for the K-1000 that is implemented on a standard microcontroller. He then created a kit comprising the requisite printed circuit boards, parts, and most importantly, a professional quality keyboard.

Michael was kind enough to send me one of these kits as a Christmas present. And it arrived a few days early, leaving me enough time to put it together so that it can go under the Christmas tree fully assembled and working. The picture on the right shows the machine on my testbench; I have yet to build a shorter cable to connect the display, and mount the display itself permanently.

But now that I got this calculator working, I of course had to find out more about its programming model. I have been able to locate some vintage manuals online, and these were sufficient to teach me the basics. Although I have not yet played with more advanced programming features such as conditional jumps, indirect memory addressing and the like, I endeavored to put together a simple version of my standard programming example, the Gamma function. More specifically, an implementation of Stirling's formula, accurate to the full displayed precision of this calculator for arguments greater than 5, computing the natural logarithm of the Gamma function. Most notably, this program uses no memory registers; I was able to work around the limitations of the 3-level stack and perform all requisite calculations using the stack only. Without further ado, here is the program (to use it, enter the argument and hit STM x!):