Home » Personal collection » Acorn ADFS disks » Electron_User_Group » EUG_18.ADF » F/INTRO1

F/INTRO1

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 » Acorn ADFS disks » Electron_User_Group » EUG_18.ADF
Filename: F/INTRO1
Read OK:
File size: 116D bytes
Load address: 49204556
Exec address: 4F52544E
File contents
 
COMPRESSION TECHNIQUES BY RICHARD DIMOND.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
These techniques can save both memory and disc space and are 
useful forgetting as much as possible on a disc especially 
with the limitations ofDFS,

SCREEN COMPRESSION
~~~~~~~~~~~~~~~~~~
This was explained in Electron User (Aug 1989) and also in 
Acornuser (Dec1992).  The EU program is for MODE 2 only and 
in BASIC and writes andreads direct to the disc and so was 
rather slow.  The AU program is aM/code routine which writes 
the compressed data to an address below thescreen area.  This 
will work in all MODEs but in MODEs 0-2 there is littlememory 
for the compressed file especially if PAGE is a &1D00 with the 
Plus3.  The routine can only then be used for screens which 
will compressenough to fit in this area.  For this reason I 
have added a modified coding so that the file is written to 
and read from the disc.  

These programs rely on the fact that a lot of screen data 
includes stringsof the same character and these can be loaded 
using a loop in the program. The file uses a flag which 
indicates a branch to the loop and is followedby the number 
of characters and the character code and string of up to 255
characters can be reduced to 3 bytes.  Thus for some screens 
you can getquite a saving of memory but the more detailed a 
screen is, you get lesscompression.

There are two sets of files, those with suffix 1 load the 
compressed fileinto memory and is the preferred method as the 
screen is expanded morequickly and without the interruptions 
of reading the disc. 

The other set, with suffix 2, reads and writes the disc and 
needs to beused for those screens which do not compress 
sufficiently.  Both theM/code files first look for an unused 
number to use for the flag and ifnone is found the screen 
cannot be compressed.  It is very rarely that all256 numbers 
are used!! 

The UNCOMP programs expand the compressed data and the COMPT 
programscompress a screen file.                                                                         

The CPCODE programs the M/code files for the compression and 
expansionroutines.  The COMP files are the assembler programs 
for these files.

SET 1
~~~~~
COMPT1, CPCODE1, UNCOMP1 are for those screens which will 
compresssufficiently for the file to be loaded below the 
screen area.

The compression program COMPT1 first asks for the MODE number 
and thefile to load.  It will then compress the file, some 
files may overflowinto the screen area, and then the screen 
reverts to MODE6 before givingthe length of the file and the 
percentage of compression.  It then asksfor a filename to 
save it.

UNCOMP1 is similarly used.  HIMEM isset to PAGE + &180 to give 
themaximum amount of memory for LOADing the compressed file 
even if PAGE isat &1D00. Should the file be too long the 
routine will usually still workbut the lower part of the 
expanded screen will be spoilt as the expandedscreen has 
overwritten the data in the file.  This can be overcome by the
using UNCOMP2

SET 2
~~~~~
COMPT2, CPCODE2, UNCOMP2 write and read the disc and must be 
used when thecompressed screen cannot be loaded below the 
screen area. 

COMPT2 is used in the same way but asks for the filename to 
save beforecompressing the screen.  The file is then SAVEd to 
disc without giving theinformation on length and percentage.


TEXT COMPRESSION
~~~~~~~~~~~~~~~~
This was exlpained in EU (Aug 1987) in relation to saving 
memory in theAdventure Program series 'Demon Data'.  The 
programs given could only beused for text up to 255 
chasracters. I have made some changes to theseprograms so 
that a whole View file can be compressed.  Also I have now
rewritten the decode program in M/code so that it prints out 
much quicker.

The program ENCODE compresses the text filo and is a BASIC 
program andso is rather slow.  DECODE expands a compressed 
file and uses the M/codefile DecM/C.  DecMsrc is the 
assembler file for this code.

