Home » Personal collection » Commodore disks » disk32a_commodore_disk_user_3_7.d64 » compression

compression

This website contains an archive of files for the Acorn Electron, BBC Micro, Acorn Archimedes, Commodore 16 and Commodore 64 computers, which Dominic Ford has rescued from his private collection of floppy disks and cassettes.

Some of these files were originally commercial releases in the 1980s and 1990s, but they are now widely available online. I assume that copyright over them is no longer being asserted. If you own the copyright and would like files to be removed, please contact me.

Tape/disk: Home » Personal collection » Commodore disks » disk32a_commodore_disk_user_3_7.d64
Filename: compression
Read OK:
File size: 1C69 bytes
Load address: 0801
Exec address: 0000
Duplicates

There is 1 duplicate copy of this file in the archive:

File contents
    10 ;**********************************
    15 ;*       DATA COMPRESSION         *
    20 ;*--------------------------------*
    25 ;*        N.HIGGINS 1989          *
    30 ;*--------------------------------*
    35 ;* METHOD: RUN LENGTH ENCODING    *
    40 ;* USING : MARKER(COUNT,CHAR)     *
    45 ;**********************************
    50 ;* FIRST CALL THE ROUTINES AT:-   *
    55 ;*                                *
    60 ;*  COMPRESS - SYS $C000          *
    65 ;*  DECOMPER - SYS $C0B8          *
    70 ;*                                *
    75 ;* NOW ENTER THE MONITOR AND USE  *
    80 ;* THE COMMAND (MC110 C170) TO    *
    85 ;* SEE THE RESULTS.               *
    90 ;**********************************
    95 ;
   100 ;
   105 ;
   110 ;
   115 ;--------------------------------
   120 ;POINTER TO THE END OF THE DATA
   125 ;TO BE COMPRESSED.
   130 ;--------------------------------
   135 ;
   140 TEXTEND=TEXT+16
   145 ;
   150 MARKER=$EF
   155 DATPNT=$FB
   160 STOPNT=$FD
   165 ;
   170 ;
   175 *=49152
   180 ;
   185 ;
   190 ;--------------------------------
   195 ;SET POINTER TO DATA TO BE
   200 ;COMPRESSED (TEXT)
   205 ;SET POINTER TO STORE THE
   210 ;COMPRESSED DATA (STORAGE)
   215 ;--------------------------------
   220 ;
   225 COMPRESS LDA #<TEXT
   230 STA DATPNT
   235 LDA #>TEXT
   240 STA DATPNT+1
   245 LDA #<STORAGE
   250 STA STOPNT
   255 LDA #>STORAGE
   260 STA STOPNT+1
   265 ;
   270 ;
   275 ;---------------------------------
   280 ;SET (ENDFLAG) TO ZERO
   285 ;SET (COUNT) TO 1
   290 ;GET BYTE/IS CARRY SET?
   295 ;YES:GOTO [E]
   300 ;STORE BYTE
   305 ;[A] GET NEXT BYTE/IS CARRY SET?
   310 ;YES:GOTO [E]
   315 ;IS BYTE SAME AS PREVIOUS?
   320 ;NO :GOTO [C]
   325 ;YES:INCREMENT (COUNT)
   330 ;IS (COUNT) =0
   335 ;YES:OUTPUT MARKER($FF,CHAR)
   340 ;SET (COUNT)=1/GOTO [A]
   345 ;NO :GOTO [A]
   350 ;---------------------------------
   355 ;
   360 LDY #0
   365 STY ENDFLAG
   370 LDA #1
   375 STA COUNT
   380 JSR GETBYTE
   385 BCS FINISH
   390 STA CHARACTER
   395 ;
   400 AGAIN JSR GETBYTE
   405 BCS LOOP
   410 CMP CHARACTER
   415 BNE LOOP2
   420 CONTINUE INC COUNT
   425 BNE AGAIN
   430 LDA #MARKER
   435 JSR PUTBYTE
   440 LDA #$FF
   445 JSR PUTBYTE
   450 LDA CHARACTER
   455 JSR PUTBYTE
   460 JMP CONTINUE
   465 ;
   470 ;
   475 ;--------------------------------
   480 ;[C] STORE BYTE
   485 ;GET PREVIOUS BYTE/IS IT A MARKER?
   490 ;YES:GOTO [F]
   495 ;NO :IS (COUNT) <4
   500 ;YES:GOTO [G]
   505 ;NO :GOTO [F]
   510 ;--------------------------------
   515 ;
   520 LOOP2 STA STORE
   525 LOOP LDA CHARACTER
   530 CMP #MARKER
   535 BEQ LOOP9
   540 LDA COUNT
   545 CMP #4
   550 BCC LOOP5
   555 ;
   560 ;
   565 ;--------------------------------
   570 ;[F] OUTPUT MARKER(COUNT,CHAR)
   575 ;--------------------------------
   580 ;
   585 LOOP9 LDA #MARKER
   590 JSR PUTBYTE
   595 LDA COUNT
   600 JSR PUTBYTE
   605 LDA CHARACTER
   610 JSR PUTBYTE
   615 ;
   620 ;
   625 ;--------------------------------
   630 ;[D] CHECK FLAG/IS IT SET?
   635 ;YES:GOTO [E]
   640 ;NO :GET STORED BYTE
   645 ;SET (COUNT) TO 1/GOTO [A]
   650 ;--------------------------------
   655 ;
   660 LOOP6 LDA ENDFLAG
   665 BMI FINISH
   670 LDA STORE
   675 STA CHARACTER
   680 LDA #1
   685 STA COUNT
   690 JMP AGAIN
   695 ;
   700 ;
   705 ;--------------------------------
   710 ;[G] OUTPUT CHAR
   715 ;DECREMENT (COUNT)
   720 ;IS (COUNT)=0
   725 ;YES:GOTO [D]
   730 ;NO :GOTO [G]
   735 ;--------------------------------
   740 ;
   745 LOOP5 LDA CHARACTER
   750 JSR PUTBYTE
   755 DEC COUNT
   760 BEQ LOOP6
   765 JMP LOOP5
   770 ;
   775 ;
   780 ;--------------------------------
   785 ;[E] WHEN FINISHED WE STORE THE
   790 ;END ADDRESS+1 OF THE COMPACTED
   795 ;DATA FOR THE DECOMPRESS ROUTINE.
   800 ;--------------------------------
   805 ;
   810 FINISH LDA STOPNT
   815 STA COMPEND
   820 LDA STOPNT+1
   825 STA COMPEND+1
   830 RTS
   835 ;
   840 ;
   845 ;--------------------------------
   850 ;CHECK IF REACHED THE END OF DATA
   855 ;NO :GET NEXT BYTE/CLR CARRY/RETURN
   860 ;YES:SET (ENDFLAG)/SET CARRY/RETURN
   865 ;--------------------------------
   870 ;
   875 GETBYTE LDA DATPNT
   880 CMP #<TEXTEND
   885 BNE LOOP12
   890 LDA DATPNT+1
   895 CMP #>TEXTEND
   900 BNE LOOP12
   905 LDA #$FF
   910 STA ENDFLAG
   915 SEC
   920 RTS
   925 ;
   930 LOOP12 LDA (DATPNT),Y
   935 INC DATPNT
   940 BNE LOOP14
   945 INC DATPNT+1
   950 LOOP14 CLC
   955 RTS
   960 ;
   965 ;
   970 ;---------------------------------
   975 ;OUTPUT BYTE
   980 ;---------------------------------
   985 ;
   990 PUTBYTE STA (STOPNT),Y
   995 INC STOPNT
  1000 BNE LOOP15
  1005 INC STOPNT+1
  1010 LOOP15 RTS
  1015 ;
  1020 ;
  1025 ;
  1030 ;*********************************
  1035 ;*     DECOMPRESS ROUTINE        *
  1040 ;*********************************
  1045 ;* THIS MUST BE CALLED AFTER THE *
  1050 ;* COMPRESSION ROUTINE,IT WILL   *
  1055 ;* RESTORE THE COMPRESSED DATA   *
  1060 ;* AT 'STORAGE' BACK TO ITS      *
  1065 ;* ORIGINAL VALUES AND PLACE IT  *
  1070 ;* AT 'NEWTEXT'.                 *
  1075 ;*********************************
  1080 ;* YOU CAN THEN COMPARE BOTH     *
  1085 ;* 'TEXT' & 'NEWTEXT' TO SEE     *
  1090 ;* THAT THEY MATCH.              *
  1095 ;*********************************
  1100 ;
  1105 ;
  1110 ;-------------------------------
  1115 ;SET POINTERS TO START OF
  1120 ;COMPRESSED DATA (STORAGE) &
  1125 ;DECOMPRESSED DATA (NEWTEXT)
  1130 ;-------------------------------
  1135 ;
  1140 DECOMPER LDA #<STORAGE
  1145 STA DATPNT
  1150 LDA #>STORAGE
  1155 STA DATPNT+1
  1160 LDA #<NEWTEXT
  1165 STA STOPNT
  1170 LDA #>NEWTEXT
  1175 STA STOPNT+1
  1180 ;
  1185 ;-------------------------------
  1190 ;GET COMPRESSED DATA
  1195 ;IS IT A MARKER?
  1200 ;NO:OUTPUT IT/INCREMENT (NEWTEXT)
  1205 ;INCREMENT POINTER (STORAGE)
  1210 ;IS IT END OF COMP.DATA?
  1215 ;NO:GO BACK GET NEXT BYTE
  1220 ;YES:EXIT
  1225 ;-------------------------------
  1230 ;
  1235 LDY #0
  1240 RELOOP LDA (DATPNT),Y
  1245 CMP #MARKER
  1250 BEQ LOOP40
  1255 STA (STOPNT),Y
  1260 JSR PNT1
  1265 LOOP50 JSR PNT2
  1270 LDA DATPNT
  1275 CMP COMPEND
  1280 BNE RELOOP
  1285 LDA DATPNT+1
  1290 CMP COMPEND+1
  1295 BNE RELOOP
  1300 RTS
  1305 ;
  1310 ;-------------------------------
  1315 ;IF A MARKER IS FOUND THEN
  1320 ;PUT (COUNT) IN X
  1325 ;PUT (CHAR) IN A
  1330 ;OUTPUT (CHAR) UNTIL X=0
  1335 ;-------------------------------
  1340 ;
  1345 LOOP40 JSR PNT2
  1350 LDA (DATPNT),Y
  1355 TAX
  1360 JSR PNT2
  1365 LDA (DATPNT),Y
  1370 LOOP42 STA (STOPNT),Y
  1375 JSR PNT1
  1380 DEX
  1385 BNE LOOP42
  1390 BEQ LOOP50
  1395 ;
  1400 ;
  1405 ;-----------------------------
  1410 ;INCREMENT POINTERS
  1415 ;-----------------------------
  1420 ;
  1425 PNT1 INC STOPNT
  1430 BNE LOOP43
  1435 INC STOPNT+1
  1440 LOOP43 RTS
  1445 ;
  1450 PNT2 INC DATPNT
  1455 BNE LOOP44
  1460 INC DATPNT+1
  1465 LOOP44 RTS
  1470 ;
  1475 ;
  1480 ;
  1485 ;
  1490 ;
  1495 COMPEND BYT 0,0
  1500 STORE BYT 0
  1505 COUNT BYT 0
  1510 CHARACTER BYT 0
  1515 ENDFLAG BYT 0
  1520 ;
  1525 ;--------------------------------
  1530 ;THESE ARE THE BYTES TO BE
  1535 ;COMPRESSED...YOU CAN USE YOUR
  1540 ;OWN INSTEAD BUT IF YOU EXTEND
  1545 ;ITS SIZE THEN MAKE SURE YOU
  1550 ;ALTER THE OTHER STORAGE AREA'S
  1555 ;AND POINTERS ACCORDINGLY...
  1560 ;--------------------------------
  1565 ;
  1570 TEXT ;
  1575 ;
  1580 BYT $01,$01,$01,$01
  1585 BYT $01,$01,$01,$01
  1590 BYT $01,$01,$01,$01
  1595 BYT $01,$01,$EF,$01
  1600 ;
  1605 ;--------------------------------
  1610 ;THE BYTES ABOVE ARE COMPRESSED
  1615 ;AND STORED HERE..............
  1620 ;(3 BYTES/FOR EVERY 1 IN TEXT)
  1625 ;--------------------------------
  1630 STORAGE ;
  1635 ;
  1640 BYT 0,0,0,0,0,0,0,0
  1645 BYT 0,0,0,0,0,0,0,0
  1650 BYT 0,0,0,0,0,0,0,0
  1655 BYT 0,0,0,0,0,0,0,0
  1660 BYT 0,0,0,0,0,0,0,0
  1665 BYT 0,0,0,0,0,0,0,0
  1670 ;
  1675 ;--------------------------------
  1680 ;THE COMPRESSED DATA IN 'STORAGE'
  1685 ;IS DECOMPRESSED & PLACED HERE...
  1690 ;--------------------------------
  1695 ;
  1700 NEWTEXT ;
  1705 ;
  1710 BYT 0,0,0,0,0,0,0,0
  1715 BYT 0,0,0,0,0,0,0,0
  1720 BYT 0,0,0,0,0,0,0,0
  1725 BYT 0,0,0,0,0,0,0,0
  1730 BYT 0,0,0,0,0,0,0,0
  1735 BYT 0,0,0,0,0,0,0,0
  1740 ;
  1745 ;

)
;**********************************Q;*       DATA COMPRESSION         *y;*--------------------------------*�;*        N.HIGGINS 1989          *�;*--------------------------------*�#;* METHOD: RUN LENGTH ENCODING    *	(;* USING : MARKER(COUNT,CHAR)     *A	-;**********************************i	2;* FIRST CALL THE ROUTINES AT:-   *�	7;*                                *�	<;*  COMPRESS - SYS $C000          *�	A;*  DECOMPER - SYS $C0B8          *	
F;*                                *1
K;* NOW ENTER THE MONITOR AND USE  *Y
P;* THE COMMAND (MC110 C170) TO    *�
U;* SEE THE RESULTS.               *�
Z;**********************************�
_;�
d;�
i;�
n;�
s;--------------------------------x;POINTER TO THE END OF THE DATA"};TO BE COMPRESSED.H�;--------------------------------N�;`�TEXT��TEXT�16f�;u�MARKER�$EF��DATPNT�$FB���NT�$FD��;��;����49152��;��;��;--------------------------------��;SET POINTER TO DATA TO BE�;COMPRESSED (TEXT).�;SET POINTER TO STORE THEM�;COMPRESSED DATA (STORAGE)s�;--------------------------------y�;��COMPRESS LDA #�TEXT��STA DATPNT��LDA #�TEXT��STA DATPNT�1��LDA #�S�RAGE��STA �NT��LDA #�S�RAGE�STA �NT�1
	;
