HP 95LX users can save disk space using the free DIET.EXE compression program. This article assumes some working knowledge of MS DOS.

By Mark Scardina

Introduction by Hal Goldstein

 Introduction: What is Data Compression?

 Storage space on the HP 95LX, like precious real estate, can be expensive and limited. The use of data compression programs can mean significant disk space savings on the HP 95LX's A drive and C drive.

 Data compression simply means storing the same information (data files and program files) in less space. For example, if we could reduce the size of every 1-2-3 or MEMO data file or our PHONE book 40%, we would have that much more space left over for other files. Similarly, if we wanted to run our favorite DOS application on the 95LX, it would be great to be able to reduce the size of its main .EXE or .COM file.

Exactly how data compression works is beyond the scope of this article. However, in general terms a data compression program "translates" the "normal" way a file is stored and encoded into a more efficient encoding scheme.

There are two significant disadvantages to data compression. First there is usually some performance penalty since a file must be decompressed before it can be used by an application. For example, 1-2-3 only knows about WK1 data files not compressed WK1 files. Therefore, somehow compressed WK1 files must be decompressed before Lotus can use them.

 Secondly, the compression/decompression program occupies some disk space. In addition, it usually requires extra disk space for temporary or permanent file storage. Some programs require extra system RAM to perform compression.

In most cases judicious use of compression techniques provide more benefits to 95LX users than detriments. Often, performance penalties are not significant on the 95LX. Most often, proper application of compression techniques results in significant disk space savings.

 There are a number of data compression techniques available, each with their unique advantages and disadvantages. Data compression techniques and approaches will be a continuing theme in The HP Palmtop Paper through the years.

 This article's author, Mark Scardina, is familiar with most common file compression approaches for MS DOS machines. He feels for generalized use, DIET.EXE* offers the best data compression approach for 95LX users (especially since DIET's author makes it available for free).

 Criteria for Using a Compression Program on the HP 95LX

 PC capacity has been increasing at a startling rate. We now have laptops with 16MB of RAM memory and 120MB hard drives, and the notebooks are closing fast. This huge capacity has allowed users to operate with little or no concern for space. Therefore, switching to the 95LX can be quite an experience for the user who demands more than an electronic organizer from the diminutive palmtop. This inevitably leads one to search for data compression programs to maximize the 95LX's available memory.

Since there is no specific compression software written for the 95LX, the first task in picking a utility is to define those qualities most desirable when used with the unique structure of the HP 95LX. The qualities of an ideal 95LX file compressor include the following:

  1. 1. To compress and decompress files automatically with a minimum of user intervention;
  2. 2. To compress and decompress data files created by DOS applications and by HP 95LX built-in software such as Lotus 1-2-3 and MEMO;
  3. 3. To compress application (.EXE, .COM, .EXM) files. (EXM files are "system compliant" software applications that work in con-junction with HP 95LX built-in software); and
  4. 4. To take up a minimum of system memory and disk space.



DIET.EXE on the HP 95LX

 One such program that meets these criteria to a large extent is DIET by Terry Matsumoto.

There are two files that come with the DIET program: DIET.EXE and DIET.DOC. Only DIET.EXE needs to be copied to the 95LX. This file requires 22K of disk space. The text manual for DIET is DIET.DOC. It should be printed for reference.

DIET can be used manually. However, its real power is in its ability to be memory resident, which lets it perform its operations automatically.

Let's first look at a few examples of using DIET manually. We assume you have already copied DIET.EXE to your C drive.

Diet compresses all types of files by using the command:

 diet [drive:][\path][file.exe]

