Space Compression

INMEMO uses two different space compression algorithms to minimize the storage requirements. In memos created by INMEMO version 1.x, instead of storing N contiguous spaces in N bytes, they were compressed into one byte with the value 128+N. Up to 127 contiguous spaces could be compressed into one byte this way.

As of INMEMO version 2.0, we can no longer use byte values 128-255 for space compression because we now support the full eight-bit Latin-1 character symbol set. Instead, another algorithm is used in which blocks of contiguous spaces are represented with two bytes; the first is always value 2 (chr$(2) and the 2nd is the number of spaces to represent.

In order to allow INMEMO 2.0 to be able to read memos written in the earlier format, a special flag (chr$(1) is written to the memo in advance of any true characters which require the 8th bit. When a memo is read from disk and a byte whose value is greater than 127 is encountered, INMEMO 2.0 can tell whether it is a Latin-1 character or an old-style compressed space by checking if the eight-bit flag byte has been read. All new memos are written with the new space algorithm. Note that the new DMPMMO utility displays an indication of which version of INMEMO was used to write the memo being dumped.

Space compression is transparent to both the operator and the programmer. The spaces are automatically expanded whenever they are displayed or returned. Old-style memos are automatically converted to the new format whenever they are updated by INMEMO 2.0.