The Kruncher

See all articles from T-S Horizons n21
REVIEW:          THE KRUNCHER
PROGRAM TYPE:    Program-Compression Utility
PRICE:           $9.95 (2068 VERSION)
AVAILABLE FROM:  RMG ENTERPRISES
                 1419 1/2 7TH ST
                 OREGON CITY, OR 97045

Picture this; You’ve been working on THE program of all time; one that makes life easier, delivers world peace, AND cures the Common Cold. You’re just putting the finishing touches on the last few lines, when…

OH NO! “Out of Memory” appears on the bottom of the screen. What do you do? Well there have been many articles written with tips on how to save memory in a program, like:

  • Replace 1 with SGN PI.
  • Replace 0 with NOT PI.
  • Use of VAL statements for numerical values (Ex: LET X=VAL “6” instead of LET X = 6.)

You could go through your entire program, using these memory-cutting tips, taking valuable time, and possibly losing your creative train of thought.

OR. . . you could let THE KRUNCHER do it for you in a matter of seconds.

THE KRUNCHER is a new machine code, utility program from S&K Enterprises (distributed by RMG Enterprises). THE KRUNCHER code is totally relocatable, and virtually transparent to the user (except when activated).

Using THE KRUNCHER is simple. LOAD the program, and follow the prompts. Select the memory location for THE KRUNCHER to reside (I usually use 64000), and then the program resets the computer with the code ready to use.

Then, either LOAD a program you wish to compress, or type in a new one. When you are ready for THE KRUNCHER to do its job, use the command:

RAND USR xxxx
(xxxx = memory location you selected)

THE KRUNCHER then goes to work, shaving off bytes of your program! As an example I have included two listings of a program – Colorchart – that prints a screen display like that shown below.

Prog:colorchart (original)
Bytes Free: 37854

5 INK 0: PAPER 7: BORDER 7: CLS
10 FOR c=0 TO 7
20 FOR i=9 TO 12
30 PRINT BRIGHT 1; PAPER c;AT i,c*4;" "
40 NEXT i
50 PRINT BRIGHT 1; PAPER 8; INK 9;AT 12,c*4;c
60 NEXT c
100 PRINT AT 13,0
110 FOR v=0 TO 1
120 FOR h=32 TO 143: PRINT INVERSE v;CHR$ h;: NEXT h
130 PRINT
140 NEXT v
200 LET yc=143
210 CIRCLE 108,yc,10: CIRCLE 128,yc,15: CIRCLE 148,yc,10
220 FOR x=0 TO 12 STEP 3
230 PLOT x,175: DRAW 0,-63
240 PLOT x+243,175: DRAW 0,-63
250 NEXT x
260 FOR y=112 TO 124 STEP 3
270 PLOT 0,y: DRAW 255,0
280 PLOT 0,y+51: DRAW 255,0
290 NEXT y
300 PRINT AT 2,2;"Mountaineer";AT 5,22;"Software"
Colorchart screen display
Colorchart screen display
Prog:colorchart (KRUNCHER)
Bytes Free: 38039

5 INK NOT PI: PAPER VAL "7": BORDER VAL "7": CLS
10 FOR c=NOT PI TO VAL "7"
20 FOR i=VAL "9" TO VAL "12"
30 PRINT BRIGHT SGN PI; PAPER c;AT i,c*VAL "4";" "
40 NEXT i
50 PRINT BRIGHT SGN PI; PAPER VAL "8"; INK VAL "9";AT VAL "12",c*VAL "4";c
60 NEXT c
100 PRINT AT VAL "13",NOT PI
110 FOR v=NOT PI TO SGN PI
120 FOR h=VAL "32" TO VAL "143": PRINT INVERSE v;CHR$ h;: NEXT h
130 PRINT
140 NEXT v
200 LET yc=VAL "143"
210 CIRCLE VAL "108",yc,VAL "10": CIRCLE VAL "128",yc,VAL "15": CIRCLE VAL "148",yc,VAL "10"
220 FOR x=NOT PI TO VAL "12" STEP INT PI
230 PLOT x,VAL "175": DRAW NOT PI,VAL "-63"
240 PLOT x+VAL "243",VAL "175": DRAW NOT PI,VAL "-63"
250 NEXT x
260 FOR y=VAL "112" TO VAL "124" STEP INT PI
270 PLOT NOT PI,y: DRAW VAL "255",NOT PI
280 PLOT NOT PI,y+VAL "51": DRAW VAL "255",NOT PI
290 NEXT y
300 PRINT AT VAL "2",VAL "2";"Mountaineer";AT VAL "5",VAL "22";"Software"

Notice the differences between the listings. Even though THE KRUNCHER listing seems longer, it uses 185 fewer bytes! Imagine what you’ll save on a longer program!

THE KRUNCHER is a very useful utility for any serious programmer, and is availble for both the TS2068 and TS1000/1500/ZX81.