Casio fx-201P

Datasheet legend
Ab/c: Fractions calculation
AC: Alternating current
BaseN: Number base calculations
Card: Magnetic card storage
Cmem: Continuous memory
Cond: Conditional execution
Const: Scientific constants
Cplx: Complex number arithmetic
DC: Direct current
Eqlib: Equation library
Exp: Exponential/logarithmic functions
Fin: Financial functions
Grph: Graphing capability
Hyp: Hyperbolic functions
Intg: Numerical integration
Jump: Unconditional jump (GOTO)
Lbl: Program labels
LCD: Liquid Crystal Display
LED: Light-Emitting Diode
Li-ion: Lithium-ion rechargeable battery
Lreg: Linear regression (2-variable statistics)
mA: Milliamperes of current
Mtrx: Matrix support
NiMH: Nickel-metal-hydrite rechargeable battery
Prnt: Printer
RTC: Real-time clock
Sdev: Standard deviation (1-variable statistics)
Solv: Equation solver
Subr: Subroutine call capability
Symb: Symbolic computing
Tape: Magnetic tape storage
Trig: Trigonometric functions
Units: Unit conversions
VAC: Volts AC
VDC: Volts DC
 Years of production: Aug 1976 Display type: Numeric display New price: Display color: Green Display technology: Vacuum fluorescent display Size: 7"×4"×1½" Display size: 10(8+2) digits Weight: 13 oz Entry method: Algebraic Batteries: 4×"AA" alkaline Advanced functions: Trig Exp External power: Casio adapter Memory functions: +/- I/O: Programming model: Keystroke entry Precision: 10 digits Program functions: Jump Cond Subr Lbl Ind Memories: 11 numbers Program display: Keycode display Program memory: 127 program steps Program editing: Overwrite capability Chipset: Forensic result: 8.9911614

Here is where it all began for Casio... or so I thought, until I was straightened out by Bo Kristoffersen, who pointed out that the fx-201P is probably Casio's second handheld programmable calculator.

It is a powerful, interesting, and highly unusual machine. Its programming model includes labels, indirect addressing, and subroutines, and it is unlike any other I've ever seen (although there's some curious resemblence, at least when it comes to the method used for program display, to early Russian Elektronika calculators such as the B3-34.)

The machine is also rather huge, weighing nearly a pound with batteries. Its large keyboard (43 keys) has no second function key; nevertheless, several keys have alternate functions when the calculator is in program mode. (Because of this, some keyboard functions, e.g., the 1/x or the π key, are not available in program mode.)

As a scientific calculator, the fx-201P performs adequately, but with some limitations. There are no parenthesis keys; for complex calculations, you need to use memories. The calculator uses 10 displayed digits but no guard digits; in fact, once exponents are used, calculations are performed to only 8 digits of precision. Scientific functions also yield only 8 digits.

Program mode is selected by a mechanical switch. In fact, the switch has three states: "MANUAL", "COMP" and "WRITE". Programs are executed in "COMP" mode, and are entered in "WRITE" mode; in "MANUAL" mode, the calculator works as a regular scientific calculator, and its independent memory (accessed through the M+ and MR keys) becomes available for use.

Program capacity is 127 keystrokes. Keycodes, shown in light brown on the keyboard, are displayed as a program is entered, along with the two most recent program steps. The display, curiously enough, also contains two red LED indicators; they light up when the calculator expects data, or displays a result.

The programming model is one of the most unusual I've ever seen. The machine is not a straightforward keystroke programmable in the sense that programming centers around simple statements involving the ten data registers. Program execution can be controlled through labels (up to 10), conditional and unconditional transfers, and subroutines. A separate index register is provided for indirect memory addressing. In program entry mode, number keys directly reference the ten numbered registers; constants can be entered by preceding them with the K key.

(Update on 2013/08/04: Paul Townsend informs me that a quirk of the calculator allows access to an 11th register, namely the independent memory: when switching to programming mode, do not use the AC key, so program memory remains filled with blanks. These blanks can then be used as the address of the independent memory register. Paul suggests that this quirk could be used in my Gamma function program below, replacing all references to the '0' register with these blanks. Paul also recalls another quirk, wheres the fx-201P "remembers" the destination register from one command line to the next; this could save some program steps, and it can also be used as a default GOTO address. I have not yet tested either of these quirks on an fx-201P.)

Here is a demonstration of the fx-201P's programming: my favorite example of course, the Gamma function. The program below uses Stirling's approximation and a simple iteration to compute the Gamma function to 8+ digits of precision for any real argument. You can find a traditional keycode listing below, but first here's the program in the style used in the fx-201P manual, which much better demonstrates the calculator's programming paradigm:

```ENT 1 :
2 = K 1 :
ST# 3 :
IF 1 = K 9 : 1 : 2 : 2 :
ST# 1 :
2 = 2 × 1 :
1 = 1 + K 1 :
GOTO 3 :
ST# 2 :
0 = K 1 ÷ K 105 ÷ 1 ÷ 1 :
0 = K 1 ÷ K 30 - 0 ÷ 1 ÷ 1 :
0 = K 1 - 0 ÷ 1 ÷ K 12 :
0 = 1 × ln - 1 + 0 - 2 ln:
2 = K 6.2831853 ÷ 1 :
0 = 2 √ ln + 0:
ANS 0 :```

And now, the keycode listing:

```001 E2	ENT
002  1	1
003 Г5	:
004  2	2
005 E0	=
006 L2	K
007  1	1
008 Г5	:
009 Г4	ST#
010  3	3
011 Г5	:
012 L3	IF
013  1	1
014 E0	=
015 L2	K
016  9	9
017 Г5	:
018  1	1
019 Г5	:
020  2	2
021 Г5	:
022  2	2
023 Г5	:
024 Г4	ST#
025  1	1
026 Г5	:
027  2	2
028 E0	=
029  2	2
030 E5	×
031  1	1
032 Г5	:
033  1	1
034 E0	=
035  1	1
036 E7	+
037 L2	K
038  1	1
039 Г5	:
040 Г2	GOTO
041  3	3
042 Г5	:
043 Г4	ST#
044  2	2
045 Г5	:
046  0	0
047 E0	=
048 L2	K
049  1	1
050 E6	÷
051 L2	K
052  1	1
053  0	0
054  5	5
055 E6	÷
056  1	1
057 E6	÷
058  1	1
059 Г5	:
060  0	0
061 E0	=
062 L2	K
063  1	1
064 E6	÷
065 L2	K
066  3	3
067  0	0
068 E8	-
069  0	0
070 E6	÷
071  1	1
072 E6	÷
073  1	1
074 Г5	:
075  0	0
076 E0	=
077 L2	K
078  1	1
079 E8	-
080  0	0
081 E6	÷
082  1	1
083 E6	÷
084 L2	K
085  1	1
086  2	2
087 Г5	:
088  0	0
089 E0	=
090  1	1
091 E5	×
092 F3	ln
093 E8	-
094  1	1
095 E7	+
096  0	0
097 E8	-
098  2	2
099 F3	ln
100 Г5	:
101  2	2
102 E0	=
103 L2	K
104  6	6
105 E9	.
106  2	2
107  8	8
108  3	3
109  1	1
110  8	8
111  5	5
112  3	3
113 E6	÷
114  1	1
115 Г5	:
116  0	0
117 E0	=
118  2	2
119 F1	√
120 F3	ln
121 E7	+
122  0	0
123 Г5	:
124 E3	ANS
125  0	0
126 Г5	:```