Compression and Archiving on CP/M

  /     /   CP/M     Retro    

CP/M has the ability to handle lots of different compression and archive formats which was important due to the limited capacity of floppy disks and the cost of downloading/uploading files on BBS's. They each have their pros and cons and this article will explore some of the most common ones and where you can find programs on the Walnut Creek CD to handle them.

Compression Only

The first compression formats on CP/M only compressed single files and would change the middle letter of the file extension to signify that the file had been compressed.

.?Q?
Squeeze was an early compression format that used Huffman encoding to compress files. These can be squeezed (compressed) with sq and unsqueezed (decompressed) with usq.
.?Z?
Crunch brought LZW compression to CP/M and these files can be handled with crunch.
.?Y?
These files, using LHA compression, were relatively uncommon. They can be handled with crlzh or my favourite for just decompressing is uncr.

Archive Only

.LBR
LBR was an early CP/M format that allowed you to combine multiple files into a single archive. These files would have often been compressed with tools such as squeeze or crunch. Because it was so common it was well supported by other tools such as QL, LRUN, LSWEEP and others which can look into a .LBR archive and use individual files without having to separately extract first. These files can be handled using nulu or if you just want to extract files, delbr.

Multiple File Archives with Compression

Later on CP/M adopted formats from other platforms, such as MS-DOS, which integrated file compression and archiving into a single format.

Compress and Decompress

.ARC/.ARK
This is the most common compressed archive format on CP/M. Internally it analyses each file which it is asked to compress and tries to find the best compression method such as squeeze, crunch, etc. It can be decompressed using unarc or created using arc.
.LZH/LHA
A common format at one time on MS-DOS and still is on the Amiga. These can handled using crlzh.
.PMA
This is a variant of LHA and as far as I'm aware was only used on CP/M. These files can be handled using PMarc.

Decompress Only

CP/M can also decompress formats that were common on other platforms such as MS-DOS and Windows and in the case of .ZIP still is. They can't be created under CP/M but it is useful to be able to decompress them so that you can read files created on other systems.

.ZIP
This is probably the most common modern day format and can be decompressed with unzip.
.ARJ
This was pretty common at one time but got overtaken by .ZIP. To decompress use unarj.

Self-Extracting Archives

The PMarc tool mentioned above can also create self-extracting .com files. Which made it really easy to distribute multiple files, but this does add extra overhead and reduce flexibility.

Benchmarks

The various compression formats produce different results. To compare them I have taken some of the most common and used them to compress two files: ED.COM and TAO.TXT. These files can be seen in the first two rows of the table followed by various compressed versions of them.

FilenameSize (Kb)Size (Records)
ED.COM 10 73 Original binary file (CP/M Plus Editor)
TAO.TXT 27 214 Original text file
ED.CQM 8 63 Squeezed version of ED.COM
TAO.TQT 14 110 Squeezed version of TAO.TXT
ED.CZM 7 54 Crunched version of ED.COM
TAO.TZT 11 86 Crunched version of TAO.TXT
BOTH.LBR 36 288 LBR archive containing files: ED.COM and TAO.TXT (no compression)
BOTHS.LBR 22 174 LBR archive containing files: ED.CQM and TAO.TQT (squeezed)
BOTHC.LBR 18 141 LBR archive containing files: ED.CZM and TAO.TZT (crunched)
ED.ARK 7 56 Ark version of ED.COM (Ark crunched this file)
TAO.ARK 11 88 Ark version of TAO.TXT (Ark crunched this file)
BOTH.ARK 18 142 Ark version containing files: ED.COM and TAO.TXT (Ark crunched both files)

Video of Compression and Archiving Tools

You can see some of the tools in action below.

Creative Commons License
Compression and Archiving on CP/M by Lawrence Woodman is licensed under a Creative Commons Attribution 4.0 International License.

Related Articles

Text Viewers on CP/M

There are lots of text viewers on CP/M and I want to show the three that I use most often. I have recently been going through the Walnut Creek CD to see if I can find any better text viewers, but afte...   Read More

Write Hand Man - CP/M's Answer to Sidekick

CP/M is a single tasking operating system and having grown-up with single tasking systems this has never really been a problem for me. There is style of program that would make my life easier, however...   Read More

If Only Borland Had Stuck With Turbo Modula-2 For CP/M

I have written previously about why Turbo Pascal is a Great Choice For Programming Under CP/M and now it is time to talk about what could have been. You probably haven't heard of Turbo Modula-2 for CP...   Read More

Turbo Pascal: A Great Choice For Programming Under CP/M

CP/M was blessed with many programming languages, each with their own strengths and weaknesses. I think that Turbo Pascal stands out from these and I'm not alone. When Turbo Pascal was released in 19...   Read More

Installing the HI-TECH Z80 C Compiler for CP/M

My language of choice is C and I am currently getting more involved with the CP/M operating system. I have therefore decided that it would be nice to have a C compiler working under CP/M. There are a...   Read More

Sign up to get new articles straight to your inbox.

Delivered by FeedBurner

Comments

blog comments powered by Disqus