text
stringlengths 0
99.6k
|
|---|
ARC VERSION 2.20 PAGE - 40
|
To read in a Huffman code, reset your test code to all
|
zeros, start at the beginning of the table, and shift in one
|
bit at a time from the squeezed file into the test code. The
|
Huffman input routine would be something like this:
|
test = 00000000 00000000 00000000
|
offset = 0
|
1.0 shift bit into test
|
1.1 if length(offset) < length of test then error
|
(can't happen)
|
if length(offset) > length of test then 1.0
|
if test=code(offset) then output ascii(offset)
|
and exit
|
offset=offset+1
|
if offset > number of codes then error
|
(can't happen)
|
goto 1.1
|
The routine works because no code can be a substring
|
of another code. That is, if one of the codes is "01" then
|
any other code starting with the bit sequence "01" cannot
|
occur.
|
This isn't the most efficient way to do it, but it
|
works! When a Huffman code that has the maximum length comes
|
in, the routine has to test each and every one of the codes
|
in the table! However, the most frequently occuring
|
characters in the file will occur near the beginning of the
|
table, so it isn't all that bad.
|
When un-squashing a file, you proceed exactly the same
|
way, except once you unsqueeze it you have to un-pack it as
|
well. The control character for packing is always $fe in
|
squashed or crunched files.
|
After the header, the crunched file appears as a
|
sequence of codes. The codes are originally 9 bits in length
|
and grow to a length of 12 bits. The special reserved code
|
of 256 appears as the end of file marker. Files that have
|
been crunched in one pass are identical to files that have
|
been crunched in two passes, except that the files length
|
and checksum will appear to be zero in the header for 1 pass
|
crunched files. If the file was crunched in one pass, then
|
the original length and checksum follow the end of file
|
marker.
|
** Preliminary Instructions **
|
For
|
D U A L L O G
|
By
|
Steve $ Shubitz
|
[75125,233]
|
This program is for use on the 4040
|
drive or it's dual drive eqivalent. It
|
is public domain and was originally
|
wriiten for the PET by an unknown
|
person. Dual Log is Public Domain and
|
may not be sold. This program is
|
designed to keep track of what disks
|
contain a certain file,disk ID's in use
|
and the ability to "crunch" your disk
|
collection.
|
Please start by Headering a new disk
|
and then copy Dual Log to this disk
|
under any name you wish. This disk
|
should be dicated to Dual Log and not
|
have any other programs on it. Next
|
just insert the disk in drive 0 (that's
|
zero) and Load"DUAL LOG",8. For this
|
program to work properly all file names
|
should be in uppercase only and disks
|
with "funny" directories should be
|
avoided.
|
You will know see the first of two
|
menues. If you select (1) you should
|
insert the disk to be logged in drive 1
|
and follow the prompts. The index file
|
and master file will be written to
|
drive 0. If you select (3) you may step
|
through all the disks on file by
|
tering "*" at the Enter Disk Name
|
prompt. If you select (4) and you are
|
looking for a program by the name of
|
"MR T'S SUPPORT" when you are prompted
|
for the file name to search for you
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.