The explanation in the EU article is rather detailed but to 
give a briefidea of how this works is that it uses the values 
of the high nibble of abyte greater than 7 for the 7 most 
common letters + space which are heldin the string " 
etaonri".  These characters are printed using INSTR and soby 
a nibble rather than a byte and when the nibbles are paired up 
as bytesa saving of up to 20 to 25% in memory can be made.
00000000  20 0d 43 4f 4d 50 52 45  53 53 49 4f 4e 20 54 45  | .COMPRESSION TE|
00000010  43 48 4e 49 51 55 45 53  20 42 59 20 52 49 43 48  |CHNIQUES BY RICH|
00000020  41 52 44 20 44 49 4d 4f  4e 44 2e 0d 7e 7e 7e 7e  |ARD DIMOND..~~~~|
00000030  7e 7e 7e 7e 7e 7e 7e 7e  7e 7e 7e 7e 7e 7e 7e 7e  |~~~~~~~~~~~~~~~~|
*
00000050  7e 7e 7e 7e 7e 0d 54 68  65 73 65 20 74 65 63 68  |~~~~~.These tech|
00000060  6e 69 71 75 65 73 20 63  61 6e 20 73 61 76 65 20  |niques can save |
00000070  62 6f 74 68 20 6d 65 6d  6f 72 79 20 61 6e 64 20  |both memory and |
00000080  64 69 73 63 20 73 70 61  63 65 20 61 6e 64 20 61  |disc space and a|
00000090  72 65 20 0d 75 73 65 66  75 6c 20 66 6f 72 10 67  |re .useful for.g|
000000a0  65 74 74 69 6e 67 20 61  73 20 6d 75 63 68 20 61  |etting as much a|
000000b0  73 20 70 6f 73 73 69 62  6c 65 20 6f 6e 20 61 20  |s possible on a |
000000c0  64 69 73 63 20 65 73 70  65 63 69 61 6c 6c 79 20  |disc especially |
000000d0  0d 77 69 74 68 20 74 68  65 20 6c 69 6d 69 74 61  |.with the limita|
000000e0  74 69 6f 6e 73 20 6f 66  10 44 46 53 2c 0d 0d 53  |tions of.DFS,..S|
000000f0  43 52 45 45 4e 20 43 4f  4d 50 52 45 53 53 49 4f  |CREEN COMPRESSIO|
00000100  4e 0d 7e 7e 7e 7e 7e 7e  7e 7e 7e 7e 7e 7e 7e 7e  |N.~~~~~~~~~~~~~~|
00000110  7e 7e 7e 7e 0d 54 68 69  73 20 77 61 73 20 65 78  |~~~~.This was ex|
00000120  70 6c 61 69 6e 65 64 20  69 6e 20 45 6c 65 63 74  |plained in Elect|
00000130  72 6f 6e 20 55 73 65 72  20 28 41 75 67 20 31 39  |ron User (Aug 19|
00000140  38 39 29 20 61 6e 64 20  61 6c 73 6f 20 69 6e 20  |89) and also in |
00000150  0d 41 63 6f 72 6e 75 73  65 72 20 28 44 65 63 10  |.Acornuser (Dec.|
00000160  31 39 39 32 29 2e 20 20  54 68 65 20 45 55 20 70  |1992).  The EU p|
00000170  72 6f 67 72 61 6d 20 69  73 20 66 6f 72 20 4d 4f  |rogram is for MO|
00000180  44 45 20 32 20 6f 6e 6c  79 20 61 6e 64 20 0d 69  |DE 2 only and .i|
00000190  6e 20 42 41 53 49 43 20  61 6e 64 20 77 72 69 74  |n BASIC and writ|
000001a0  65 73 20 61 6e 64 10 72  65 61 64 73 20 64 69 72  |es and.reads dir|
000001b0  65 63 74 20 74 6f 20 74  68 65 20 64 69 73 63 20  |ect to the disc |
000001c0  61 6e 64 20 73 6f 20 77  61 73 20 0d 72 61 74 68  |and so was .rath|
000001d0  65 72 20 73 6c 6f 77 2e  20 20 54 68 65 20 41 55  |er slow.  The AU|
000001e0  20 70 72 6f 67 72 61 6d  20 69 73 20 61 10 4d 2f  | program is a.M/|
000001f0  63 6f 64 65 20 72 6f 75  74 69 6e 65 20 77 68 69  |code routine whi|
00000200  63 68 20 77 72 69 74 65  73 20 0d 74 68 65 20 63  |ch writes .the c|
00000210  6f 6d 70 72 65 73 73 65  64 20 64 61 74 61 20 74  |ompressed data t|
00000220  6f 20 61 6e 20 61 64 64  72 65 73 73 20 62 65 6c  |o an address bel|
00000230  6f 77 20 74 68 65 10 73  63 72 65 65 6e 20 61 72  |ow the.screen ar|
00000240  65 61 2e 20 20 54 68 69  73 20 0d 77 69 6c 6c 20  |ea.  This .will |
00000250  77 6f 72 6b 20 69 6e 20  61 6c 6c 20 4d 4f 44 45  |work in all MODE|
00000260  73 20 62 75 74 20 69 6e  20 4d 4f 44 45 73 20 30  |s but in MODEs 0|
00000270  2d 32 20 74 68 65 72 65  20 69 73 20 6c 69 74 74  |-2 there is litt|
00000280  6c 65 10 6d 65 6d 6f 72  79 20 0d 66 6f 72 20 74  |le.memory .for t|
00000290  68 65 20 63 6f 6d 70 72  65 73 73 65 64 20 66 69  |he compressed fi|
000002a0  6c 65 20 65 73 70 65 63  69 61 6c 6c 79 20 69 66  |le especially if|
000002b0  20 50 41 47 45 20 69 73  20 61 20 26 31 44 30 30  | PAGE is a &1D00|
000002c0  20 77 69 74 68 20 74 68  65 20 0d 50 6c 75 73 10  | with the .Plus.|
000002d0  33 2e 20 20 54 68 65 20  72 6f 75 74 69 6e 65 20  |3.  The routine |
000002e0  63 61 6e 20 6f 6e 6c 79  20 74 68 65 6e 20 62 65  |can only then be|
000002f0  20 75 73 65 64 20 66 6f  72 20 73 63 72 65 65 6e  | used for screen|
00000300  73 20 77 68 69 63 68 20  0d 77 69 6c 6c 20 63 6f  |s which .will co|
00000310  6d 70 72 65 73 73 10 65  6e 6f 75 67 68 20 74 6f  |mpress.enough to|
00000320  20 66 69 74 20 69 6e 20  74 68 69 73 20 61 72 65  | fit in this are|
00000330  61 2e 20 20 46 6f 72 20  74 68 69 73 20 72 65 61  |a.  For this rea|
00000340  73 6f 6e 20 49 20 0d 68  61 76 65 20 61 64 64 65  |son I .have adde|
00000350  64 20 61 20 6d 6f 64 69  66 69 65 64 20 10 63 6f  |d a modified .co|
00000360  64 69 6e 67 20 73 6f 20  74 68 61 74 20 74 68 65  |ding so that the|
00000370  20 66 69 6c 65 20 69 73  20 77 72 69 74 74 65 6e  | file is written|
00000380  20 74 6f 20 0d 61 6e 64  20 72 65 61 64 20 66 72  | to .and read fr|
00000390  6f 6d 20 74 68 65 20 64  69 73 63 2e 20 20 0d 0d  |om the disc.  ..|
000003a0  54 68 65 73 65 20 70 72  6f 67 72 61 6d 73 20 72  |These programs r|
000003b0  65 6c 79 20 6f 6e 20 74  68 65 20 66 61 63 74 20  |ely on the fact |
000003c0  74 68 61 74 20 61 20 6c  6f 74 20 6f 66 20 73 63  |that a lot of sc|
000003d0  72 65 65 6e 20 64 61 74  61 20 0d 69 6e 63 6c 75  |reen data .inclu|
000003e0  64 65 73 20 73 74 72 69  6e 67 73 10 6f 66 20 74  |des strings.of t|
000003f0  68 65 20 73 61 6d 65 20  63 68 61 72 61 63 74 65  |he same characte|
00000400  72 20 61 6e 64 20 74 68  65 73 65 20 63 61 6e 20  |r and these can |
00000410  62 65 20 6c 6f 61 64 65  64 20 0d 75 73 69 6e 67  |be loaded .using|
00000420  20 61 20 6c 6f 6f 70 20  69 6e 20 74 68 65 20 70  | a loop in the p|
00000430  72 6f 67 72 61 6d 2e 20  10 54 68 65 20 66 69 6c  |rogram. .The fil|
00000440  65 20 75 73 65 73 20 61  20 66 6c 61 67 20 77 68  |e uses a flag wh|
00000450  69 63 68 20 0d 69 6e 64  69 63 61 74 65 73 20 61  |ich .indicates a|
00000460  20 62 72 61 6e 63 68 20  74 6f 20 74 68 65 20 6c  | branch to the l|
00000470  6f 6f 70 20 61 6e 64 20  69 73 20 66 6f 6c 6c 6f  |oop and is follo|
00000480  77 65 64 10 62 79 20 74  68 65 20 6e 75 6d 62 65  |wed.by the numbe|
00000490  72 20 0d 6f 66 20 63 68  61 72 61 63 74 65 72 73  |r .of characters|
000004a0  20 61 6e 64 20 74 68 65  20 63 68 61 72 61 63 74  | and the charact|
000004b0  65 72 20 63 6f 64 65 20  61 6e 64 20 73 74 72 69  |er code and stri|
000004c0  6e 67 20 6f 66 20 75 70  20 74 6f 20 32 35 35 10  |ng of up to 255.|
000004d0  0d 63 68 61 72 61 63 74  65 72 73 20 63 61 6e 20  |.characters can |
000004e0  62 65 20 72 65 64 75 63  65 64 20 74 6f 20 33 20  |be reduced to 3 |
000004f0  62 79 74 65 73 2e 20 20  54 68 75 73 20 66 6f 72  |bytes.  Thus for|
00000500  20 73 6f 6d 65 20 73 63  72 65 65 6e 73 20 0d 79  | some screens .y|
00000510  6f 75 20 63 61 6e 20 67  65 74 10 71 75 69 74 65  |ou can get.quite|
00000520  20 61 20 73 61 76 69 6e  67 20 6f 66 20 6d 65 6d  | a saving of mem|
00000530  6f 72 79 20 62 75 74 20  74 68 65 20 6d 6f 72 65  |ory but the more|
00000540  20 64 65 74 61 69 6c 65  64 20 61 20 0d 73 63 72  | detailed a .scr|
00000550  65 65 6e 20 69 73 2c 20  79 6f 75 20 67 65 74 20  |een is, you get |
00000560  6c 65 73 73 10 63 6f 6d  70 72 65 73 73 69 6f 6e  |less.compression|
00000570  2e 0d 0d 54 68 65 72 65  20 61 72 65 20 74 77 6f  |...There are two|
00000580  20 73 65 74 73 20 6f 66  20 66 69 6c 65 73 2c 20  | sets of files, |
00000590  74 68 6f 73 65 20 77 69  74 68 20 73 75 66 66 69  |those with suffi|
000005a0  78 20 31 20 6c 6f 61 64  20 74 68 65 20 0d 63 6f  |x 1 load the .co|
000005b0  6d 70 72 65 73 73 65 64  20 66 69 6c 65 10 69 6e  |mpressed file.in|
000005c0  74 6f 20 6d 65 6d 6f 72  79 20 61 6e 64 20 69 73  |to memory and is|
000005d0  20 74 68 65 20 70 72 65  66 65 72 72 65 64 20 6d  | the preferred m|
000005e0  65 74 68 6f 64 20 61 73  20 74 68 65 20 0d 73 63  |ethod as the .sc|
000005f0  72 65 65 6e 20 69 73 20  65 78 70 61 6e 64 65 64  |reen is expanded|
00000600  20 6d 6f 72 65 10 71 75  69 63 6b 6c 79 20 61 6e  | more.quickly an|
00000610  64 20 77 69 74 68 6f 75  74 20 74 68 65 20 69 6e  |d without the in|
00000620  74 65 72 72 75 70 74 69  6f 6e 73 20 0d 6f 66 20  |terruptions .of |
00000630  72 65 61 64 69 6e 67 20  74 68 65 20 64 69 73 63  |reading the disc|
00000640  2e 20 0d 0d 54 68 65 20  6f 74 68 65 72 20 73 65  |. ..The other se|
00000650  74 2c 20 77 69 74 68 20  73 75 66 66 69 78 1a 20  |t, with suffix. |
00000660  32 2c 20 72 65 61 64 73  20 61 6e 64 20 77 72 69  |2, reads and wri|
00000670  74 65 73 20 74 68 65 20  64 69 73 63 20 61 6e 64  |tes the disc and|
00000680  20 0d 6e 65 65 64 73 20  74 6f 20 62 65 10 75 73  | .needs to be.us|
00000690  65 64 20 66 6f 72 20 74  68 6f 73 65 20 73 63 72  |ed for those scr|
000006a0  65 65 6e 73 20 77 68 69  63 68 20 64 6f 20 6e 6f  |eens which do no|
000006b0  74 20 63 6f 6d 70 72 65  73 73 1a 20 0d 73 75 66  |t compress. .suf|
000006c0  66 69 63 69 65 6e 74 6c  79 2e 20 20 42 6f 74 68  |ficiently.  Both|
000006d0  20 74 68 65 10 4d 2f 63  6f 64 65 20 66 69 6c 65  | the.M/code file|
000006e0  73 20 66 69 72 73 74 20  6c 6f 6f 6b 20 66 6f 72  |s first look for|
000006f0  20 61 6e 20 75 6e 75 73  65 64 20 0d 6e 75 6d 62  | an unused .numb|
00000700  65 72 20 74 6f 20 75 73  65 20 66 6f 72 20 74 68  |er to use for th|
00000710  65 20 66 6c 61 67 20 61  6e 64 20 69 66 10 6e 6f  |e flag and if.no|
00000720  6e 65 20 69 73 20 66 6f  75 6e 64 20 74 68 65 20  |ne is found the |
00000730  73 63 72 65 65 6e 20 0d  63 61 6e 6e 6f 74 20 62  |screen .cannot b|
00000740  65 20 63 6f 6d 70 72 65  73 73 65 64 2e 20 20 49  |e compressed.  I|
00000750  74 20 69 73 20 76 65 72  79 20 72 61 72 65 6c 79  |t is very rarely|
00000760  20 74 68 61 74 20 61 6c  6c 10 32 35 36 20 6e 75  | that all.256 nu|
00000770  6d 62 65 72 73 20 0d 61  72 65 20 75 73 65 64 21  |mbers .are used!|
00000780  21 20 0d 0d 54 68 65 20  55 4e 43 4f 4d 50 20 70  |! ..The UNCOMP p|
00000790  72 6f 67 72 61 6d 73 20  65 78 70 61 6e 64 20 74  |rograms expand t|
000007a0  68 65 20 63 6f 6d 70 72  65 73 73 65 64 20 64 61  |he compressed da|
000007b0  74 61 20 61 6e 64 20 74  68 65 20 43 4f 4d 50 54  |ta and the COMPT|
000007c0  20 0d 70 72 6f 67 72 61  6d 73 10 63 6f 6d 70 72  | .programs.compr|
000007d0  65 73 73 20 61 20 73 63  72 65 65 6e 20 66 69 6c  |ess a screen fil|
000007e0  65 2e 10 20 20 20 20 20  20 20 20 20 20 20 20 20  |e..             |
000007f0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
*
00000820  20 20 20 20 20 20 20 20  20 20 20 20 10 0d 0d 54  |            ...T|
00000830  68 65 20 43 50 43 4f 44  45 20 70 72 6f 67 72 61  |he CPCODE progra|
00000840  6d 73 20 74 68 65 20 4d  2f 63 6f 64 65 20 66 69  |ms the M/code fi|
00000850  6c 65 73 20 66 6f 72 20  74 68 65 20 63 6f 6d 70  |les for the comp|
00000860  72 65 73 73 69 6f 6e 20  61 6e 64 20 0d 65 78 70  |ression and .exp|
00000870  61 6e 73 69 6f 6e 10 72  6f 75 74 69 6e 65 73 2e  |ansion.routines.|
00000880  20 20 54 68 65 20 43 4f  4d 50 20 66 69 6c 65 73  |  The COMP files|
00000890  20 61 72 65 20 74 68 65  20 61 73 73 65 6d 62 6c  | are the assembl|
000008a0  65 72 20 70 72 6f 67 72  61 6d 73 20 0d 66 6f 72  |er programs .for|
000008b0  20 74 68 65 73 65 20 66  69 6c 65 73 2e 0d 0d 53  | these files...S|
000008c0  45 54 20 31 0d 7e 7e 7e  7e 7e 0d 43 4f 4d 50 54  |ET 1.~~~~~.COMPT|
000008d0  31 2c 20 43 50 43 4f 44  45 31 2c 20 55 4e 43 4f  |1, CPCODE1, UNCO|
000008e0  4d 50 31 20 61 72 65 20  66 6f 72 20 74 68 6f 73  |MP1 are for thos|
000008f0  65 20 73 63 72 65 65 6e  73 20 77 68 69 63 68 20  |e screens which |
00000900  77 69 6c 6c 20 0d 63 6f  6d 70 72 65 73 73 10 73  |will .compress.s|
00000910  75 66 66 69 63 69 65 6e  74 6c 79 20 66 6f 72 20  |ufficiently for |
00000920  74 68 65 20 66 69 6c 65  20 74 6f 20 62 65 20 6c  |the file to be l|
00000930  6f 61 64 65 64 20 62 65  6c 6f 77 20 74 68 65 20  |oaded below the |
00000940  0d 73 63 72 65 65 6e 20  61 72 65 61 2e 0d 0d 54  |.screen area...T|
00000950  68 65 20 63 6f 6d 70 72  65 73 73 69 6f 6e 20 70  |he compression p|
00000960  72 6f 67 72 61 6d 20 43  4f 4d 50 54 31 20 66 69  |rogram COMPT1 fi|
00000970  72 73 74 20 61 73 6b 73  20 66 6f 72 20 74 68 65  |rst asks for the|
00000980  20 4d 4f 44 45 20 6e 75  6d 62 65 72 20 0d 61 6e  | MODE number .an|
00000990  64 20 74 68 65 10 66 69  6c 65 20 74 6f 20 6c 6f  |d the.file to lo|
000009a0  61 64 2e 20 20 49 74 20  77 69 6c 6c 20 74 68 65  |ad.  It will the|
000009b0  6e 20 63 6f 6d 70 72 65  73 73 20 74 68 65 20 66  |n compress the f|
000009c0  69 6c 65 2c 20 73 6f 6d  65 20 0d 66 69 6c 65 73  |ile, some .files|
000009d0  20 6d 61 79 20 6f 76 65  72 66 6c 6f 77 10 69 6e  | may overflow.in|
000009e0  74 6f 20 74 68 65 20 73  63 72 65 65 6e 20 61 72  |to the screen ar|
000009f0  65 61 2c 20 61 6e 64 20  74 68 65 6e 20 74 68 65  |ea, and then the|
00000a00  20 73 63 72 65 65 6e 20  0d 72 65 76 65 72 74 73  | screen .reverts|
00000a10  20 74 6f 20 4d 4f 44 45  36 20 62 65 66 6f 72 65  | to MODE6 before|
00000a20  20 67 69 76 69 6e 67 10  74 68 65 20 6c 65 6e 67  | giving.the leng|
00000a30  74 68 20 6f 66 20 74 68  65 20 66 69 6c 65 20 61  |th of the file a|
00000a40  6e 64 20 74 68 65 20 0d  70 65 72 63 65 6e 74 61  |nd the .percenta|
00000a50  67 65 20 6f 66 20 63 6f  6d 70 72 65 73 73 69 6f  |ge of compressio|
00000a60  6e 2e 20 20 49 74 20 74  68 65 6e 20 61 73 6b 73  |n.  It then asks|
00000a70  10 66 6f 72 20 61 20 66  69 6c 65 6e 61 6d 65 20  |.for a filename |
00000a80  74 6f 20 0d 73 61 76 65  20 69 74 2e 0d 0d 55 4e  |to .save it...UN|
00000a90  43 4f 4d 50 31 20 69 73  20 73 69 6d 69 6c 61 72  |COMP1 is similar|
00000aa0  6c 79 20 75 73 65 64 2e  20 20 48 49 4d 45 4d 20  |ly used.  HIMEM |
00000ab0  69 73 1a 73 65 74 20 74  6f 20 50 41 47 45 20 2b  |is.set to PAGE +|
00000ac0  20 26 31 38 30 20 74 6f  20 67 69 76 65 20 0d 74  | &180 to give .t|
00000ad0  68 65 10 6d 61 78 69 6d  75 6d 20 61 6d 6f 75 6e  |he.maximum amoun|
00000ae0  74 20 6f 66 20 6d 65 6d  6f 72 79 20 66 6f 72 20  |t of memory for |
00000af0  4c 4f 41 44 69 6e 67 20  74 68 65 20 63 6f 6d 70  |LOADing the comp|
00000b00  72 65 73 73 65 64 20 66  69 6c 65 20 0d 65 76 65  |ressed file .eve|
00000b10  6e 20 69 66 20 50 41 47  45 20 69 73 10 61 74 20  |n if PAGE is.at |
00000b20  26 31 44 30 30 2e 20 53  68 6f 75 6c 64 20 74 68  |&1D00. Should th|
00000b30  65 20 66 69 6c 65 20 62  65 20 74 6f 6f 20 6c 6f  |e file be too lo|
00000b40  6e 67 20 74 68 65 20 0d  72 6f 75 74 69 6e 65 20  |ng the .routine |
00000b50  77 69 6c 6c 20 75 73 75  61 6c 6c 79 20 73 74 69  |will usually sti|
00000b60  6c 6c 20 77 6f 72 6b 10  62 75 74 20 74 68 65 20  |ll work.but the |
00000b70  6c 6f 77 65 72 20 70 61  72 74 20 6f 66 20 74 68  |lower part of th|
00000b80  65 20 0d 65 78 70 61 6e  64 65 64 20 73 63 72 65  |e .expanded scre|
00000b90  65 6e 20 77 69 6c 6c 20  62 65 20 73 70 6f 69 6c  |en will be spoil|
00000ba0  74 20 61 73 20 74 68 65  20 65 78 70 61 6e 64 65  |t as the expande|
00000bb0  64 10 73 63 72 65 65 6e  20 68 61 73 20 0d 6f 76  |d.screen has .ov|
00000bc0  65 72 77 72 69 74 74 65  6e 20 74 68 65 20 64 61  |erwritten the da|
00000bd0  74 61 20 69 6e 20 74 68  65 20 66 69 6c 65 2e 20  |ta in the file. |
00000be0  20 54 68 69 73 20 63 61  6e 20 62 65 20 6f 76 65  | This can be ove|
00000bf0  72 63 6f 6d 65 20 62 79  20 74 68 65 10 0d 75 73  |rcome by the..us|
00000c00  69 6e 67 20 55 4e 43 4f  4d 50 32 0d 0d 53 45 54  |ing UNCOMP2..SET|
00000c10  20 32 0d 7e 7e 7e 7e 7e  0d 43 4f 4d 50 54 32 2c  | 2.~~~~~.COMPT2,|
00000c20  20 43 50 43 4f 44 45 32  2c 20 55 4e 43 4f 4d 50  | CPCODE2, UNCOMP|
00000c30  32 20 77 72 69 74 65 20  61 6e 64 20 72 65 61 64  |2 write and read|
00000c40  20 74 68 65 20 64 69 73  63 20 61 6e 64 20 6d 75  | the disc and mu|
00000c50  73 74 20 62 65 20 0d 75  73 65 64 20 77 68 65 6e  |st be .used when|
00000c60  20 74 68 65 10 63 6f 6d  70 72 65 73 73 65 64 20  | the.compressed |
00000c70  73 63 72 65 65 6e 20 63  61 6e 6e 6f 74 20 62 65  |screen cannot be|
00000c80  20 6c 6f 61 64 65 64 20  62 65 6c 6f 77 20 74 68  | loaded below th|
00000c90  65 20 0d 73 63 72 65 65  6e 20 61 72 65 61 2e 20  |e .screen area. |
00000ca0  0d 0d 43 4f 4d 50 54 32  20 69 73 20 75 73 65 64  |..COMPT2 is used|
00000cb0  20 69 6e 20 74 68 65 20  73 61 6d 65 20 77 61 79  | in the same way|
00000cc0  20 62 75 74 20 61 73 6b  73 20 66 6f 72 20 74 68  | but asks for th|
00000cd0  65 20 66 69 6c 65 6e 61  6d 65 20 74 6f 20 0d 73  |e filename to .s|
00000ce0  61 76 65 20 62 65 66 6f  72 65 10 63 6f 6d 70 72  |ave before.compr|
00000cf0  65 73 73 69 6e 67 20 74  68 65 20 73 63 72 65 65  |essing the scree|
00000d00  6e 2e 20 20 54 68 65 20  66 69 6c 65 20 69 73 20  |n.  The file is |
00000d10  74 68 65 6e 20 53 41 56  45 64 20 74 6f 20 0d 64  |then SAVEd to .d|
00000d20  69 73 63 20 77 69 74 68  6f 75 74 20 67 69 76 69  |isc without givi|
00000d30  6e 67 20 74 68 65 10 69  6e 66 6f 72 6d 61 74 69  |ng the.informati|
00000d40  6f 6e 20 6f 6e 20 6c 65  6e 67 74 68 20 61 6e 64  |on on length and|
00000d50  20 70 65 72 63 65 6e 74  61 67 65 2e 0d 0d 0d 54  | percentage....T|
00000d60  45 58 54 20 43 4f 4d 50  52 45 53 53 49 4f 4e 0d  |EXT COMPRESSION.|
00000d70  7e 7e 7e 7e 7e 7e 7e 7e  7e 7e 7e 7e 7e 7e 7e 7e  |~~~~~~~~~~~~~~~~|
00000d80  0d 54 68 69 73 20 77 61  73 20 65 78 6c 70 61 69  |.This was exlpai|
00000d90  6e 65 64 20 69 6e 20 45  55 20 28 41 75 67 20 31  |ned in EU (Aug 1|
00000da0  39 38 37 29 20 69 6e 20  72 65 6c 61 74 69 6f 6e  |987) in relation|
00000db0  20 74 6f 20 73 61 76 69  6e 67 20 0d 6d 65 6d 6f  | to saving .memo|
00000dc0  72 79 20 69 6e 20 74 68  65 10 41 64 76 65 6e 74  |ry in the.Advent|
00000dd0  75 72 65 20 50 72 6f 67  72 61 6d 20 73 65 72 69  |ure Program seri|
00000de0  65 73 20 27 44 65 6d 6f  6e 20 44 61 74 61 27 2e  |es 'Demon Data'.|
00000df0  20 20 54 68 65 20 0d 70  72 6f 67 72 61 6d 73 20  |  The .programs |
00000e00  67 69 76 65 6e 20 63 6f  75 6c 64 20 6f 6e 6c 79  |given could only|
00000e10  20 62 65 10 75 73 65 64  20 66 6f 72 20 74 65 78  | be.used for tex|
00000e20  74 20 75 70 20 74 6f 20  32 35 35 20 0d 63 68 61  |t up to 255 .cha|
00000e30  73 72 61 63 74 65 72 73  2e 1a 20 49 20 68 61 76  |sracters.. I hav|
00000e40  65 20 6d 61 64 65 20 73  6f 6d 65 20 63 68 61 6e  |e made some chan|
00000e50  67 65 73 20 74 6f 20 74  68 65 73 65 10 70 72 6f  |ges to these.pro|
00000e60  67 72 61 6d 73 20 73 6f  20 0d 74 68 61 74 20 61  |grams so .that a|
00000e70  20 77 68 6f 6c 65 20 56  69 65 77 20 66 69 6c 65  | whole View file|
00000e80  20 63 61 6e 20 62 65 20  63 6f 6d 70 72 65 73 73  | can be compress|
00000e90  65 64 2e 20 20 41 6c 73  6f 20 49 20 68 61 76 65  |ed.  Also I have|
00000ea0  20 6e 6f 77 10 0d 72 65  77 72 69 74 74 65 6e 20  | now..rewritten |
00000eb0  74 68 65 20 64 65 63 6f  64 65 20 70 72 6f 67 72  |the decode progr|
00000ec0  61 6d 20 69 6e 20 4d 2f  63 6f 64 65 20 73 6f 20  |am in M/code so |
00000ed0  74 68 61 74 20 69 74 20  70 72 69 6e 74 73 20 6f  |that it prints o|
00000ee0  75 74 20 0d 6d 75 63 68  20 71 75 69 63 6b 65 72  |ut .much quicker|
00000ef0  2e 0d 0d 54 68 65 20 70  72 6f 67 72 61 6d 20 45  |...The program E|
00000f00  4e 43 4f 44 45 20 63 6f  6d 70 72 65 73 73 65 73  |NCODE compresses|
00000f10  20 74 68 65 20 74 65 78  74 20 66 69 6c 6f 20 61  | the text filo a|
00000f20  6e 64 20 69 73 20 61 20  42 41 53 49 43 20 0d 70  |nd is a BASIC .p|
00000f30  72 6f 67 72 61 6d 20 61  6e 64 10 73 6f 20 69 73  |rogram and.so is|
00000f40  20 72 61 74 68 65 72 20  73 6c 6f 77 2e 20 20 44  | rather slow.  D|
00000f50  45 43 4f 44 45 20 65 78  70 61 6e 64 73 20 61 20  |ECODE expands a |
00000f60  63 6f 6d 70 72 65 73 73  65 64 20 0d 66 69 6c 65  |compressed .file|
00000f70  20 61 6e 64 20 75 73 65  73 20 74 68 65 20 4d 2f  | and uses the M/|
00000f80  63 6f 64 65 10 66 69 6c  65 20 44 65 63 4d 2f 43  |code.file DecM/C|
00000f90  2e 20 20 44 65 63 4d 73  72 63 20 69 73 20 74 68  |.  DecMsrc is th|
00000fa0  65 20 0d 61 73 73 65 6d  62 6c 65 72 20 66 69 6c  |e .assembler fil|
00000fb0  65 20 66 6f 72 20 74 68  69 73 20 63 6f 64 65 2e  |e for this code.|
00000fc0  0d 0d 54 68 65 20 65 78  70 6c 61 6e 61 74 69 6f  |..The explanatio|
00000fd0  6e 20 69 6e 20 74 68 65  20 45 55 20 61 72 74 69  |n in the EU arti|
00000fe0  63 6c 65 20 69 73 20 72  61 74 68 65 72 20 64 65  |cle is rather de|
00000ff0  74 61 69 6c 65 64 20 62  75 74 20 74 6f 20 0d 67  |tailed but to .g|
00001000  69 76 65 20 61 20 62 72  69 65 66 10 69 64 65 61  |ive a brief.idea|
00001010  20 6f 66 20 68 6f 77 20  74 68 69 73 20 77 6f 72  | of how this wor|
00001020  6b 73 20 69 73 20 74 68  61 74 20 69 74 20 75 73  |ks is that it us|
00001030  65 73 20 74 68 65 20 76  61 6c 75 65 73 20 0d 6f  |es the values .o|
00001040  66 20 74 68 65 20 68 69  67 68 20 6e 69 62 62 6c  |f the high nibbl|
00001050  65 20 6f 66 20 61 10 62  79 74 65 20 67 72 65 61  |e of a.byte grea|
00001060  74 65 72 20 74 68 61 6e  20 37 20 66 6f 72 20 74  |ter than 7 for t|
00001070  68 65 20 37 20 6d 6f 73  74 20 0d 63 6f 6d 6d 6f  |he 7 most .commo|
00001080  6e 20 6c 65 74 74 65 72  73 20 2b 20 73 70 61 63  |n letters + spac|
00001090  65 20 77 68 69 63 68 20  61 72 65 20 68 65 6c 64  |e which are held|
000010a0  10 69 6e 20 74 68 65 20  73 74 72 69 6e 67 20 22  |.in the string "|
000010b0  20 0d 65 74 61 6f 6e 72  69 22 2e 20 20 54 68 65  | .etaonri".  The|
000010c0  73 65 20 63 68 61 72 61  63 74 65 72 73 20 61 72  |se characters ar|
000010d0  65 20 70 72 69 6e 74 65  64 20 75 73 69 6e 67 20  |e printed using |
000010e0  49 4e 53 54 52 20 61 6e  64 20 73 6f 10 62 79 20  |INSTR and so.by |
000010f0  0d 61 20 6e 69 62 62 6c  65 20 72 61 74 68 65 72  |.a nibble rather|
00001100  20 74 68 61 6e 20 61 20  62 79 74 65 20 61 6e 64  | than a byte and|
00001110  20 77 68 65 6e 20 74 68  65 20 6e 69 62 62 6c 65  | when the nibble|
00001120  73 20 61 72 65 20 70 61  69 72 65 64 20 75 70 20  |s are paired up |
00001130  0d 61 73 20 62 79 74 65  73 10 61 20 73 61 76 69  |.as bytes.a savi|
00001140  6e 67 20 6f 66 20 75 70  20 74 6f 20 32 30 20 74  |ng of up to 20 t|
00001150  6f 20 32 35 25 20 69 6e  20 6d 65 6d 6f 72 79 20  |o 25% in memory |
00001160  63 61 6e 20 62 65 20 6d  61 64 65 2e 0d           |can be made..|
0000116d
F/INTRO1.m0
F/INTRO1.m1
F/INTRO1.m2
F/INTRO1.m4
F/INTRO1.m5