The Museum of HP Calculators

HP Forum Archive 15

[ Return to Index | Top of Index ]

Re: HP-16C limits?
Message #1 Posted by Patrice Torchet on 19 Apr 2005, 3:50 p.m.

Sorry for the delay (it is done on my spare time).

Under is the program (not tested fully) for the compressor (LBL C) and the decompressor (LBL D) on the HP16C.

Quote:
As I said, it is 5 KB of Java classes, and though RPN may be more compact, there is no way to squeeze it into an HP 16C.
So it seems you are wrong, I have squeezed it enough to fit. 169 bytes in size is rather efficient, isn't it ?

Patrice

LBL C
8
8
8
GSB E
X<>Y
X<>I
CLX
GSB 9
GSB 9
GSB 9
3
RLn
X<>I
7
0
0
GSB E
SR
OR
GTO I
LBL 9
X<>Y
4
RRn
X<>Y
RRC
RTN
LBL 1
8
GTO 9
LBL 3
4
E
GTO 9
LBL 7
6
E
GTO 9
LBL 2
6
GSB E
4
GSB A
A
GTO 9
LBL 4
6
GSB E
7
GSB A
C
GTO 9
LBL 6
6
GSB E
7
GSB A
E
GTO 9
LBL 5
6
0
GSB E
3
GSB A
2
E
GTO 9
LBL E
X<>Y
AND
LST X
X<>Y
XOR
LST X
RTN
LBL A
RLn
LBL 9
OR
RTN
LBL B
RRn
OR
RTN
LBL D
3
8
0
GSB E
SL
OR
8
GSB E
X<>I
R DN
GTO I
LBL 0
RTN
LBL 8
6
GSB E
X<>I
R DN
GTO I
LBL 0
8
GTO 9
LBL 2
6
0
GSB E
4
GSB B
8
0
GTO 9
LBL 4
6
0
0
GSB E
8
GSB B
8
0
0
GTO 9
LBL 6
6
0
GSB E
4
RRn
X<>I
R DN
GTO I
LBL 0
6
0
0
GSB E
8
GSB B
8
8
0
GTO 9
LBL 2
6
0
0
GSB E
4
GSB B
8
0
8
GTO 9
LBL 4
8
8
GTO 9
LBL 6
8
8
8
GTO 9
      
Re: HP-16C limits?
Message #2 Posted by Gunnar Degnbol on 20 Apr 2005, 5:16 p.m.,
in response to message #1 by Patrice Torchet

Very nice. I thought I might regret saying "no way".

Actually, the DPD part is "only" 3 KB of the java code. The other 2 KB are the rest of the specification, packing exponent and sign with the coefficient:

http://www2.hursley.ibm.com/decimal/dbspec.html

You can't do that in the remaining 44 bytes, can you?


[ Return to Index | Top of Index ]

Go back to the main exhibit hall