|
![]() The HP-28C/S programmable pocket calculator shown above was the first machine offering RPL (Reverse Polish LISP) as its programming language - it by far outperformed its predecessors like the HP 67 or the HP 41C/CV/CX in terms of sheer speed as well as in programming capabilities. With 32 kB of RAM (HP 28S, the HP 28C only had 2 kB of RAM) it is a programmers dream and way more than just another programmable pocket calculator. Prior to the HP 28S I had and used a HP 48GX mainly, but, to be honest, I never got acquainted to the plethora of menus which hid the functions from me and the cluttered keyboard with its three shift keys (this is exactly what HP tried to overcome with the transition from the HP 67 to the HP 41C - some ten years later the number of functions grew so heavily that three shift keys (including an Alpha key) and lots of (counterintuitive) menus were necessary again) so I used it as my main work horse, but not as something I would program just for fun. I always liked the HP 28S more - with its clamshell design (it opens like a book and features a complete alphanumeric keyboard which simplifies programming a lot) and its simpler menu structure than the HP 48GX it always attracted me more than the HP 48GX did. When my friend Götz gave his HP 28S to me as a wedding gift, I was (and still am :-) ) in heaven - now I eventually had the calculator I dreamed of for a long time (thank you very, very much again, Götz!). It took me more than a year to finally write a small page describing this calculator but here it is. |
Taking care of the HP 28S: | ||
All in all there is only one thing about the HP 28S which maybe could have been done better: The main problem is the battery compartment (the HP 28S takes three so called Lady-cells which are rather hard to find at the time of this writing - I have found accumulators in the very same format which work great in the HP 28S and replaced the batteries by these) - its sliding door tends to break! This is a real problem since the batteries make contact to springs which create quite some pressure so it is not easy to replace a broken battery compartment door by something else. The door on my calculator had been broken many years ago and the batteries are held in place by the damaged door and a bit of brown tape which works quite well but it surely doesn't look very nice. |
||
Example programs | ||
As I already noted, the HP 28S features RPL (Reverse Polish LISP) as its programming language. RPL looks a lot like Forth (of course, it is stack based - it is an HP made pocket calculator!) but is more powerful than a simple forth.
First of all it features an arbitrarily deep stack, so there are no
X-, Y-, Z- and T-registers like on the
HP 67 or HP 41C
calculators. This implies that there is nothing like In the following I will present some short (only two at the moment) example programs I have written. The first implements a clock (I never have a clock at hand - I do not like wrist watches (I am too thin for wrist watches to look good), but I always have a pocket calculator with me, so why shouldn't I use this instead of a clock. Unfortunately there is no built-in clock functionality in the HP 28S like there is in the HP 48GX, but the HP 28S has a clock register which will be incremented in stand-by mode as well as during run mode. So this register (its contents) can be used to implement a simple clock which is sufficient for most purposes (parts of the following program have been stolen from somewhere but I can not remember where I picked up the pieces, sorry!).
The following RPL-program implements a simple clock which can be read
out by simply executing the program. I stored it in a variable called
|
||
The next program is a bit more sophisticated - it is yet another implementation of the Ulam series: Start with an positive integer value. If it is even, divide it by two, if it is odd, multiply it by 3 and add one. Repeat this until you reach 1 (it is unclear whether every value will eventually yield 1!). The following program implements this series and will display the series elements in the upper left corner of the display. When 1 is reached, the program halts and leaves two values on the stack: In level 2 the number of iterations it took to reach 1 and in level 1 the sum of all series elements so far:
|
||
Other resources on the net | ||
|
24-JUN-2007 |