;/
;---------------------------------J
;SET (ENDFLAG) TO ZERO`
;SET (COUNT) TO 1|
";GET BYTE/IS CARRY SET?�
';YES:GOTO [E]�
,;STORE BYTE�
1;[A] GET NEXT BYTE/IS CARRY SET?�
6;YES:GOTO [E]�
;;IS BYTE SAME AS PREVIOUS?@;NO :GOTO [C]!E;YES:INCREMENT (COUNT)4J;IS (COUNT) =0UO;YES:OUTPUT MARKER($FF,CHAR)qT;SET (COUNT)=1/GOTO [A]�Y;NO :GOTO [A]�^;---------------------------------�c;�hLDY #0�mSTY �FLAG�rLDA #1�wSTA COUNT�|JSR �BYTE��BCS FINISH�STA CHARACTER�;+�AGAIN JSR �BYTE8�BCS LOOPJ�CMP CHARACTERX�BNE LOOP2l��INUE INC COUNTz�BNE AGAIN��LDA #MARKER��JSR PUTBYTE��LDA #$FF��JSR PUTBYTE��LDA CHARACTER��JSR PUTBYTE��JMP �INUE��;��;�;---------------------------------�;[C] STORE BYTET�;GET PREVIOUS BYTE/IS IT A MARKER?f�;YES:GOTO [F]}�;NO :IS (COUNT) <4��;YES:GOTO [G]��;NO :GOTO [F]��;--------------------------------�;�LOOP2 STA S�RE�
LOOP LDA CHARACTERCMP #MARKERBEQ LOOP9#LDA COUNT.!CMP #4<&BCC LOOP5B+;H0;n5;--------------------------------�:;[F] OUTPUT MARKER(COUNT,CHAR)�?;--------------------------------�D;�ILOOP9 LDA #MARKER�NJSR PUTBYTE�SLDA COUNTXJSR PUTBYTE]LDA CHARACTER#bJSR PUTBYTE)g;/l;Uq;--------------------------------tv;[D] CHECK FLAG/IS IT SET?�{;YES:GOTO [E]��;NO :GET STORED BYTE��;SET (COUNT) TO 1/GOTO [A]��;--------------------------------��;��LOOP6 LDA �FLAG
�BMI FINISH�LDA S�RE,�STA CHARACTER7�LDA #1E�STA COUNTS�JMP AGAINY�;_�;��;--------------------------------��;[G] OUTPUT CHAR��;DECREMENT (COUNT)��;IS (COUNT)=0��;YES:GOTO [D]��;NO :GOTO [G]
�;--------------------------------�;+�LOOP5 LDA CHARACTER;�JSR PUTBYTEI�DEC COUNTW�BEQ LOOP6e�JMP LOOP5k;q;�;--------------------------------�;[E] WHEN FINISHED WE STORE THE�;END ADDRESS+1 OF THE COMPACTED;DATA FOR THE DECOMPRESS ROUTINE.+ ;--------------------------------1%;D*FINISH LDA �NTR/STA COMP�`4LDA �NT�1p9STA COMP��1x>RTS~C;�H;�M;--------------------------------�R;CHECK IF REACHED THE END OF DATA�W;NO :GET NEXT BYTE/CLR CARRY/RETURN \;YES:SET (ENDFLAG)/SET CARRY/RETURNFa;--------------------------------Lf;ak�BYTE LDA DATPNTqpCMP #�TEXT��uBNE LOOP12�zLDA DATPNT�1�CMP #�TEXT���BNE LOOP12��LDA #$FF��STA �FLAG��SEC��RTS��;��LOOP12 LDA (DATPNT),Y
�INC DATPNT�BNE LOOP14*�INC DATPNT�19�LOOP14 CLCA�RTSG�;M�;t�;---------------------------------��;OUTPUT BYTE��;---------------------------------��;��PUTBYTE STA (�NT),Y��INC �NT��BNE LOOP15��INC �NT�1�LOOP15 RTS�;�;;;;*********************************b;*     DECOMPRESS ROUTINE        *�;*********************************�;* THIS MUST BE CALLED AFTER THE *�;* COMPRESSION ROUTINE,IT WILL   *�;* RESTORE THE COMPRESSED DATA   *%$;* AT 'STORAGE' BACK TO ITS      *L);* ORIGINAL VALUES AND PLACE IT  *s.;* AT 'NEWTEXT'.                 *�3;*********************************�8;* YOU CAN THEN COMPARE BOTH     *�=;* 'TEXT' & 'NEWTEXT' TO SEE     *B;* THAT THEY MATCH.              *6G;*********************************<L;BQ;gV;-------------------------------�[;SET POINTERS TO START OF�`;COMPRESSED DATA (STORAGE) &�e;DECOMPRESSED DATA (NEWTEXT)�j;-------------------------------�o;tDECOMPER LDA #�S�RAGEySTA DATPNT,~LDA #�S�RAGE=�STA DATPNT�1M�LDA #��TEXTY�STA �NTi�LDA #��TEXTw�STA �NT�1}�;��;-------------------------------��;GET COMPRESSED DATA��;IS IT A MARKER?��;NO:OUTPUT IT/INCREMENT (NEWTEXT)�;INCREMENT POINTER (STORAGE)4�;IS IT END OF COMP.DATA?R�;NO:GO BACK GET NEXT BYTE`�;YES:EXIT��;-------------------------------��;��LDY #0��RELOOP LDA (DATPNT),Y��CMP #MARKER��BEQ LOOP40��STA (�NT),Y��JSR PNT1�LOOP50 JSR PNT2�LDA DATPNT�CMP COMP�,BNE RELOOP=LDA DATPNT�1M
CMP COMP��1\BNE RELOOPdRTSj;�;-------------------------------�#;IF A MARKER IS FOUND THEN�(;PUT (COUNT) IN X�-;PUT (CHAR) IN A�2;OUTPUT (CHAR) UNTIL X=07;-------------------------------!<;5ALOOP40 JSR PNT2HFLDA (DATPNT),YPKTAX]PJSR PNT2pULDA (DATPNT),Y�ZLOOP42 STA (�NT),Y�_JSR PNT1�dDEX�iBNE LOOP42�nBEQ LOOP50�s;�x;�};-----------------------------�;INCREMENT POINTERS$�;-----------------------------*�;;�PNT1 INC �NTJ�BNE LOOP43X�INC �NT�1g�LOOP43 RTSm�;��PNT2 INC DATPNT��BNE LOOP44��INC DATPNT�1��LOOP44 RTS��;��;��;��;��;��COMP� BYT 0,0��S�RE BYT 0��COUNT BYT 0 �CHARACTER BYT 0# ��FLAG BYT 0) �;O �;--------------------------------n �;THESE ARE THE BYTES TO BE� �;COMPRESSED...YOU CAN USE YOUR� ;OWN INSTEAD BUT IF YOU EXTEND� 	;ITS SIZE THEN MAKE SURE YOU� ;ALTER THE OTHER STORAGE AREA'S!;AND POINTERS ACCORDINGLY...@!;--------------------------------F!;Q!"TEXT ;W!';o!,BYT $01,$01,$01,$01�!1BYT $01,$01,$01,$01�!6BYT $01,$01,$01,$01�!;BYT $01,$01,$EF,$01�!@;�!E;--------------------------------"J;THE BYTES ABOVE ARE COMPRESSED*"O;AND STORED HERE..............M"T;(3 BYTES/FOR EVERY 1 IN TEXT)s"Y;--------------------------------�"^S�RAGE ;�"c;�"hBYT 0,0,0,0,0,0,0,0�"mBYT 0,0,0,0,0,0,0,0�"rBYT 0,0,0,0,0,0,0,0�"wBYT 0,0,0,0,0,0,0,0�"|BYT 0,0,0,0,0,0,0,0#�BYT 0,0,0,0,0,0,0,0#�;B#�;--------------------------------h#�;THE COMPRESSED DATA IN 'STORAGE'�#�;IS DECOMPRESSED & PLACED HERE...�#�;--------------------------------�#�;�#��TEXT ;�#�;�#�BYT 0,0,0,0,0,0,0,0�#�BYT 0,0,0,0,0,0,0,0$�BYT 0,0,0,0,0,0,0,0,$�BYT 0,0,0,0,0,0,0,0D$�BYT 0,0,0,0,0,0,0,0\$�BYT 0,0,0,0,0,0,0,0b$�;h$�;
)HJ@;**********************************@qHO@;*       data compression         *@YHT@;*--------------------------------*@.HY@;*        n.higgins 1989          *@.H.@;*--------------------------------*@.H#@;* method: run length encoding    *@YI(@;* using : marker(count,char)     *@aI-@;**********************************@II2@;* first call the routines at:-   *@.I7@;*                                *@.I<@;*  compress - sys $c000          *@.Ia@;*  decomper - sys $c0b8          *@IJf@;*                                *@1Jk@;* now enter the monitor and use  *@yJp@;* the command (mc110 c170) to    *@.Ju@;* see the results.               *@.Jz@;**********************************@.J.@;@.JD@;@.JI@;@.JN@;@.JS@;--------------------------------@KKX@;pointer to the end of the data@"K.@;to be compressed.@hK.@;--------------------------------@nK.@;@.K.@text..text.16@FK.@;@UK.@marker.$ef@.K.@datpnt.$fb@.K.@.nt.$fd@.K.@;@.K.@;@.K.@..49152@.K.@;@.K.@;@.K.@;--------------------------------@.K.@;set pointer to data to be@PL.@;compressed (text)@.L.@;set pointer to store the@mL.@;compressed data (storage)@SL.@;--------------------------------@YL.@;@.L.@compress lda #.text@.L.@sta datpnt@.L.@lda #.text@.L.@sta datpnt.1@.L.@lda #.s.rage@.L.@sta .nt@.L.@lda #.s.rage@.LDAsta .nt.1@BMIA;@HMNA;@/MSA;---------------------------------@jMXA;set (endflag) to zero@.M]A;set (count) to 1@.M"A;get byte/is carry set?@.M'A;yes:goto [e]@.M,A;store byte@.M1A;[a] get next byte/is carry set?@.M6A;yes:goto [e]@.M;A;is byte same as previous?@FN@A;no :goto [c]@!NeA;yes:increment (count)@4NjA;is (count) =0@uNoA;yes:output marker($ff,char)@QNtA;set (count)=1/goto [a]@.NyA;no :goto [a]@.N.A;---------------------------------@.NCA;@.NHAldy #0@.NMAsty .flag@.NRAlda #1@.NWAsta count@.N.Ajsr .byte@.N.Abcs finish@QO.Asta character@WO.A;@+O.Aagain jsr .byte@8O.Abcs loop@jO.Acmp character@xO.Abne loop2@LO.A.inue inc count@ZO.Abne again@.O.Alda #marker@.O.Ajsr putbyte@.O.Alda #$ff@.O.Ajsr putbyte@.O.Alda character@.O.Ajsr putbyte@.O.Ajmp .inue@.O.A;@.O.A;@YP.A;--------------------------------@-P.A;[c] store byte@tP.A;get previous byte/is it a marker?@FP.A;yes:goto [f]@.P.A;no :is (count) <4@.P.A;yes:goto [g]@.P.A;no :goto [f]@.P.A;--------------------------------@.PCB;@.PHBloop2 sta s.re@.PMBloop lda character@GQRBcmp #marker@UQWBbeq loop9@#Q£Blda count@.Q!Bcmp #4@<Q&Bbcc loop5@bQ+B;@hQ0B;@NQ5B;--------------------------------@.Q:B;[f] output marker(count,char)@.Q?B;--------------------------------@.QdB;@.QiBloop9 lda #marker@.QnBjsr putbyte@.QsBlda count@ARxBjsr putbyte@SR]Blda character@#RBBjsr putbyte@)RGB;@/RLB;@uRQB;--------------------------------@TRVB;[d] check flag/is it set?@.R.B;yes:goto [e]@.R.B;no :get stored byte@.R.B;set (count) to 1/goto [a]@.R.B;--------------------------------@.R.B;@.R.Bloop6 lda .flag@MS.Bbmi finish@ZS.Blda s.re@,S.Bsta character@7S.Blda #1@eS.Bsta count@sS.Bjmp again@yS.B;@.S.B;@.S.B;--------------------------------@.S.B;[g] output char@.S.B;decrement (count)@.S.B;is (count)=0@.S.B;yes:goto [d]@.S.B;no :goto [g]@MT.B;--------------------------------@ST.B;@+T.Bloop5 lda character@;T.Bjsr putbyte@iT.Bdec count@wT.Bbeq loop6@ET.Bjmp loop5@KTBC;@QTGC;@.TLC;--------------------------------@.TQC;[e] when finished we store the@.TVC;end address+1 of the compacted@EU[C;data for the decompress routine.@+U C;--------------------------------@1U%C;@dU*Cfinish lda .nt@rU/Csta comp.@.U4Clda .nt.1@PU9Csta comp..1@XU>Crts@.UcC;@.UhC;@.UmC;--------------------------------@.UrC;check if reached the end of data@.UwC;no :get next byte/clr carry/return@ V£C;yes:set (endflag)/set carry/return@fVAC;--------------------------------@lVFC;@AVKC.byte lda datpnt@QVPCcmp #.text.@.VUCbne loop12@.VZClda datpnt.1@.V.Ccmp #.text.@.V.Cbne loop12@.V.Clda #$ff@.V.Csta .flag@.V.Csec@.V.Crts@.V.C;@.V.Cloop12 lda (datpnt),y@JW.Cinc datpnt@YW.Cbne loop14@*W.Cinc datpnt.1@9W.Cloop14 clc@aW.Crts@gW.C;@mW.C;@TW.C;---------------------------------@.W.C;output byte@.W.C;---------------------------------@.W.C;@.W.Cputbyte sta (.nt),y@.W.Cinc .nt@.W.Cbne loop15@.W.Cinc .nt.1@BX.Cloop15 rts@HX.C;@NX.C;@TXAD;@;XFD;*********************************@BXKD;*     decompress routine        *@.XPD;*********************************@.XUD;* this must be called after the *@.XZD;* compression routine,it will   *@.X.D;* restore the compressed data   *@%Y$D;* at 'storage' back to its      *@lY)D;* original values and place it  *@SY.D;* at 'newtext'.                 *@.Y3D;*********************************@.Y8D;* you can then compare both     *@.Y=D;* 'text' & 'newtext' to see     *@OZbD;* that they match.              *@6ZgD;*********************************@<ZlD;@bZqD;@GZvD;-------------------------------@.Z[D;set pointers to start of@.Z.D;compressed data (storage) &@.ZED;decompressed data (newtext)@.ZJD;-------------------------------@.ZOD;@L[TDdecomper lda #.s.rage@[[YDsta datpnt@,[.Dlda #.s.rage@=[.Dsta datpnt.1@m[.Dlda #..text@y[.Dsta .nt@I[.Dlda #..text@W[.Dsta .nt.1@.[.D;@.[.D;-------------------------------@.[.D;get compressed data@.[.D;is it a marker?@.[.D;no:output it/increment (newtext)@W£.D;increment pointer (storage)@4£.D;is it end of comp.data?@r£.D;no:go back get next byte@.£.D;yes:exit@.£.D;-------------------------------@.£.D;@.£.Dldy #0@.£.Dreloop lda (datpnt),y@.£.Dcmp #marker@.£.Dbeq loop40@.£.Dsta (.nt),y@.£.Djsr pnt1@@].Dloop50 jsr pnt2@O].Dlda datpnt@]].Dcmp comp.@,]@Ebne reloop@=]EElda datpnt.1@m]JEcmp comp..1@£]OEbne reloop@D]TErts@J]YE;@.].E;-------------------------------@.]#E;if a marker is found then@.](E;put (count) in x@.]-E;put (char) in a@.]2E;output (char) until x=0@[.7E;-------------------------------@!.<E;@5.aEloop40 jsr pnt2@h.fElda (datpnt),y@p.kEtax@].pEjsr pnt2@P.uElda (datpnt),y@..zEloop42 sta (.nt),y@...Ejsr pnt1@..DEdex@..IEbne loop42@..NEbeq loop50@..SE;@..XE;@...E;-----------------------------@A..E;increment pointers@$..E;-----------------------------@*..E;@;..Epnt1 inc .nt@j..Ebne loop43@x..Einc .nt.1@G..Eloop43 rts@M..E;@...Epnt2 inc datpnt@...Ebne loop44@...Einc datpnt.1@...Eloop44 rts@...E;@...E;@...E;@...E;@...E;@...Ecomp. byt 0,0@...Es.re byt 0@...Ecount byt 0@S .Echaracter byt 0@# .E.flag byt 0@) .E;@o .E;--------------------------------@N .E;these are the bytes to be@. .E;compressed...you can use your@. DF;own instead but if you extend@. IF;its size then make sure you@. NF;alter the other storage area's@Z!SF;and pointers accordingly...@@!XF;--------------------------------@f!]F;@q!"Ftext ;@w!'F;@O!,Fbyt $01,$01,$01,$01@.!1Fbyt $01,$01,$01,$01@.!6Fbyt $01,$01,$01,$01@.!;Fbyt $01,$01,$ef,$01@.!@F;@.!eF;--------------------------------@G"jF;the bytes above are compressed@*"oF;and stored here..............@m"tF;(3 bytes/for every 1 in text)@S"yF;--------------------------------@.".Fs.rage ;@."CF;@."HFbyt 0,0,0,0,0,0,0,0@."MFbyt 0,0,0,0,0,0,0,0@."RFbyt 0,0,0,0,0,0,0,0@."WFbyt 0,0,0,0,0,0,0,0@.".Fbyt 0,0,0,0,0,0,0,0@V#.Fbyt 0,0,0,0,0,0,0,0@£#.F;@b#.F;--------------------------------@H#.F;the compressed data in 'storage'@.#.F;is decompressed & placed here...@.#.F;--------------------------------@.#.F;@.#.F.text ;@.#.F;@.#.Fbyt 0,0,0,0,0,0,0,0@.#.Fbyt 0,0,0,0,0,0,0,0@T$.Fbyt 0,0,0,0,0,0,0,0@,$.Fbyt 0,0,0,0,0,0,0,0@d$.Fbyt 0,0,0,0,0,0,0,0@£$.Fbyt 0,0,0,0,0,0,0,0@B$.F;@H$.F;@@@
00000000  29 08 0a 00 3b 2a 2a 2a  2a 2a 2a 2a 2a 2a 2a 2a  |)...;***********|
00000010  2a 2a 2a 2a 2a 2a 2a 2a  2a 2a 2a 2a 2a 2a 2a 2a  |****************|
00000020  2a 2a 2a 2a 2a 2a 2a 00  51 08 0f 00 3b 2a 20 20  |*******.Q...;*  |
00000030  20 20 20 20 20 44 41 54  41 20 43 4f 4d 50 52 45  |     DATA COMPRE|
00000040  53 53 49 4f 4e 20 20 20  20 20 20 20 20 20 2a 00  |SSION         *.|
00000050  79 08 14 00 3b 2a 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |y...;*----------|
00000060  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
00000070  2d 2d 2d 2d 2d 2d 2a 00  a1 08 19 00 3b 2a 20 20  |------*.....;*  |
00000080  20 20 20 20 20 20 4e 2e  48 49 47 47 49 4e 53 20  |      N.HIGGINS |
00000090  31 39 38 39 20 20 20 20  20 20 20 20 20 20 2a 00  |1989          *.|
000000a0  c9 08 1e 00 3b 2a 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |....;*----------|
000000b0  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
000000c0  2d 2d 2d 2d 2d 2d 2a 00  f1 08 23 00 3b 2a 20 4d  |------*...#.;* M|
000000d0  45 54 48 4f 44 3a 20 52  55 4e 20 4c 45 4e 47 54  |ETHOD: RUN LENGT|
000000e0  48 20 45 4e 43 4f 44 49  4e 47 20 20 20 20 2a 00  |H ENCODING    *.|
000000f0  19 09 28 00 3b 2a 20 55  53 49 4e 47 20 3a 20 4d  |..(.;* USING : M|
00000100  41 52 4b 45 52 28 43 4f  55 4e 54 2c 43 48 41 52  |ARKER(COUNT,CHAR|
00000110  29 20 20 20 20 20 2a 00  41 09 2d 00 3b 2a 2a 2a  |)     *.A.-.;***|
00000120  2a 2a 2a 2a 2a 2a 2a 2a  2a 2a 2a 2a 2a 2a 2a 2a  |****************|
00000130  2a 2a 2a 2a 2a 2a 2a 2a  2a 2a 2a 2a 2a 2a 2a 00  |***************.|
00000140  69 09 32 00 3b 2a 20 46  49 52 53 54 20 43 41 4c  |i.2.;* FIRST CAL|
00000150  4c 20 54 48 45 20 52 4f  55 54 49 4e 45 53 20 41  |L THE ROUTINES A|
00000160  54 3a 2d 20 20 20 2a 00  91 09 37 00 3b 2a 20 20  |T:-   *...7.;*  |
00000170  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00000180  20 20 20 20 20 20 20 20  20 20 20 20 20 20 2a 00  |              *.|
00000190  b9 09 3c 00 3b 2a 20 20  43 4f 4d 50 52 45 53 53  |..<.;*  COMPRESS|
000001a0  20 2d 20 53 59 53 20 24  43 30 30 30 20 20 20 20  | - SYS $C000    |
000001b0  20 20 20 20 20 20 2a 00  e1 09 41 00 3b 2a 20 20  |      *...A.;*  |
000001c0  44 45 43 4f 4d 50 45 52  20 2d 20 53 59 53 20 24  |DECOMPER - SYS $|
000001d0  43 30 42 38 20 20 20 20  20 20 20 20 20 20 2a 00  |C0B8          *.|
000001e0  09 0a 46 00 3b 2a 20 20  20 20 20 20 20 20 20 20  |..F.;*          |
000001f0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00000200  20 20 20 20 20 20 2a 00  31 0a 4b 00 3b 2a 20 4e  |      *.1.K.;* N|
00000210  4f 57 20 45 4e 54 45 52  20 54 48 45 20 4d 4f 4e  |OW ENTER THE MON|
00000220  49 54 4f 52 20 41 4e 44  20 55 53 45 20 20 2a 00  |ITOR AND USE  *.|
00000230  59 0a 50 00 3b 2a 20 54  48 45 20 43 4f 4d 4d 41  |Y.P.;* THE COMMA|
00000240  4e 44 20 28 4d 43 31 31  30 20 43 31 37 30 29 20  |ND (MC110 C170) |
00000250  54 4f 20 20 20 20 2a 00  81 0a 55 00 3b 2a 20 53  |TO    *...U.;* S|
00000260  45 45 20 54 48 45 20 52  45 53 55 4c 54 53 2e 20  |EE THE RESULTS. |
00000270  20 20 20 20 20 20 20 20  20 20 20 20 20 20 2a 00  |              *.|
00000280  a9 0a 5a 00 3b 2a 2a 2a  2a 2a 2a 2a 2a 2a 2a 2a  |..Z.;***********|
00000290  2a 2a 2a 2a 2a 2a 2a 2a  2a 2a 2a 2a 2a 2a 2a 2a  |****************|
000002a0  2a 2a 2a 2a 2a 2a 2a 00  af 0a 5f 00 3b 00 b5 0a  |*******..._.;...|
000002b0  64 00 3b 00 bb 0a 69 00  3b 00 c1 0a 6e 00 3b 00  |d.;...i.;...n.;.|
000002c0  e7 0a 73 00 3b 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |..s.;-----------|
000002d0  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
000002e0  2d 2d 2d 2d 2d 00 0b 0b  78 00 3b 50 4f 49 4e 54  |-----...x.;POINT|
000002f0  45 52 20 54 4f 20 54 48  45 20 45 4e 44 20 4f 46  |ER TO THE END OF|
00000300  20 54 48 45 20 44 41 54  41 00 22 0b 7d 00 3b 54  | THE DATA.".}.;T|
00000310  4f 20 42 45 20 43 4f 4d  50 52 45 53 53 45 44 2e  |O BE COMPRESSED.|
00000320  00 48 0b 82 00 3b 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |.H...;----------|
00000330  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
00000340  2d 2d 2d 2d 2d 2d 00 4e  0b 87 00 3b 00 60 0b 8c  |------.N...;.`..|
00000350  00 54 45 58 54 80 b2 54  45 58 54 aa 31 36 00 66  |.TEXT..TEXT.16.f|
00000360  0b 91 00 3b 00 75 0b 96  00 4d 41 52 4b 45 52 b2  |...;.u...MARKER.|
00000370  24 45 46 00 84 0b 9b 00  44 41 54 50 4e 54 b2 24  |$EF.....DATPNT.$|
00000380  46 42 00 90 0b a0 00 90  4e 54 b2 24 46 44 00 96  |FB......NT.$FD..|
00000390  0b a5 00 3b 00 9c 0b aa  00 3b 00 a8 0b af 00 ac  |...;.....;......|
000003a0  b2 34 39 31 35 32 00 ae  0b b4 00 3b 00 b4 0b b9  |.49152.....;....|
000003b0  00 3b 00 da 0b be 00 3b  2d 2d 2d 2d 2d 2d 2d 2d  |.;.....;--------|
000003c0  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
000003d0  2d 2d 2d 2d 2d 2d 2d 2d  00 f9 0b c3 00 3b 53 45  |--------.....;SE|
000003e0  54 20 50 4f 49 4e 54 45  52 20 54 4f 20 44 41 54  |T POINTER TO DAT|
000003f0  41 20 54 4f 20 42 45 00  10 0c c8 00 3b 43 4f 4d  |A TO BE.....;COM|
00000400  50 52 45 53 53 45 44 20  28 54 45 58 54 29 00 2e  |PRESSED (TEXT)..|
00000410  0c cd 00 3b 53 45 54 20  50 4f 49 4e 54 45 52 20  |...;SET POINTER |
00000420  54 4f 20 53 54 4f 52 45  20 54 48 45 00 4d 0c d2  |TO STORE THE.M..|
00000430  00 3b 43 4f 4d 50 52 45  53 53 45 44 20 44 41 54  |.;COMPRESSED DAT|
00000440  41 20 28 53 54 4f 52 41  47 45 29 00 73 0c d7 00  |A (STORAGE).s...|
00000450  3b 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |;---------------|
00000460  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
00000470  2d 00 79 0c dc 00 3b 00  91 0c e1 00 43 4f 4d 50  |-.y...;.....COMP|
00000480  52 45 53 53 20 4c 44 41  20 23 b3 54 45 58 54 00  |RESS LDA #.TEXT.|
00000490  a0 0c e6 00 53 54 41 20  44 41 54 50 4e 54 00 af  |....STA DATPNT..|
000004a0  0c eb 00 4c 44 41 20 23  b1 54 45 58 54 00 c0 0c  |...LDA #.TEXT...|
000004b0  f0 00 53 54 41 20 44 41  54 50 4e 54 aa 31 00 d1  |..STA DATPNT.1..|
000004c0  0c f5 00 4c 44 41 20 23  b3 53 a4 52 41 47 45 00  |...LDA #.S.RAGE.|
000004d0  dd 0c fa 00 53 54 41 20  90 4e 54 00 ee 0c ff 00  |....STA .NT.....|
000004e0  4c 44 41 20 23 b1 53 a4  52 41 47 45 00 fc 0c 04  |LDA #.S.RAGE....|
000004f0  01 53 54 41 20 90 4e 54  aa 31 00 02 0d 09 01 3b  |.STA .NT.1.....;|
00000500  00 08 0d 0e 01 3b 00 2f  0d 13 01 3b 2d 2d 2d 2d  |.....;./...;----|
00000510  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
00000520  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 00 4a 0d  |-------------.J.|
00000530  18 01 3b 53 45 54 20 28  45 4e 44 46 4c 41 47 29  |..;SET (ENDFLAG)|
00000540  20 54 4f 20 5a 45 52 4f  00 60 0d 1d 01 3b 53 45  | TO ZERO.`...;SE|
00000550  54 20 28 43 4f 55 4e 54  29 20 54 4f 20 31 00 7c  |T (COUNT) TO 1.||
00000560  0d 22 01 3b 47 45 54 20  42 59 54 45 2f 49 53 20  |.".;GET BYTE/IS |
00000570  43 41 52 52 59 20 53 45  54 3f 00 8e 0d 27 01 3b  |CARRY SET?...'.;|
00000580  59 45 53 3a 47 4f 54 4f  20 5b 45 5d 00 9e 0d 2c  |YES:GOTO [E]...,|
00000590  01 3b 53 54 4f 52 45 20  42 59 54 45 00 c3 0d 31  |.;STORE BYTE...1|
000005a0  01 3b 5b 41 5d 20 47 45  54 20 4e 45 58 54 20 42  |.;[A] GET NEXT B|
000005b0  59 54 45 2f 49 53 20 43  41 52 52 59 20 53 45 54  |YTE/IS CARRY SET|
000005c0  3f 00 d5 0d 36 01 3b 59  45 53 3a 47 4f 54 4f 20  |?...6.;YES:GOTO |
000005d0  5b 45 5d 00 f4 0d 3b 01  3b 49 53 20 42 59 54 45  |[E]...;.;IS BYTE|
000005e0  20 53 41 4d 45 20 41 53  20 50 52 45 56 49 4f 55  | SAME AS PREVIOU|
000005f0  53 3f 00 06 0e 40 01 3b  4e 4f 20 3a 47 4f 54 4f  |S?...@.;NO :GOTO|
00000600  20 5b 43 5d 00 21 0e 45  01 3b 59 45 53 3a 49 4e  | [C].!.E.;YES:IN|
00000610  43 52 45 4d 45 4e 54 20  28 43 4f 55 4e 54 29 00  |CREMENT (COUNT).|
00000620  34 0e 4a 01 3b 49 53 20  28 43 4f 55 4e 54 29 20  |4.J.;IS (COUNT) |
00000630  3d 30 00 55 0e 4f 01 3b  59 45 53 3a 4f 55 54 50  |=0.U.O.;YES:OUTP|
00000640  55 54 20 4d 41 52 4b 45  52 28 24 46 46 2c 43 48  |UT MARKER($FF,CH|
00000650  41 52 29 00 71 0e 54 01  3b 53 45 54 20 28 43 4f  |AR).q.T.;SET (CO|
00000660  55 4e 54 29 3d 31 2f 47  4f 54 4f 20 5b 41 5d 00  |UNT)=1/GOTO [A].|
00000670  83 0e 59 01 3b 4e 4f 20  3a 47 4f 54 4f 20 5b 41  |..Y.;NO :GOTO [A|
00000680  5d 00 aa 0e 5e 01 3b 2d  2d 2d 2d 2d 2d 2d 2d 2d  |]...^.;---------|
00000690  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
000006a0  2d 2d 2d 2d 2d 2d 2d 2d  00 b0 0e 63 01 3b 00 bb  |--------...c.;..|
000006b0  0e 68 01 4c 44 59 20 23  30 00 c9 0e 6d 01 53 54  |.h.LDY #0...m.ST|
000006c0  59 20 80 46 4c 41 47 00  d4 0e 72 01 4c 44 41 20  |Y .FLAG...r.LDA |
000006d0  23 31 00 e2 0e 77 01 53  54 41 20 43 4f 55 4e 54  |#1...w.STA COUNT|
000006e0  00 f0 0e 7c 01 4a 53 52  20 a1 42 59 54 45 00 ff  |...|.JSR .BYTE..|
000006f0  0e 81 01 42 43 53 20 46  49 4e 49 53 48 00 11 0f  |...BCS FINISH...|
00000700  86 01 53 54 41 20 43 48  41 52 41 43 54 45 52 00  |..STA CHARACTER.|
00000710  17 0f 8b 01 3b 00 2b 0f  90 01 41 47 41 49 4e 20  |....;.+...AGAIN |
00000720  4a 53 52 20 a1 42 59 54  45 00 38 0f 95 01 42 43  |JSR .BYTE.8...BC|
00000730  53 20 4c 4f 4f 50 00 4a  0f 9a 01 43 4d 50 20 43  |S LOOP.J...CMP C|
00000740  48 41 52 41 43 54 45 52  00 58 0f 9f 01 42 4e 45  |HARACTER.X...BNE|
00000750  20 4c 4f 4f 50 32 00 6c  0f a4 01 9a 49 4e 55 45  | LOOP2.l....INUE|
00000760  20 49 4e 43 20 43 4f 55  4e 54 00 7a 0f a9 01 42  | INC COUNT.z...B|
00000770  4e 45 20 41 47 41 49 4e  00 8a 0f ae 01 4c 44 41  |NE AGAIN.....LDA|
00000780  20 23 4d 41 52 4b 45 52  00 9a 0f b3 01 4a 53 52  | #MARKER.....JSR|
00000790  20 50 55 54 42 59 54 45  00 a7 0f b8 01 4c 44 41  | PUTBYTE.....LDA|
000007a0  20 23 24 46 46 00 b7 0f  bd 01 4a 53 52 20 50 55  | #$FF.....JSR PU|
000007b0  54 42 59 54 45 00 c9 0f  c2 01 4c 44 41 20 43 48  |TBYTE.....LDA CH|
000007c0  41 52 41 43 54 45 52 00  d9 0f c7 01 4a 53 52 20  |ARACTER.....JSR |
000007d0  50 55 54 42 59 54 45 00  e7 0f cc 01 4a 4d 50 20  |PUTBYTE.....JMP |
000007e0  9a 49 4e 55 45 00 ed 0f  d1 01 3b 00 f3 0f d6 01  |.INUE.....;.....|
000007f0  3b 00 19 10 db 01 3b 2d  2d 2d 2d 2d 2d 2d 2d 2d  |;.....;---------|
00000800  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
00000810  2d 2d 2d 2d 2d 2d 2d 00  2d 10 e0 01 3b 5b 43 5d  |-------.-...;[C]|
00000820  20 53 54 4f 52 45 20 42  59 54 45 00 54 10 e5 01  | STORE BYTE.T...|
00000830  3b 47 45 54 20 50 52 45  56 49 4f 55 53 20 42 59  |;GET PREVIOUS BY|
00000840  54 45 2f 49 53 20 49 54  20 41 20 4d 41 52 4b 45  |TE/IS IT A MARKE|
00000850  52 3f 00 66 10 ea 01 3b  59 45 53 3a 47 4f 54 4f  |R?.f...;YES:GOTO|
00000860  20 5b 46 5d 00 7d 10 ef  01 3b 4e 4f 20 3a 49 53  | [F].}...;NO :IS|
00000870  20 28 43 4f 55 4e 54 29  20 3c 34 00 8f 10 f4 01  | (COUNT) <4.....|
00000880  3b 59 45 53 3a 47 4f 54  4f 20 5b 47 5d 00 a1 10  |;YES:GOTO [G]...|
00000890  f9 01 3b 4e 4f 20 3a 47  4f 54 4f 20 5b 46 5d 00  |..;NO :GOTO [F].|
000008a0  c7 10 fe 01 3b 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |....;-----------|
000008b0  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
000008c0  2d 2d 2d 2d 2d 00 cd 10  03 02 3b 00 e0 10 08 02  |-----.....;.....|
000008d0  4c 4f 4f 50 32 20 53 54  41 20 53 a4 52 45 00 f7  |LOOP2 STA S.RE..|
000008e0  10 0d 02 4c 4f 4f 50 20  4c 44 41 20 43 48 41 52  |...LOOP LDA CHAR|
000008f0  41 43 54 45 52 00 07 11  12 02 43 4d 50 20 23 4d  |ACTER.....CMP #M|
00000900  41 52 4b 45 52 00 15 11  17 02 42 45 51 20 4c 4f  |ARKER.....BEQ LO|
00000910  4f 50 39 00 23 11 1c 02  4c 44 41 20 43 4f 55 4e  |OP9.#...LDA COUN|
00000920  54 00 2e 11 21 02 43 4d  50 20 23 34 00 3c 11 26  |T...!.CMP #4.<.&|
00000930  02 42 43 43 20 4c 4f 4f  50 35 00 42 11 2b 02 3b  |.BCC LOOP5.B.+.;|
00000940  00 48 11 30 02 3b 00 6e  11 35 02 3b 2d 2d 2d 2d  |.H.0.;.n.5.;----|
00000950  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
00000960  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 00 91 11 3a  |------------...:|
00000970  02 3b 5b 46 5d 20 4f 55  54 50 55 54 20 4d 41 52  |.;[F] OUTPUT MAR|
00000980  4b 45 52 28 43 4f 55 4e  54 2c 43 48 41 52 29 00  |KER(COUNT,CHAR).|
00000990  b7 11 3f 02 3b 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |..?.;-----------|
000009a0  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
000009b0  2d 2d 2d 2d 2d 00 bd 11  44 02 3b 00 d3 11 49 02  |-----...D.;...I.|
000009c0  4c 4f 4f 50 39 20 4c 44  41 20 23 4d 41 52 4b 45  |LOOP9 LDA #MARKE|
000009d0  52 00 e3 11 4e 02 4a 53  52 20 50 55 54 42 59 54  |R...N.JSR PUTBYT|
000009e0  45 00 f1 11 53 02 4c 44  41 20 43 4f 55 4e 54 00  |E...S.LDA COUNT.|
000009f0  01 12 58 02 4a 53 52 20  50 55 54 42 59 54 45 00  |..X.JSR PUTBYTE.|
00000a00  13 12 5d 02 4c 44 41 20  43 48 41 52 41 43 54 45  |..].LDA CHARACTE|
00000a10  52 00 23 12 62 02 4a 53  52 20 50 55 54 42 59 54  |R.#.b.JSR PUTBYT|
00000a20  45 00 29 12 67 02 3b 00  2f 12 6c 02 3b 00 55 12  |E.).g.;./.l.;.U.|
00000a30  71 02 3b 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |q.;-------------|
00000a40  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
00000a50  2d 2d 2d 00 74 12 76 02  3b 5b 44 5d 20 43 48 45  |---.t.v.;[D] CHE|
00000a60  43 4b 20 46 4c 41 47 2f  49 53 20 49 54 20 53 45  |CK FLAG/IS IT SE|
00000a70  54 3f 00 86 12 7b 02 3b  59 45 53 3a 47 4f 54 4f  |T?...{.;YES:GOTO|
00000a80  20 5b 45 5d 00 9f 12 80  02 3b 4e 4f 20 3a 47 45  | [E].....;NO :GE|
00000a90  54 20 53 54 4f 52 45 44  20 42 59 54 45 00 be 12  |T STORED BYTE...|
00000aa0  85 02 3b 53 45 54 20 28  43 4f 55 4e 54 29 20 54  |..;SET (COUNT) T|
00000ab0  4f 20 31 2f 47 4f 54 4f  20 5b 41 5d 00 e4 12 8a  |O 1/GOTO [A]....|
00000ac0  02 3b 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |.;--------------|
00000ad0  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
00000ae0  2d 2d 00 ea 12 8f 02 3b  00 fe 12 94 02 4c 4f 4f  |--.....;.....LOO|
00000af0  50 36 20 4c 44 41 20 80  46 4c 41 47 00 0d 13 99  |P6 LDA .FLAG....|
00000b00  02 42 4d 49 20 46 49 4e  49 53 48 00 1a 13 9e 02  |.BMI FINISH.....|
00000b10  4c 44 41 20 53 a4 52 45  00 2c 13 a3 02 53 54 41  |LDA S.RE.,...STA|
00000b20  20 43 48 41 52 41 43 54  45 52 00 37 13 a8 02 4c  | CHARACTER.7...L|
00000b30  44 41 20 23 31 00 45 13  ad 02 53 54 41 20 43 4f  |DA #1.E...STA CO|
00000b40  55 4e 54 00 53 13 b2 02  4a 4d 50 20 41 47 41 49  |UNT.S...JMP AGAI|
00000b50  4e 00 59 13 b7 02 3b 00  5f 13 bc 02 3b 00 85 13  |N.Y...;._...;...|
00000b60  c1 02 3b 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |..;-------------|
00000b70  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
00000b80  2d 2d 2d 00 9a 13 c6 02  3b 5b 47 5d 20 4f 55 54  |---.....;[G] OUT|
00000b90  50 55 54 20 43 48 41 52  00 b1 13 cb 02 3b 44 45  |PUT CHAR.....;DE|
00000ba0  43 52 45 4d 45 4e 54 20  28 43 4f 55 4e 54 29 00  |CREMENT (COUNT).|
00000bb0  c3 13 d0 02 3b 49 53 20  28 43 4f 55 4e 54 29 3d  |....;IS (COUNT)=|
00000bc0  30 00 d5 13 d5 02 3b 59  45 53 3a 47 4f 54 4f 20  |0.....;YES:GOTO |
00000bd0  5b 44 5d 00 e7 13 da 02  3b 4e 4f 20 3a 47 4f 54  |[D].....;NO :GOT|
00000be0  4f 20 5b 47 5d 00 0d 14  df 02 3b 2d 2d 2d 2d 2d  |O [G].....;-----|
00000bf0  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
00000c00  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 00 13 14 e4 02  |-----------.....|
00000c10  3b 00 2b 14 e9 02 4c 4f  4f 50 35 20 4c 44 41 20  |;.+...LOOP5 LDA |
00000c20  43 48 41 52 41 43 54 45  52 00 3b 14 ee 02 4a 53  |CHARACTER.;...JS|
00000c30  52 20 50 55 54 42 59 54  45 00 49 14 f3 02 44 45  |R PUTBYTE.I...DE|
00000c40  43 20 43 4f 55 4e 54 00  57 14 f8 02 42 45 51 20  |C COUNT.W...BEQ |
00000c50  4c 4f 4f 50 36 00 65 14  fd 02 4a 4d 50 20 4c 4f  |LOOP6.e...JMP LO|
00000c60  4f 50 35 00 6b 14 02 03  3b 00 71 14 07 03 3b 00  |OP5.k...;.q...;.|
00000c70  97 14 0c 03 3b 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |....;-----------|
00000c80  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
00000c90  2d 2d 2d 2d 2d 00 bb 14  11 03 3b 5b 45 5d 20 57  |-----.....;[E] W|
00000ca0  48 45 4e 20 46 49 4e 49  53 48 45 44 20 57 45 20  |HEN FINISHED WE |
00000cb0  53 54 4f 52 45 20 54 48  45 00 df 14 16 03 3b 45  |STORE THE.....;E|
00000cc0  4e 44 20 41 44 44 52 45  53 53 2b 31 20 4f 46 20  |ND ADDRESS+1 OF |
00000cd0  54 48 45 20 43 4f 4d 50  41 43 54 45 44 00 05 15  |THE COMPACTED...|
00000ce0  1b 03 3b 44 41 54 41 20  46 4f 52 20 54 48 45 20  |..;DATA FOR THE |
00000cf0  44 45 43 4f 4d 50 52 45  53 53 20 52 4f 55 54 49  |DECOMPRESS ROUTI|
00000d00  4e 45 2e 00 2b 15 20 03  3b 2d 2d 2d 2d 2d 2d 2d  |NE..+. .;-------|
00000d10  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
00000d20  2d 2d 2d 2d 2d 2d 2d 2d  2d 00 31 15 25 03 3b 00  |---------.1.%.;.|
00000d30  44 15 2a 03 46 49 4e 49  53 48 20 4c 44 41 20 90  |D.*.FINISH LDA .|
00000d40  4e 54 00 52 15 2f 03 53  54 41 20 43 4f 4d 50 80  |NT.R./.STA COMP.|
00000d50  00 60 15 34 03 4c 44 41  20 90 4e 54 aa 31 00 70  |.`.4.LDA .NT.1.p|
00000d60  15 39 03 53 54 41 20 43  4f 4d 50 80 aa 31 00 78  |.9.STA COMP..1.x|
00000d70  15 3e 03 52 54 53 00 7e  15 43 03 3b 00 84 15 48  |.>.RTS.~.C.;...H|
00000d80  03 3b 00 aa 15 4d 03 3b  2d 2d 2d 2d 2d 2d 2d 2d  |.;...M.;--------|
00000d90  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
00000da0  2d 2d 2d 2d 2d 2d 2d 2d  00 d0 15 52 03 3b 43 48  |--------...R.;CH|
00000db0  45 43 4b 20 49 46 20 52  45 41 43 48 45 44 20 54  |ECK IF REACHED T|
00000dc0  48 45 20 45 4e 44 20 4f  46 20 44 41 54 41 00 f8  |HE END OF DATA..|
00000dd0  15 57 03 3b 4e 4f 20 3a  47 45 54 20 4e 45 58 54  |.W.;NO :GET NEXT|
00000de0  20 42 59 54 45 2f 43 4c  52 20 43 41 52 52 59 2f  | BYTE/CLR CARRY/|
00000df0  52 45 54 55 52 4e 00 20  16 5c 03 3b 59 45 53 3a  |RETURN. .\.;YES:|
00000e00  53 45 54 20 28 45 4e 44  46 4c 41 47 29 2f 53 45  |SET (ENDFLAG)/SE|
00000e10  54 20 43 41 52 52 59 2f  52 45 54 55 52 4e 00 46  |T CARRY/RETURN.F|
00000e20  16 61 03 3b 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |.a.;------------|
00000e30  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
00000e40  2d 2d 2d 2d 00 4c 16 66  03 3b 00 61 16 6b 03 a1  |----.L.f.;.a.k..|
00000e50  42 59 54 45 20 4c 44 41  20 44 41 54 50 4e 54 00  |BYTE LDA DATPNT.|
00000e60  71 16 70 03 43 4d 50 20  23 b3 54 45 58 54 80 00  |q.p.CMP #.TEXT..|
00000e70  80 16 75 03 42 4e 45 20  4c 4f 4f 50 31 32 00 91  |..u.BNE LOOP12..|
00000e80  16 7a 03 4c 44 41 20 44  41 54 50 4e 54 aa 31 00  |.z.LDA DATPNT.1.|
00000e90  a1 16 7f 03 43 4d 50 20  23 b1 54 45 58 54 80 00  |....CMP #.TEXT..|
00000ea0  b0 16 84 03 42 4e 45 20  4c 4f 4f 50 31 32 00 bd  |....BNE LOOP12..|
00000eb0  16 89 03 4c 44 41 20 23  24 46 46 00 cb 16 8e 03  |...LDA #$FF.....|
00000ec0  53 54 41 20 80 46 4c 41  47 00 d3 16 93 03 53 45  |STA .FLAG.....SE|
00000ed0  43 00 db 16 98 03 52 54  53 00 e1 16 9d 03 3b 00  |C.....RTS.....;.|
00000ee0  fb 16 a2 03 4c 4f 4f 50  31 32 20 4c 44 41 20 28  |....LOOP12 LDA (|
00000ef0  44 41 54 50 4e 54 29 2c  59 00 0a 17 a7 03 49 4e  |DATPNT),Y.....IN|
00000f00  43 20 44 41 54 50 4e 54  00 19 17 ac 03 42 4e 45  |C DATPNT.....BNE|
00000f10  20 4c 4f 4f 50 31 34 00  2a 17 b1 03 49 4e 43 20  | LOOP14.*...INC |
00000f20  44 41 54 50 4e 54 aa 31  00 39 17 b6 03 4c 4f 4f  |DATPNT.1.9...LOO|
00000f30  50 31 34 20 43 4c 43 00  41 17 bb 03 52 54 53 00  |P14 CLC.A...RTS.|
00000f40  47 17 c0 03 3b 00 4d 17  c5 03 3b 00 74 17 ca 03  |G...;.M...;.t...|
00000f50  3b 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |;---------------|
00000f60  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
00000f70  2d 2d 00 85 17 cf 03 3b  4f 55 54 50 55 54 20 42  |--.....;OUTPUT B|
00000f80  59 54 45 00 ac 17 d4 03  3b 2d 2d 2d 2d 2d 2d 2d  |YTE.....;-------|
00000f90  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
00000fa0  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 00 b2 17 d9 03 3b  |----------.....;|
00000fb0  00 ca 17 de 03 50 55 54  42 59 54 45 20 53 54 41  |.....PUTBYTE STA|
00000fc0  20 28 90 4e 54 29 2c 59  00 d6 17 e3 03 49 4e 43  | (.NT),Y.....INC|
00000fd0  20 90 4e 54 00 e5 17 e8  03 42 4e 45 20 4c 4f 4f  | .NT.....BNE LOO|
00000fe0  50 31 35 00 f3 17 ed 03  49 4e 43 20 90 4e 54 aa  |P15.....INC .NT.|
00000ff0  31 00 02 18 f2 03 4c 4f  4f 50 31 35 20 52 54 53  |1.....LOOP15 RTS|
00001000  00 08 18 f7 03 3b 00 0e  18 fc 03 3b 00 14 18 01  |.....;.....;....|
00001010  04 3b 00 3b 18 06 04 3b  2a 2a 2a 2a 2a 2a 2a 2a  |.;.;...;********|
00001020  2a 2a 2a 2a 2a 2a 2a 2a  2a 2a 2a 2a 2a 2a 2a 2a  |****************|
00001030  2a 2a 2a 2a 2a 2a 2a 2a  2a 00 62 18 0b 04 3b 2a  |*********.b...;*|
00001040  20 20 20 20 20 44 45 43  4f 4d 50 52 45 53 53 20  |     DECOMPRESS |
00001050  52 4f 55 54 49 4e 45 20  20 20 20 20 20 20 20 2a  |ROUTINE        *|
00001060  00 89 18 10 04 3b 2a 2a  2a 2a 2a 2a 2a 2a 2a 2a  |.....;**********|
00001070  2a 2a 2a 2a 2a 2a 2a 2a  2a 2a 2a 2a 2a 2a 2a 2a  |****************|
00001080  2a 2a 2a 2a 2a 2a 2a 00  b0 18 15 04 3b 2a 20 54  |*******.....;* T|
00001090  48 49 53 20 4d 55 53 54  20 42 45 20 43 41 4c 4c  |HIS MUST BE CALL|
000010a0  45 44 20 41 46 54 45 52  20 54 48 45 20 2a 00 d7  |ED AFTER THE *..|
000010b0  18 1a 04 3b 2a 20 43 4f  4d 50 52 45 53 53 49 4f  |...;* COMPRESSIO|
000010c0  4e 20 52 4f 55 54 49 4e  45 2c 49 54 20 57 49 4c  |N ROUTINE,IT WIL|
000010d0  4c 20 20 20 2a 00 fe 18  1f 04 3b 2a 20 52 45 53  |L   *.....;* RES|
000010e0  54 4f 52 45 20 54 48 45  20 43 4f 4d 50 52 45 53  |TORE THE COMPRES|
000010f0  53 45 44 20 44 41 54 41  20 20 20 2a 00 25 19 24  |SED DATA   *.%.$|
00001100  04 3b 2a 20 41 54 20 27  53 54 4f 52 41 47 45 27  |.;* AT 'STORAGE'|
00001110  20 42 41 43 4b 20 54 4f  20 49 54 53 20 20 20 20  | BACK TO ITS    |
00001120  20 20 2a 00 4c 19 29 04  3b 2a 20 4f 52 49 47 49  |  *.L.).;* ORIGI|
00001130  4e 41 4c 20 56 41 4c 55  45 53 20 41 4e 44 20 50  |NAL VALUES AND P|
00001140  4c 41 43 45 20 49 54 20  20 2a 00 73 19 2e 04 3b  |LACE IT  *.s...;|
00001150  2a 20 41 54 20 27 4e 45  57 54 45 58 54 27 2e 20  |* AT 'NEWTEXT'. |
00001160  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00001170  2a 00 9a 19 33 04 3b 2a  2a 2a 2a 2a 2a 2a 2a 2a  |*...3.;*********|
00001180  2a 2a 2a 2a 2a 2a 2a 2a  2a 2a 2a 2a 2a 2a 2a 2a  |****************|
00001190  2a 2a 2a 2a 2a 2a 2a 2a  00 c1 19 38 04 3b 2a 20  |********...8.;* |
000011a0  59 4f 55 20 43 41 4e 20  54 48 45 4e 20 43 4f 4d  |YOU CAN THEN COM|
000011b0  50 41 52 45 20 42 4f 54  48 20 20 20 20 20 2a 00  |PARE BOTH     *.|
000011c0  e8 19 3d 04 3b 2a 20 27  54 45 58 54 27 20 26 20  |..=.;* 'TEXT' & |
000011d0  27 4e 45 57 54 45 58 54  27 20 54 4f 20 53 45 45  |'NEWTEXT' TO SEE|
000011e0  20 20 20 20 20 2a 00 0f  1a 42 04 3b 2a 20 54 48  |     *...B.;* TH|
000011f0  41 54 20 54 48 45 59 20  4d 41 54 43 48 2e 20 20  |AT THEY MATCH.  |
00001200  20 20 20 20 20 20 20 20  20 20 20 20 2a 00 36 1a  |            *.6.|
00001210  47 04 3b 2a 2a 2a 2a 2a  2a 2a 2a 2a 2a 2a 2a 2a  |G.;*************|
00001220  2a 2a 2a 2a 2a 2a 2a 2a  2a 2a 2a 2a 2a 2a 2a 2a  |****************|
00001230  2a 2a 2a 2a 00 3c 1a 4c  04 3b 00 42 1a 51 04 3b  |****.<.L.;.B.Q.;|
00001240  00 67 1a 56 04 3b 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |.g.V.;----------|
00001250  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
00001260  2d 2d 2d 2d 2d 00 85 1a  5b 04 3b 53 45 54 20 50  |-----...[.;SET P|
00001270  4f 49 4e 54 45 52 53 20  54 4f 20 53 54 41 52 54  |OINTERS TO START|
00001280  20 4f 46 00 a6 1a 60 04  3b 43 4f 4d 50 52 45 53  | OF...`.;COMPRES|
00001290  53 45 44 20 44 41 54 41  20 28 53 54 4f 52 41 47  |SED DATA (STORAG|
000012a0  45 29 20 26 00 c7 1a 65  04 3b 44 45 43 4f 4d 50  |E) &...e.;DECOMP|
000012b0  52 45 53 53 45 44 20 44  41 54 41 20 28 4e 45 57  |RESSED DATA (NEW|
000012c0  54 45 58 54 29 00 ec 1a  6a 04 3b 2d 2d 2d 2d 2d  |TEXT)...j.;-----|
000012d0  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
000012e0  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 00 f2 1a 6f 04 3b  |----------...o.;|
000012f0  00 0c 1b 74 04 44 45 43  4f 4d 50 45 52 20 4c 44  |...t.DECOMPER LD|
00001300  41 20 23 b3 53 a4 52 41  47 45 00 1b 1b 79 04 53  |A #.S.RAGE...y.S|
00001310  54 41 20 44 41 54 50 4e  54 00 2c 1b 7e 04 4c 44  |TA DATPNT.,.~.LD|
00001320  41 20 23 b1 53 a4 52 41  47 45 00 3d 1b 83 04 53  |A #.S.RAGE.=...S|
00001330  54 41 20 44 41 54 50 4e  54 aa 31 00 4d 1b 88 04  |TA DATPNT.1.M...|
00001340  4c 44 41 20 23 b3 a2 54  45 58 54 00 59 1b 8d 04  |LDA #..TEXT.Y...|
00001350  53 54 41 20 90 4e 54 00  69 1b 92 04 4c 44 41 20  |STA .NT.i...LDA |
00001360  23 b1 a2 54 45 58 54 00  77 1b 97 04 53 54 41 20  |#..TEXT.w...STA |
00001370  90 4e 54 aa 31 00 7d 1b  9c 04 3b 00 a2 1b a1 04  |.NT.1.}...;.....|
00001380  3b 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |;---------------|
00001390  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
000013a0  00 bb 1b a6 04 3b 47 45  54 20 43 4f 4d 50 52 45  |.....;GET COMPRE|
000013b0  53 53 45 44 20 44 41 54  41 00 d0 1b ab 04 3b 49  |SSED DATA.....;I|
000013c0  53 20 49 54 20 41 20 4d  41 52 4b 45 52 3f 00 f6  |S IT A MARKER?..|
000013d0  1b b0 04 3b 4e 4f 3a 4f  55 54 50 55 54 20 49 54  |...;NO:OUTPUT IT|
000013e0  2f 49 4e 43 52 45 4d 45  4e 54 20 28 4e 45 57 54  |/INCREMENT (NEWT|
000013f0  45 58 54 29 00 17 1c b5  04 3b 49 4e 43 52 45 4d  |EXT).....;INCREM|
00001400  45 4e 54 20 50 4f 49 4e  54 45 52 20 28 53 54 4f  |ENT POINTER (STO|
00001410  52 41 47 45 29 00 34 1c  ba 04 3b 49 53 20 49 54  |RAGE).4...;IS IT|
00001420  20 45 4e 44 20 4f 46 20  43 4f 4d 50 2e 44 41 54  | END OF COMP.DAT|
00001430  41 3f 00 52 1c bf 04 3b  4e 4f 3a 47 4f 20 42 41  |A?.R...;NO:GO BA|
00001440  43 4b 20 47 45 54 20 4e  45 58 54 20 42 59 54 45  |CK GET NEXT BYTE|
00001450  00 60 1c c4 04 3b 59 45  53 3a 45 58 49 54 00 85  |.`...;YES:EXIT..|
00001460  1c c9 04 3b 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |...;------------|
00001470  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
00001480  2d 2d 2d 00 8b 1c ce 04  3b 00 96 1c d3 04 4c 44  |---.....;.....LD|
00001490  59 20 23 30 00 b0 1c d8  04 52 45 4c 4f 4f 50 20  |Y #0.....RELOOP |
000014a0  4c 44 41 20 28 44 41 54  50 4e 54 29 2c 59 00 c0  |LDA (DATPNT),Y..|
000014b0  1c dd 04 43 4d 50 20 23  4d 41 52 4b 45 52 00 cf  |...CMP #MARKER..|
000014c0  1c e2 04 42 45 51 20 4c  4f 4f 50 34 30 00 df 1c  |...BEQ LOOP40...|
000014d0  e7 04 53 54 41 20 28 90  4e 54 29 2c 59 00 ec 1c  |..STA (.NT),Y...|
000014e0  ec 04 4a 53 52 20 50 4e  54 31 00 00 1d f1 04 4c  |..JSR PNT1.....L|
000014f0  4f 4f 50 35 30 20 4a 53  52 20 50 4e 54 32 00 0f  |OOP50 JSR PNT2..|
00001500  1d f6 04 4c 44 41 20 44  41 54 50 4e 54 00 1d 1d  |...LDA DATPNT...|
00001510  fb 04 43 4d 50 20 43 4f  4d 50 80 00 2c 1d 00 05  |..CMP COMP..,...|
00001520  42 4e 45 20 52 45 4c 4f  4f 50 00 3d 1d 05 05 4c  |BNE RELOOP.=...L|
00001530  44 41 20 44 41 54 50 4e  54 aa 31 00 4d 1d 0a 05  |DA DATPNT.1.M...|
00001540  43 4d 50 20 43 4f 4d 50  80 aa 31 00 5c 1d 0f 05  |CMP COMP..1.\...|
00001550  42 4e 45 20 52 45 4c 4f  4f 50 00 64 1d 14 05 52  |BNE RELOOP.d...R|
00001560  54 53 00 6a 1d 19 05 3b  00 8f 1d 1e 05 3b 2d 2d  |TS.j...;.....;--|
00001570  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
00001580  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 00 ae 1d  |-------------...|
00001590  23 05 3b 49 46 20 41 20  4d 41 52 4b 45 52 20 49  |#.;IF A MARKER I|
000015a0  53 20 46 4f 55 4e 44 20  54 48 45 4e 00 c4 1d 28  |S FOUND THEN...(|
000015b0  05 3b 50 55 54 20 28 43  4f 55 4e 54 29 20 49 4e  |.;PUT (COUNT) IN|
000015c0  20 58 00 d9 1d 2d 05 3b  50 55 54 20 28 43 48 41  | X...-.;PUT (CHA|
000015d0  52 29 20 49 4e 20 41 00  f6 1d 32 05 3b 4f 55 54  |R) IN A...2.;OUT|
000015e0  50 55 54 20 28 43 48 41  52 29 20 55 4e 54 49 4c  |PUT (CHAR) UNTIL|
000015f0  20 58 3d 30 00 1b 1e 37  05 3b 2d 2d 2d 2d 2d 2d  | X=0...7.;------|
00001600  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
00001610  2d 2d 2d 2d 2d 2d 2d 2d  2d 00 21 1e 3c 05 3b 00  |---------.!.<.;.|
00001620  35 1e 41 05 4c 4f 4f 50  34 30 20 4a 53 52 20 50  |5.A.LOOP40 JSR P|
00001630  4e 54 32 00 48 1e 46 05  4c 44 41 20 28 44 41 54  |NT2.H.F.LDA (DAT|
00001640  50 4e 54 29 2c 59 00 50  1e 4b 05 54 41 58 00 5d  |PNT),Y.P.K.TAX.]|
00001650  1e 50 05 4a 53 52 20 50  4e 54 32 00 70 1e 55 05  |.P.JSR PNT2.p.U.|
00001660  4c 44 41 20 28 44 41 54  50 4e 54 29 2c 59 00 87  |LDA (DATPNT),Y..|
00001670  1e 5a 05 4c 4f 4f 50 34  32 20 53 54 41 20 28 90  |.Z.LOOP42 STA (.|
00001680  4e 54 29 2c 59 00 94 1e  5f 05 4a 53 52 20 50 4e  |NT),Y..._.JSR PN|
00001690  54 31 00 9c 1e 64 05 44  45 58 00 ab 1e 69 05 42  |T1...d.DEX...i.B|
000016a0  4e 45 20 4c 4f 4f 50 34  32 00 ba 1e 6e 05 42 45  |NE LOOP42...n.BE|
000016b0  51 20 4c 4f 4f 50 35 30  00 c0 1e 73 05 3b 00 c6  |Q LOOP50...s.;..|
000016c0  1e 78 05 3b 00 e9 1e 7d  05 3b 2d 2d 2d 2d 2d 2d  |.x.;...}.;------|
000016d0  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
000016e0  2d 2d 2d 2d 2d 2d 2d 00  01 1f 82 05 3b 49 4e 43  |-------.....;INC|
000016f0  52 45 4d 45 4e 54 20 50  4f 49 4e 54 45 52 53 00  |REMENT POINTERS.|
00001700  24 1f 87 05 3b 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |$...;-----------|
00001710  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
00001720  2d 2d 00 2a 1f 8c 05 3b  00 3b 1f 91 05 50 4e 54  |--.*...;.;...PNT|
00001730  31 20 49 4e 43 20 90 4e  54 00 4a 1f 96 05 42 4e  |1 INC .NT.J...BN|
00001740  45 20 4c 4f 4f 50 34 33  00 58 1f 9b 05 49 4e 43  |E LOOP43.X...INC|
00001750  20 90 4e 54 aa 31 00 67  1f a0 05 4c 4f 4f 50 34  | .NT.1.g...LOOP4|
00001760  33 20 52 54 53 00 6d 1f  a5 05 3b 00 81 1f aa 05  |3 RTS.m...;.....|
00001770  50 4e 54 32 20 49 4e 43  20 44 41 54 50 4e 54 00  |PNT2 INC DATPNT.|
00001780  90 1f af 05 42 4e 45 20  4c 4f 4f 50 34 34 00 a1  |....BNE LOOP44..|
00001790  1f b4 05 49 4e 43 20 44  41 54 50 4e 54 aa 31 00  |...INC DATPNT.1.|
000017a0  b0 1f b9 05 4c 4f 4f 50  34 34 20 52 54 53 00 b6  |....LOOP44 RTS..|
000017b0  1f be 05 3b 00 bc 1f c3  05 3b 00 c2 1f c8 05 3b  |...;.....;.....;|
000017c0  00 c8 1f cd 05 3b 00 ce  1f d2 05 3b 00 e0 1f d7  |.....;.....;....|
000017d0  05 43 4f 4d 50 80 20 42  59 54 20 30 2c 30 00 ef  |.COMP. BYT 0,0..|
000017e0  1f dc 05 53 a4 52 45 20  42 59 54 20 30 00 ff 1f  |...S.RE BYT 0...|
000017f0  e1 05 43 4f 55 4e 54 20  42 59 54 20 30 00 13 20  |..COUNT BYT 0.. |
00001800  e6 05 43 48 41 52 41 43  54 45 52 20 42 59 54 20  |..CHARACTER BYT |
00001810  30 00 23 20 eb 05 80 46  4c 41 47 20 42 59 54 20  |0.# ...FLAG BYT |
00001820  30 00 29 20 f0 05 3b 00  4f 20 f5 05 3b 2d 2d 2d  |0.) ..;.O ..;---|
00001830  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
00001840  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 00 6e 20  |-------------.n |
00001850  fa 05 3b 54 48 45 53 45  20 41 52 45 20 54 48 45  |..;THESE ARE THE|
00001860  20 42 59 54 45 53 20 54  4f 20 42 45 00 91 20 ff  | BYTES TO BE.. .|
00001870  05 3b 43 4f 4d 50 52 45  53 53 45 44 2e 2e 2e 59  |.;COMPRESSED...Y|
00001880  4f 55 20 43 41 4e 20 55  53 45 20 59 4f 55 52 00  |OU CAN USE YOUR.|
00001890  b4 20 04 06 3b 4f 57 4e  20 49 4e 53 54 45 41 44  |. ..;OWN INSTEAD|
000018a0  20 42 55 54 20 49 46 20  59 4f 55 20 45 58 54 45  | BUT IF YOU EXTE|
000018b0  4e 44 00 d5 20 09 06 3b  49 54 53 20 53 49 5a 45  |ND.. ..;ITS SIZE|
000018c0  20 54 48 45 4e 20 4d 41  4b 45 20 53 55 52 45 20  | THEN MAKE SURE |
000018d0  59 4f 55 00 f9 20 0e 06  3b 41 4c 54 45 52 20 54  |YOU.. ..;ALTER T|
000018e0  48 45 20 4f 54 48 45 52  20 53 54 4f 52 41 47 45  |HE OTHER STORAGE|
000018f0  20 41 52 45 41 27 53 00  1a 21 13 06 3b 41 4e 44  | AREA'S..!..;AND|
00001900  20 50 4f 49 4e 54 45 52  53 20 41 43 43 4f 52 44  | POINTERS ACCORD|
00001910  49 4e 47 4c 59 2e 2e 2e  00 40 21 18 06 3b 2d 2d  |INGLY....@!..;--|
00001920  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
00001930  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 00 46  |--------------.F|
00001940  21 1d 06 3b 00 51 21 22  06 54 45 58 54 20 3b 00  |!..;.Q!".TEXT ;.|
00001950  57 21 27 06 3b 00 6f 21  2c 06 42 59 54 20 24 30  |W!'.;.o!,.BYT $0|
00001960  31 2c 24 30 31 2c 24 30  31 2c 24 30 31 00 87 21  |1,$01,$01,$01..!|
00001970  31 06 42 59 54 20 24 30  31 2c 24 30 31 2c 24 30  |1.BYT $01,$01,$0|
00001980  31 2c 24 30 31 00 9f 21  36 06 42 59 54 20 24 30  |1,$01..!6.BYT $0|
00001990  31 2c 24 30 31 2c 24 30  31 2c 24 30 31 00 b7 21  |1,$01,$01,$01..!|
000019a0  3b 06 42 59 54 20 24 30  31 2c 24 30 31 2c 24 45  |;.BYT $01,$01,$E|
000019b0  46 2c 24 30 31 00 bd 21  40 06 3b 00 e3 21 45 06  |F,$01..!@.;..!E.|
000019c0  3b 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |;---------------|
000019d0  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
000019e0  2d 00 07 22 4a 06 3b 54  48 45 20 42 59 54 45 53  |-.."J.;THE BYTES|
000019f0  20 41 42 4f 56 45 20 41  52 45 20 43 4f 4d 50 52  | ABOVE ARE COMPR|
00001a00  45 53 53 45 44 00 2a 22  4f 06 3b 41 4e 44 20 53  |ESSED.*"O.;AND S|
00001a10  54 4f 52 45 44 20 48 45  52 45 2e 2e 2e 2e 2e 2e  |TORED HERE......|
00001a20  2e 2e 2e 2e 2e 2e 2e 2e  00 4d 22 54 06 3b 28 33  |.........M"T.;(3|
00001a30  20 42 59 54 45 53 2f 46  4f 52 20 45 56 45 52 59  | BYTES/FOR EVERY|
00001a40  20 31 20 49 4e 20 54 45  58 54 29 00 73 22 59 06  | 1 IN TEXT).s"Y.|
00001a50  3b 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |;---------------|
00001a60  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
00001a70  2d 00 80 22 5e 06 53 a4  52 41 47 45 20 3b 00 86  |-.."^.S.RAGE ;..|
00001a80  22 63 06 3b 00 9e 22 68  06 42 59 54 20 30 2c 30  |"c.;.."h.BYT 0,0|
00001a90  2c 30 2c 30 2c 30 2c 30  2c 30 2c 30 00 b6 22 6d  |,0,0,0,0,0,0.."m|
00001aa0  06 42 59 54 20 30 2c 30  2c 30 2c 30 2c 30 2c 30  |.BYT 0,0,0,0,0,0|
00001ab0  2c 30 2c 30 00 ce 22 72  06 42 59 54 20 30 2c 30  |,0,0.."r.BYT 0,0|
00001ac0  2c 30 2c 30 2c 30 2c 30  2c 30 2c 30 00 e6 22 77  |,0,0,0,0,0,0.."w|
00001ad0  06 42 59 54 20 30 2c 30  2c 30 2c 30 2c 30 2c 30  |.BYT 0,0,0,0,0,0|
00001ae0  2c 30 2c 30 00 fe 22 7c  06 42 59 54 20 30 2c 30  |,0,0.."|.BYT 0,0|
00001af0  2c 30 2c 30 2c 30 2c 30  2c 30 2c 30 00 16 23 81  |,0,0,0,0,0,0..#.|
00001b00  06 42 59 54 20 30 2c 30  2c 30 2c 30 2c 30 2c 30  |.BYT 0,0,0,0,0,0|
00001b10  2c 30 2c 30 00 1c 23 86  06 3b 00 42 23 8b 06 3b  |,0,0..#..;.B#..;|
00001b20  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
00001b40  00 68 23 90 06 3b 54 48  45 20 43 4f 4d 50 52 45  |.h#..;THE COMPRE|
00001b50  53 53 45 44 20 44 41 54  41 20 49 4e 20 27 53 54  |SSED DATA IN 'ST|
00001b60  4f 52 41 47 45 27 00 8e  23 95 06 3b 49 53 20 44  |ORAGE'..#..;IS D|
00001b70  45 43 4f 4d 50 52 45 53  53 45 44 20 26 20 50 4c  |ECOMPRESSED & PL|
00001b80  41 43 45 44 20 48 45 52  45 2e 2e 2e 00 b4 23 9a  |ACED HERE.....#.|
00001b90  06 3b 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |.;--------------|
00001ba0  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
00001bb0  2d 2d 00 ba 23 9f 06 3b  00 c6 23 a4 06 a2 54 45  |--..#..;..#...TE|
00001bc0  58 54 20 3b 00 cc 23 a9  06 3b 00 e4 23 ae 06 42  |XT ;..#..;..#..B|
00001bd0  59 54 20 30 2c 30 2c 30  2c 30 2c 30 2c 30 2c 30  |YT 0,0,0,0,0,0,0|
00001be0  2c 30 00 fc 23 b3 06 42  59 54 20 30 2c 30 2c 30  |,0..#..BYT 0,0,0|
00001bf0  2c 30 2c 30 2c 30 2c 30  2c 30 00 14 24 b8 06 42  |,0,0,0,0,0..$..B|
00001c00  59 54 20 30 2c 30 2c 30  2c 30 2c 30 2c 30 2c 30  |YT 0,0,0,0,0,0,0|
00001c10  2c 30 00 2c 24 bd 06 42  59 54 20 30 2c 30 2c 30  |,0.,$..BYT 0,0,0|
00001c20  2c 30 2c 30 2c 30 2c 30  2c 30 00 44 24 c2 06 42  |,0,0,0,0,0.D$..B|
00001c30  59 54 20 30 2c 30 2c 30  2c 30 2c 30 2c 30 2c 30  |YT 0,0,0,0,0,0,0|
00001c40  2c 30 00 5c 24 c7 06 42  59 54 20 30 2c 30 2c 30  |,0.\$..BYT 0,0,0|
00001c50  2c 30 2c 30 2c 30 2c 30  2c 30 00 62 24 cc 06 3b  |,0,0,0,0,0.b$..;|
00001c60  00 68 24 d1 06 3b 00 00  00                       |.h$..;...|
00001c69