Hello,
BigEd kindly asked for more information about my home-made calculator, here are some for those who may be interested :
As you can see, it looks more like a "duo-digicode" than like a calculator ! I still don't find the hardware I'd like to use for the keyboard. The case is a very basic one from Teko :
It is a 65C02-based machine I finished building 3 months ago : a desktop RPN 4-level stack keystroke-programmable, scientific calculator. I chose to use "old-school" components, hence the alphanumeric display. Some specifications ? They look crude, but I focused on speed -more on that later.
- 6 MHz CPU + 32K RAM + 32K EPROM (2 x 16K switch-selectable, one bank for the calculator firmware, the other one contains Lee Davison's EhBASIC).
- Uses C.R. Bond's floating-point package, which I (partially) debugged and extended.
- 2,000 memory registers (the first 1,000 ones are absolute/indirect addressable, the other 1,000 only indirect-addressable).
- 15,742 user program steps (absolute addressing, no labels).
- The user program can be saved/loaded to/from a PC, using the serial port partially visible at the right side.
Let's take a closer look at the keypads... any comments related to their layout are very welcome !
You can easily guess that I found my inspiration in HP calculators. My machine is some kind of "pot-pourri" of functionalities : I took the number entry method of the hp9100 / hp9810 (scientific notation only), the programming instructions are inspired from the hp41, and so on... and O heresy, there's even a bit of Texas Instruments' TI-57 ! the DSZ instruction operates only on register 000 -simply because it fits my needs, and because it was much simpler to implement ... and faster at run-time.
From a software point of view, around the math package I wrote the user interface, a small program editor and the execution engine. My main goal was speed, so I deliberately chose not to implement fool-proof run-time checks. I'm the only user, it's up to me to know what I can or cannot do : for example, being sure that an indirect register number is actually a positive integer less than 2000... and so on. But of course, if a divide by 0 or an overflow occurs, the program is stopped and an error message a la HP-41 shows up.
Another key to high program execution speed lies in the register and line number processing : when single-stepped, their 3- or 5- digit value is read one digit at a time. But when the R/S key is pressed, all these numbers are first replaced by their equivalent absolute addresses, eliminating the time-consuming conversions from ASCII to binary. A "PACKING" message is displayed during that operation. Then the execution engine starts. Reversely, the ASCII values are put back in memory if single-step mode is entered or if the editor is launched. That simple trick resulted in a 12% speed increase.
Another speed trick is to stop the keyboard scanning interrupt service routine when a program is running. The R/S key columm is left active, and the row is polled each time a user instruction is completed, to check if the user wants to stop the program execution. As a result, the execution rate when using only simple arithmetic operations, averages 2,000 instructions per second. Not that bad, compared to pocket calculators... Complex functions are slower, the longest is nCr, the combinations one : C(3,328 ; 1,664) is computed in approximately 6.5 seconds.
The first photo above shows a running program (computing digits of Pi) ; the VIEW instruction refreshes the X stack display to get a countdown. One big advantage of the 2 x 40 character display is that when a program is single-stepped, the left side dynamically shows the program trace and the right side shows the X and Y stack registers as they are updated :
The 'd' letter besides the number line 00119 tells us that we're in debug mode, single-stepping the program. The instruction pointed at by the 'd' will be executed upon SST press. When in editor mode, the 'd' indicator is replaced with a right arrow.
I have much fun with that toy, writing and debugging the software was also very pleasant. Of course there are many many improvements paths. I'm not a numerical analysis expert and the accuracy, as told by C.R. Bond, is perfectible. (pi is computed in 10,000,000 base -7 digits out of 12)
No doubt I'll go on enhancing this machine ! The next big step will be to find parts for a "real" keyboard, then to have a printed circuit board done... I need some time, as usual.
Hoping some of you found that interesting,
Marc
BTW : I don't know how to hide the "attachments" part which shows up below ; and if I didn't choose the right thread please tell me how to move it. Thanks !