EXAMPLE 1: Compress a program file:

  1. 1. Enter DOS. (Do so by closing all your built-in 95LX applications except FILER and pressing <MENU> system.
  2. 2. Suppose you have an 80K software application file named ROLODEX.EXE on the C drive. Issue the command:



diet rolodex.exe

 DIET then displays a message that it is doing its thing. When it finishes, you'll see a message telling you how much it was able to compress ROLODEX.EXE. The good news about compressing .EXE or .COM files is that once you compress them you do not need DIET.EXE. ROLODEX.EXE, now, say 50K, executes just as before (perhaps takes a half second longer to load while it first decompresses itself).

 EXAMPLE 2: Compress data files:

 Standard DOS Command LINE options such as wildcards (* and ?) are available. For example, let's "diet" the files in your \_dat directory.

  1. 1. Enter DOS as before.
  2. 2. Type dir and make note of how many "bytes free."
  3. 3. Type diet c:\_dat\*.* and press <ENTER>. You will now see DIET in action as it compresses.



You may want to repeat this command in any other directory where you store 1-2-3 WK1 files (i.e. diet c:\*.wk1) since compressing 1-2-3 files can save a lot of disk space.
  1. 4.Type dir again and see how many bytes you have saved.



DIET has several command line options that are discussed in detail in the documentation. If DIET returns a suggestion to try the -v or -i option on a file, you may be able to compress it, but you will need room for a temporary file its original size. If this happens to be a large file, you may be better off leaving it uncompressed to give you a net savings in disk space. The temporary files created by DIET during operation (named __DIET__.*) are usually deleted automatically, but if you find them these files can be safely deleted.

 DIET becomes most useful on the HP 95LX when it is used as a memory resident application. See the sidebar for the particular memory resident installation instructions of DIET on the HP 95LX.

Once installed, DIET will automatically re-compress previously compressed files. This includes built-in software data files such as Lotus .WK1 files, MEMO .TXT files, and HPCALC .EQN files. It even compresses system compliant executable .EXM files.

 Files automatically get recompressed only if DIET initially compressed them. In other words if you create a new 1-2-3 file named BUDGET.WK1, you must first enter DOS and then type diet budget.wk1 before gaining any compression advantages. Once a file has been DIETed, it will automatically be recompressed under the following condition. If you are in DOS and a data file is already DIETed, it will be recompressed automatically when the DOS application saves it. If you are running one of the built-in programs such as 1-2-3 or MEMO and save a DIETed file, at first the file will not be recompressed. However when you enter DOS and run any program (i.e. CHKDSK) the file will automatically get recompressed.

 Therefore, you might create a simple batch file that you run from FILER periodically using the RUN command (press F4 from FILER. The file (named, say, COMPRESS.BAT) could contain the following lines:

 diet c:\_dat\*.txt

 diet c:\*.wk1

 The first command line above would compress any new MEMO .TXT files in the _DAT subdirectory. The second command line would compress all 1-2-3 .WK1 files in the root directory. At the same time any built-in software data files waiting to be compressed would get compressed automatically no matter in what subdirectory on what disk drive they reside.

 Problems Using DIET

 Possible problems in using DIET usually can be traced to three areas:

  1. 1. NOT ENOUGH DISK SPACE -- If the HP 95LX beeps during a program load and the program doesn't start, or indicates it can't load a file, that is an indication that there is not enough disk space for DIET to do its work. This usually occurs if DIET needs to create temporary files. The solution is to make more space, or un-compress the offending file (enter the command diet -ra).
  2. 2.USING TRANSFERRED COMPRESSED FILES -- If your program is unable to run or has trouble opening a file, try un-compressing the offending file (enter diet -ra) and re-compressing it on the 95LX. If this is still unsuccessful use the SET command. For example, let's say the program you are having difficulty running is ROLODEX.EXE, you would use the command:



set dietsize=rolodex.exe

 before launching ROLODEX.EXE. You could also put the above SET command in your AUTOEXEC.BAT file.

 In copying files with DOS COPY, DIET, if resident, will un-compress the files first. If you would like them to remain compressed, issue the command:

 diet -c <destination> <filenames>.

3. INSUFFICIENT SYSTEM RAM MEMORY--Finally, in our experimentation we find you need at least 170K of System RAM in DOS for DIET to run smoothly. If you receive an "In-sufficient memory" error, use CHKDSK to determine how much System RAM you have. Then return to SYSMGR and use the SETUP function (<Shift>-<FILER>) to increase your memory. An extra 24K of system RAM is used by DIET to remain memory resident. We will be interest-ed in reports from other users as to how much total system RAM they need.

 In creating your strategy for using DIET, you should keep the following guidelines in mind:

First, DIET is as efficient as the best compression utilities available. This also means that it will slow down the loading and unloading of your programs. Speed this process by selectively DIETing your files.

Second, anytime DIET requires a temporary file, that disk space (the original uncompressed file size) cannot be used while the program is running. Therefore, you have to decide whether DIETing that file gives you a net saving in disk space, as it takes up in disk space its compressed plus original size.

A Final Warning

 I have used DIET for over a month without major problems. However, backing up your files to a PC on a regular basis is always a good idea. It's especially a good idea while you gain experience and confidence in using DIET.

 This approach is experimental, and although it seems to be very effective, you should use it at your own risk. If you have problems, or find ways of improving this technique, please send me or Hal Goldstein a CompuServe message, or write The HP Palmtop Paper.


 To many people the 95LX's memory limitations may seem a throwback to the days of the original IBM XT. What they need to consider is the efficient compression software developed by many clever programmers since then. Hewlett-Packard's internal code name for the HP 95LX was JAGUAR, and it seems only fitting to use a program called DIET to keep it "lean and mean."

 Ordering Information

 DIET is free and available on many public bulletin boards or on CompuServe. On CompuServe you can find it in the IBMSYS forum, File Utilities Library. As of September, 1991 it was named DIET12.EXE. To extract DIET.EXE and DIET.DOC type diet12 from the DOS prompt. The copy of DIET.EXE used for this article was dated 8/20/91.

Palmtop Paper subscribers will receive DIET.EXE at no charge on the 1992 Palmtop Paper Subscribers Disk sent with Volume 1., No 2. issue (March/April 1992).

 Finally, Palmtop Paper subscribers may obtain DIET.EXE as part of The HP Palmtop Paper On Disk, Issue 1. See page 36 for a description of this service.

Installing DIET.EXE on the HP 95LX