Panasonic RL-H1800

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
Ind: Indirect addressing
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
NiCd: Nickel-Cadmium rechargeable battery
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:   Display type: Alphanumeric display  
New price:   Display color: Black  
    Display technology: Liquid crystal display 
Size: 4"×7"×1" Display size: 26.5 characters
Weight: 21 oz    
    Entry method: BASIC expressions 
Batteries: 4×"AA" NiCd Advanced functions: Trig Exp Cmem RTC Snd 
External power: Panasonic adapter   Memory functions:  
I/O: Expansion port, module ports     
    Programming model: BASIC 
Precision: 10 digits Program functions: Jump Cond Subr Lbl Ind  
Memories: 8(0) kilobytes Program display: Text display  
Program memory: 8 kilobytes Program editing: Text editor  
Chipset:   Forensic result:  

*With optional Microsoft BASIC ROM

rl-h1800.jpg (38208 bytes)The RL-H series of pocket computers represented Panasonic's entry into the so-called HHC, or Hand Held Computer, market. This computer/calculator has a number of interesting/unusual features, such as its universal expansion port (to which either a single peripheral or a peripheral expansion bay can be attached) or its bottom compartment for optional ROM chips which are standard DIP chips whose pins are wrapped around specially manufactured plastic holders.

The RL-H handheld computers are not programmable by default; they are, however, equipped with the functionality of a basic 4-function calculator with memory. Programmability is achieved by the addition of an optional Microsoft BASIC ROM chip. This version of the BASIC interpreter is very simplistic; to my amazement, I found that it doesn't even have trigonometric functions!

Having obtained a compatible printer that connects to this unit, I was dying to find out how one can print results, or list programs, from within the BASIC interpreter. Using the printer was easy in calculator mode; once the printer was turned on through the I/O menu, all calculations were printed automatically. Not so in the BASIC interpreter. Early enough I found out that the interpreter recognizes the syntax print#n where n, presumably, is the identifier of an open file or device; however, for all acceptable values of n (0..15) the device responded with an I/O error. Attempts to open a file resulted in a syntax error.

Lacking any documentation for the BASIC interpreter, I decided to do some reverse engineering instead. I wrote a little program to list the contents of the calculator's memory, in the hope that I'll be able to locate the interpreter's keyword table in ROM:

10 INPUT A
20 PRINT A; TAB(6);
30 FOR I=A TO A+15
40 X= PEEK (I)AND 127
50 IF X<32 THEN X=32
60 PRINT CHR$(X);
70 NEXT
80 A=A+16
90 GET X$
100 PRINT
110 GOTO 20

With the help of this program, I was indeed able to locate the interpreter's keywords, among them the attach keyword. In many BASIC implementations, this keyword was used to open a device for input or output. Next question was the proper syntax of this command; after a lot of experimentation, I found out that attach 29 to #3 does the trick. Afterwards, I can use print#3 or list#3 and obtain output on the printer. (The printer still needs to be turned on through the I/O menu first.)

With the printer at hand, it was much easier to experiment with other programs, including my favorite programming example, the Gamma function. Here is yet another variant of this algorithm, written for the Panasonic HHC. (Note that the precision used in the code is probably an overkill, since this Microsoft BASIC does not perform double-precision arithmetic.)

10 DATA 76.18009172947
20 DATA -86.50532032942
30 DATA 24.01409824083
40 DATA -1.23173957245
50 DATA 1.208650973866E-3
60 DATA -5.395239384953E-6
100 INPUT X
110 T=1
120 IF X>=0 THEN GOTO 160
130 T=T*X
140 X=X+1
150 GOTO 120
160 G=1.00000000019
170 FOR I=1 TO 6
180 READ P
190 G=G+P/(X+I)
200 NEXT I
210 G= LOG (2.506628274631*G/X)
220 G=G-X-5.5+LOG (X+5.5)*(X+.5)
230 PRINT EXP (G)/T