Classic Computer Magazine Archive COMPUTE! ISSUE 87 / AUGUST 1987 / PAGE 87

Compress And Decompress

Jason Coleman

This pair of Apple II programs helps you store more hi-res picture files on a disk. ProDOS is required.

"Compress" and "Decompress" are two programs designed for use with hi-res graphics files for Apple II series computers using ProDOS. Their purposes are simple. Program 1, Compress, packs a hi-res picture file into a smaller space than normal. Program 2, Decompress, unpacks the picture.

Type in and save both programs. Program 1 is a BASIC program, while Program 2 is written in machine language and must be typed in with the "MLX" machine language entry program found elsewhere in this issue. Here are the addresses you need to enter Program 2 with MLX:

STARTING ADDRESS? 2000
ENDING ADDRESS? 2247

Program 1 handles the job of compressing a picture file, and it displays instructions for using both programs. When you run it, Program 1 prompts you through every step of the process of compressing a picture file. Simply follow the onscreen instructions.

Program 2 decompresses a previously compressed file. Use the following command to install the program:

BRUN DECOMPRESS

Next, activate the high-resolution graphics area with the following command:

HGR

Now whenever you want to load a compressed picture file, use a command of the following form:

DECOMPRESS filename, slot, drive, address

You must always supply a filename to tell this program which file to decompress. The remaining parameters are optional and need only be supplied if you wish to use a different slot, drive number, or load address. You may specify the load address in either decimal or hexadecimal (base 16) numbering. To specify a hexadecimal load address, put a dollar sign ($) in front of the address.