Most of our conversion routines are in macro 64(pretty quick).

However our compress is in DEC basic (pretty fast)

Fro example here is the compress routine

Code:

1000 FUNCTION STRING COMPRESS(DOUBLE DECI,LONG BYTES,LONG E)
OPTION TYPE=REAL,SIZE=(INTEGER LONG,REAL DOUBLE)
DECLARE STRING CONSTANT ZERO.1 = "0"C
DECLARE STRING CONSTANT ZERO.2 = ZERO.1 + ZERO.1
DECLARE STRING CONSTANT ZERO.3 = ZERO.2 + ZERO.1
MAP (EXPAND_MAP) I0$=1%, I1$=1%, I2$=1%, V% ! I0 I1 I2 VL-VM-VM-VH
MAP (EXPAND_MAP) O4$=4%, V2$=1%, V1$=1%, V0$=1% ! O4-O4-O4-O4 V2 V1 V0
MAP (EXPAND_MAP) F1$=1%, O3$=3% ! F O3-O3-O3
MAP (EXPAND_MAP) F2$=2%, O2$=2% ! F F O2-O2
MAP (EXPAND_MAP) F3$=3%, O1$=1% ! F F F O1
MINUS%=DECI<0. ! NEGATIVE FLAG
V=ABS(DECI)
IF BYTES<5% AND V<2147483648.
THEN V%=DECI
I0$=V0$
I1$=V1$
I2$=V2$
C128%=MINUS% AND 128%
SELECT BYTES
CASE 1%
COMPRESS=O1$
E= V>127.
CASE 2%
COMPRESS=O2$
E= V>32767.
CASE 3%
COMPRESS=O3$
E= V>8388607.
CASE 4%
COMPRESS=O4$
E=0%
END SELECT
ELSE IN=DECI ! SCALE
IN=-1-IN IF MINUS% ! TWOS COMPLIMENT IF NEGATIVE
IN=INT(IN+.00001) ! CHOP OFF EXTRA
TBIN$="" ! TEMP OUTPUT STRING
FOR I%=1% TO BYTES ! FOR EACH OUTPUT BYTE...
TMP=INT(IN/256%) ! STRIP LOW BITS FROM IN
TMOD%=IN-TMP*256% ! IN AND 255%
TBIN$=CHR$(TMOD% XOR MINUS%)+TBIN$ ! ADD ON TO OUT
IN=TMP ! UPDATE "IN"
NEXT I%
E=TMOD%>127% OR IN>0. ! OVERFLOW CONDITIONS?
COMPRESS=TBIN$ ! LOAD RESULT
END IF
END FUNCTION