HP Forums

Full Version: Re: HP-16C limits?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

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

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?