>RM=65>C=YTRASHMAN>C=NPURPOSE     TRASHMAN is a machine language utility for the MODS I & III.  It reduces string compression time by 95% or more.  This utility needs 578 bytes of memory, plus 2 bytes for each active string.  It can be employed with all major operating systems and with most other machine language programs.  NOT intended for CP/M systems.BACKGROUND     When a string variable changes a new place in memory is created for the new string and the old one is left where it was, i.e. it doesn't overwrite because the length may change etc.  With a large number of strings, memory gets used up, and the computer apparently stops running, sometimes for several minutes.  The keyboard doesn't work until all of the old strings have been collected and removed and the new strings have been compressed.  With a basic program which adds strings continuously, such as a program to read disk directories for sorting and printing, as the file gets large, compression occurs more often and lasts for as long as 10 minutes.     With 250 strings, the normal compression or 'garbage collection time is 11.8 seconds, with TM/CMD incorporated into your program, the delay is .7 seconds.  With 2000 strings, the normal garbage collection time is 713.2 seconds (11.8 minutes) while with TM/CMD installed, the time is only 7.8 seconds.HOW TO USE     1.  At DOS READY, type 'TM' and hit <E>.  Write down the address it displays.  With a 48K machine and no other high memory machine language routine, the address will be -578.  (If you are using other high-memory programs which are loaded by the basic program, call 'TM' last.  It moves itself directly below your other programs, writes a new HIMEM address, and displays a new address for you).     2.  Call BASIC and set memory size. (65535-578=64957).     3.  You must inform the program (TRASHMAN) as to how much space to reserve for string compression.  Should be done at the beginning of your program.  Two bytes are required for each active string.  The line of code necessary to add to your BASIC program is:     1 DEFUSR = -578: X = USR(400) : IF X <> 0 THEN STOP     a.  The numbers -578 and 400 are just examples.  If the address you noted in step 1 wasn't '-578' then use the value found.  The number 400 should be replaced by the appropriate value for the number of strings in the program. In this connection, better to overestimate than to underestimate.  If you give too large a number, and there is not enough space available, the program will stop on STOP.  If this occurs, try a new number (smaller).RUNNING YOUR PROGRAM     Run your BASIC program with TRASHMAN and if you know where the delays normally are due to normal gargage collection, you will see the difference.  If you don't get a difference, probably you didn't allocate enough space.  MUST have two bytes for each active string, and that seperate elements of a string array counts seperately.  Since Basic starts its elements at zero, not 1, the following creates 303 strings, NOT 200: DIM A$(100,2).     TRASHMAN cannot tell whether you've requested enough space until it scans for currently-active strings.  If there isn't enough space, it lets the computer do normal, slow compression.     If you request too much space: (1) you may get and 'OUT OF MEMORY' or 'OUT OF STRING SPACE' error message, or (2) the wasted space will cause string compression to occur more often than necessary.  In the second case, the program speed will be good but probably not as good as it should be.  ANSWER: adjust the space request.DISCUSSIONMemory Effect.     Trashman clears 50 at its inception.  This destroys all active variable.  If the space allocation is performed right after BASIC is called, no problem, but if called in the middle of program execution (run) all variables up to that point will be cleared.  Thus chaining programs while retaining active variables is incompatible with new requests for space in TRASHMAN.     SOLUTION:  Just issue the maximum space requirement as soon as BASIC is started, and do NOT make further requests until the next time BASIC is called.Using With Several BASIC Programs:     The space allocation request only has to be redone if it has to be changed.  It will carry through for all programs run while basic is active (i.e. until DOS is re-entered or RESET is pressed).Using Modified Programs W/O TRASHMAN     The added line of code causes BASIC to pass control to a specified address in memory (e.g. -578).  If the TRASHMAN command wasn't issued in DOS before this id done, nothing will be at that address, and the Basic program that you are attempting to run will "go down in flames".  Probably easiest way is to use the AUTO command or write a JCL program to cause this to occur right at the beginning after boot.Info returned from TRASHMAN     The space request by TRASHMAN allocates space just below "HIMEM", and the values in HIMEM for DOS and BASIC are updated.  If there isn't enough space for the new request, nothing will change and the value returned ('X' in the example line above, will be set to '1' or '2' ( 1= not enough space available; 2=HIMEM was changed, so additional space cannot be allocated)     TRASHMAN SHOULD BE THE LAST COMMAND ENTERED PRIOR TO CALLING BASIC.Determining How much Space is Already Allocated     If the space request value is "-1", the amount of space currently allocated will be returned, but 'CLEAR' 50 won't be issued:     1 DEFUSR=-578:PRINT USR(-1)Deactivating TRASHMAN     To temporarily suppress TRASHMAN, request zero space:            1 DEFUSR = -578: X=USR(0)     Later, another space request can be made to bring TRASHMAN back into play.     To completely remove TRASHMAN from memory, specify '-2'.:  1 DEFUSR = -578:X=USR(-2)When this is done, TRASHMAN will disengage itself from BASIC, and if possible will restore 'HIMEM' to the value it had before the TRASHMAN command was issued in the first place, unless changed by another program AFTER TRASHMAN started.                                                     