home *** CD-ROM | disk | FTP | other *** search
- !Shrink_PD - a Public Domain BASIC program compactor
- ====================================================
-
- The purpose of !Shrink_PD is to provide a simple method
- of squashing BASIC programs by the usual methods of
- shortening variable/procedure/function names, deleting
- blank lines, REMs and spaces and concatenating lines (ie
- joining them together!).
-
- The procedure to squash a BASIC program is then:
-
- 1) Load the !Shrink_PD if it is not already loaded. It
- will appear on the icon bar.
- 2) The main options window may be opened by clicking on
- the icon.
- 3) Drag the BASIC file either to the icon on the icon-bar
- or to the main options window. If the main options
- window is not open then it will opened automatically.
- 4) Amend the filename to save the squashed as and/or drag
- the file to the destination directory, or just click
- OK to overwrite the original program.
- 5) Wait while the program is squashed.
-
- Notes for Public Domain version 1.01
-
- i) The 'Other options' radio icon is non-functional, use
- the window's 'toggle size icon' instead to access
- and modify the other options.
- ii) The 'Save options' button is non-functional.
- iii) The 'Concatenate lines' option is non-functional.
- iv) The 'Multi-task' option is non-functional.
-
- ----------------------------------------------------------
- OPTIONS
- -------
- c : concatenate lines : not implemented
- l : remove blank lines : implemented fully
- -p <str>: don't shorten if start <str> : implemented fully
- r : remove REM statements : implemented fully
- * : remove *| statements : implemented fully
- s : remove spaces : implemented fully
- -v : verbose : implemented
- A : ASC("<char>") -> <number> : implemented fully
- D : affect DATA statements : implemented fully
- F : shorten function names : implemented fully
- I : represent integers shortest : implemented fully
- M : multi-task : not implemented
- P : shorten procedure names : implemented fully
- S : SYS "<name>" -> SYS <number> : implemented fully
- V : shorten variable names : implemented fully
-
- Concatenating lines
- -------------------
- By default lines within a program are joined together
- wherever possible. Exceptions include lines which are
- referenced by GOTO,GOSUB,etc. statements, DATA statements
- and comments.
- Use -c to prevent lines from being concatenated.
-
- Blank lines
- -----------
- By default blank lines within a program (whether blank
- to begin with or becoming blank during shrinking) are
- removed. The exception to this are those lines which are
- directly referenced in GOTO and RESTORE statements as a
- tokenised line number.
- Use -l to prevent blank lines from being deleted.
-
- Preserving names
- ----------------
- Use -p followed by a string of characters which
- represents the start sequence of characters of variable/
- procedure/function names which are not to be shortened.
- This is useful if you are using libraries and don't want
- names starting with '_Wimp', for example, being shortened
- as they reference variable names and procedure/function
- calls to those libraries.
- example: using -p _Wimp
- 10 PROC_Wimp_InitTask
- 20 PROC_MyInit
- becomes: 10 PROC_Wimp_InitTask
- 20 PROCA
-
- REM statements
- --------------
- By default a REM and all following text on that line is
- removed.
- Use -r to prevent REM statements from being deleted.
-
- *| statements
- -------------
- These are the equivalent of a REM but for a star command
- instead. By default a *| and all following text on that
- line is removed.
- Use -* to prevent *| statements from being deleted.
-
- Spaces
- ------
- By default all unnecessary spaces within a line are
- removed.
- Use -s to prevent spaces from being deleted.
-
- Progress display
- ----------------
- By default there is no output from !Shrink. Use -v to
- switch the 'verbose' option on. This displays the progess
- of the compaction on the BASIC file. There are three
- passes, and on each pass the line number currently being
- processed is displayed.
-
- Converting ASC("<char>") to a number
- ------------------------------------
- By default whenever the token ASC occurs on a line, an
- attempt will be made to evaluate it. !Shrink can handle
- both ASC"<char>" and ASC("<char>"), and if there is more
- than one character between the doubele quotes, then only
- the first character is used, the others being ignored.
- Use -A to prevent the token ASC being evaluated.
- example: 10 space = ASC" "
- becomes: 10 space = 32
-
- DATA statements
- ---------------
- By default the text following a DATA keyword is treated
- as though it were on a 'normal' line, and is shrunk as
- dictated by the other options. The exception to this is
- that on the first pass (when creating the name tables), no
- attempt will be made to parse the DATA line, so only names
- which occur on 'normal' lines and on the DATA line are
- shrunk (is requested), all other names are left as found.
- Use -D to prevent the DATA line being affected.
- example: 10 var_names = 2
- 20 DATA var_names,"Fred",Jim
- becomes: 10 A = 2
- 20 DATA A,"Fred",Jim
-
- Function names
- --------------
- By default function names are shortened.
- Use -F to prevent function names from being shortened.
-
- Integers
- --------
- By default any integer (binary, decimal or hex) numbers
- are converted to their shortest form. This is done by
- representing numbers from 0 to 99999999 in decimal and
- numbers geater than 99999999 in hex.
- Use -I to prevent integers from being converted.
- example: 10 big_number = 199999999
- 20 small_number = &10
- 30 binary_value = %1111
- becomes: 10 big_number = &BEBC1FF
- 20 small_number = 16
- 30 binary_value = 15
-
- Procedure names
- ---------------
- By default procedure names are shortened.
- Use -P to prevent procedure names from being shortened.
-
- Converting SYS "<name>" to a SYS <number>
- -----------------------------------------
- By default whenever the token SYS occurs on a line, and
- it is followed by a string, the string is passed to the
- OS through OS_SWINumberFromString. If valid, the string
- will be replaced by the relevant number.
- Note that you may have to load in a module that contains
- swi's before using !BasShrink, so that all swi names are
- recognised.
- Use -S to prevent the name being converted to a number.
- example: 10 SYS "OS_WriteN"
- becomes: 10 SYS 70
-
- Variable names
- --------------
- By default variable names are shortened.
- Use -V to prevent variable names from being shortened.
-
- ----------------------------------------------------------
- HISTORY
- -------
- Version 0.21 : 10-Jul-91
- What !BasShrink will do:
- * Variable/FN/PROC names are shortened
- * Blank lines are removed
- * Preserving names using the -p <str> option
- * REM and *| statements are removed
- * Unnecessary spaces are removed
- * Representing integers as their shortest form
-
- Version 0.22 : 11-Jul-91
- Bug fix: Blank lines, colons at end of line and assembly
- language comments now handled correctly.
- Rewrite: The integer conversion routine now uses SWIs.
-
- Version 0.23 : 12-Jul-91
- ARMcode: The function getName.
- Bug fix: BASIC keyword ASC valid in assembly language.
- Bug fix: in procedure addStringToLine
- Bug fix: Some comments were left in assembly language.
-
- Version 0.24 : 12-Jul-91
- Rewrite: Tidying up the code which shrinks the lines.
- Bug fix: Removing spaces between integer variable names.
-
- Version 0.25 : 13-Jul-91
- SWI name to number now works (are you happy now Mark!).
- Bug fix: A bug was introduced when decoding ASC keyword.
-
- Version 0.26 : 15-Jul-91
- ARMcode: Building short name from its index position.
- Rewrite: Tidying up code dealing with variable names.
- Problem: Decoding mnemonic TEQ doesn't work properly.
-
- Version 0.27 : 16-Jul-91
- As a fudge, 'T' is considered as a mnemonic instruction.
- ARMcode: Searching for a name in the linked list.
- Bug fix: No terminating double quote gave an error.
-
- Version 0.28 : 23-Jul-91
- Bug fix: More BASIC keywords allowable in assembler.
- Bug fix: Blank lines not removed if referenced by GOTO.
-
- Version 0.29 : 23-Jul-91
- ARMcode: Functions AddName and FindLineNumber.
- Rewrite: CASE statement for checking assembly language.
- Rewrite: The routines which create the name tables.
-
- Version 0.30 : 28-Jul-91
- Bug fix: Decimal numbers beginning with a decimal point.
- Problem: Certain assembler mnemonics are not recognised.
- Update : If first line of program begins with REM, then
- ' ¤¤¤ Squished by Lofty's !Shrink vsn <vsn> on <date> ¤¤¤'
- is added to the end of that line.
- The option 'ASC"<char>" -> number' has been implemented.
-
- Version 0.31 : 31-Jul-91
- The option 'affect DATA' has been implemented.
-
- Version 0.32 : 02-Aug-91
- Update : The first line is only amended now if the line
- is a REM and does not already contain '¤¤¤...'.
-
- Version 0.33 : 09-Aug-91
- Bug fix: Tokens are now fully recognised within assembly
- language.
- Rewrite: The routines which shorten lines.
-
- Version 0.34 : 10-Aug-91
- Update : The first line is updated with '¤¤¤...', with
- the previous '¤¤¤...' being removed if present.
-
- Version 1.00 : 12-Aug-91
- Public Domain version ready for release.
-
- Version 1.01 : 28-Aug-91
- Update : The templates and icons for the front-end.
-
- ----------------------------------------------------------
-
- COPYRIGHT
- ---------
- !Shrink_PD and !BasShrink are designed and written by
- John 'Lofty' Wallace, with help from Mark Bright and
- Stuart Hickinbottom.
-
- Version 1 of this program has been placed into the public
- domain. It may be freely copied and distributed for non-
- profit making purposes (a small charge to cover cost of
- distribution is allowed, however), so long as the code is
- not altered (apart from customising !Run/!Boot files) and
- this text file remains present and unaltered.
-
- The source code remains copyright © John Wallace and
- Architype Software, 1991.
-
- Version 2 of !BasShrink, which allows concatenation of
- lines, is available at £5.00 (this includes the full
- source code).
-
- Version 3 of !BasShrink will soon be available, which will
- multi-task under the desktop. This will be £5.00, with a
- discount of £2.50 for version 2 owners.
-
- Due to the continued development of !BasShrink, there will
- be new versions made available from time to time (for both
- version 2 and 3). Registered users will be notified of
- major new releases and can receive the latest version by
- sending a formatted disc and a cheque for £1.00 (to cover
- adminstration and P&P costs).
-
- End User Licence Conditions
- ---------------------------
- 'Software' refers to the source code for all versions of
- !BasShrink, !Shrink_PD and related software.
- 'User' refers to the person who has purchased the
- software.
- The conditions of use are:
- 1. Only the User may use the Software, and must not make
- the Software available to any third party by way of gift
- or loan or hire.
- 2. Sections of the Software can only be included within
- PUBLIC DOMAIN programs written by the User, and they must
- include in a readme file these End User Licence Conditions
- stating clearly which sections of the User's program the
- conditions covers (ie those taken from the Software).
- 3. If the User wishes to include sections of the
- Software in programs they wish to sell, permission must
- be sort from Architype Software (by writing to the address
- below) for a distribution licence.
- 4. No liability will be accepted by John Wallace or
- Architype Software for the suitability of the software for
- any purpose or for any loss due to the use or mis-use of
- the Software.
-
- If you have any queries/suggestions then write to:
-
- John Wallace
- Architype Software
- 54 Parkes Hall Road
- Woodsetton
- Dudley
- West Midlands
- DY1 3SR
-