Dec 072017
 
GS - BASIC Optimizing Utilities. Will unnumber and renumber source.
File GS-XXXXX.ZIP from The Programmer’s Corner in
Category BASIC Language
GS – BASIC Optimizing Utilities. Will unnumber and renumber source.
File Name File Size Zip Size Zip Type
GS-RENUM.EXE 20096 10820 deflated
GS-UNNUM.EXE 31488 15466 deflated
GS-VAREN.EXE 30720 14625 deflated
GS-XXXXX.1ST 667 332 deflated
GS-XXXXX.DOC 17664 5543 deflated
TPCREAD.ME 199 165 deflated

Download File GS-XXXXX.ZIP Here

Contents of the GS-XXXXX.DOC file



















Documentation for:

GS-UNNUM.EXE version 5.00
GS-RENUM.EXE version 3.10
GS-VAREN.EXE version 2.10

All programs written by Charles B. Gilmore

All programs - (C)Copyright GILMORE SYSTEMS, 1984, 1985
____
| |
| GS |
|____|

GILMORE SYSTEMS
BOX 511
NUTTING LAKE, MASS. 01865
Ph 617/646-3542

You are hereby granted a license to use, share, copy, and distribute
these three programs and this documentation, provided that this notice,
and the Copyright information is not removed or altered in any way from
this notice or accompanying programs. No fee or consideration is to be
charged for the distribution. These three programs are provided on an
AS-IS basis without warranty of any kind expressed or implied.
The entire risk as to quality and performance of these programs rests
solely with the user. In no event will Gilmore Systems be liable to you
for any damages, consequential or inconsequential. By operating any of
the above programs, you acknowledge you have read and understand this
agreement and agree to be bound by its terms and conditions.



GS - BASIC Optimizing Utilities Page 1
Background Information


Being a software developer, I wrote my first commercial program for
the IBM personal computer in compiled BASIC. Little did I know that
it would be a nightmare. Being used to mainframe systems with
hardly any memory limitations, I started coding away. Everything
went fine until the program was in its final stages and just a few
more modifications and enhancements were added. All of a sudden, the
nightmare begins with the BASIC compiler - Out of workspace, "Too
Complex", and other error messages from the compiler not only made
it impossible to add anymore code, but nearly impossible to fix what
was already written! More time was spent getting the program to compile
than it was writing it (About 1000 lines of packed code)! As a spinoff
for writing the programs, I had to write new utility programs to
Un-number the program from any non-referenced lines to get it to
compile with the "/N" option. To make a long story short, I found many
tricks to cut down on compiler problems, and to cut down on the
resultant '.EXE' size:

- EVERY byte of source code uses compiler workspace,
including comments! Although comments aren't used
by the compiler except for metacommands, they indeed
take up workspace. The more bytes of source code, the
more workspace used up - this includes variable names.

- Branching to a comment is a branch to an unecessary
line number - more space used not only in bytes, but
in the compiler's table for line numbers.

- The code generated from a "RETURN" from a gosub takes
more bytes in the resultant '.EXE' than a "GOTO", hence -
larger executable file size, and longer load time. This
was in bad need of optimization.

The solution was to switch to a different language from that point on.
Unfortunately, I had invested too much time and effort into that
particular program to do that, so I wrote 3 utility programs that
would produce an intermediate BASIC source file prior to compiling,
and also re-number this intermediate file so that it may be run in
the interpreter along with savings in interpreter workspace.

The use of the device driver ANSI.SYS is no longer required. All of
the version numbers of these programs have been incremented by 1 to
reflect this change. This is in preparation for running under the
Topview environment since Topview does not support ANSI.SYS. If you will
be running under the Topview environment, please contact us for
information regarding this usage. Since Topview is not publicly released
at the time of this writing, we cannot publish information regarding it.

The following pages contain brief documentation on using each of the
three programs. You may obtain a brief program synopsis for any of
these programs by typing the program name on the DOS command line
followed by a question mark. For instance, if you wanted information
on GS-UNNUM you would simply type "GS-UNNUM ?" (without the quotation
marks). Note that 192K RAM should be available when using DOS 3.00.


(C)Copyright GILMORE SYSTEMS, 1984, 1985



GS - BASIC Optimizing Utilities Page 2
Background Information


GS-UNNUM version 5.00

This program will not only un-number your BASIC source program, but will
optionally scan for lowercase BASIC verbs, Un-comment your BASIC source
program, remove branches to commented lines wherever possible by moving
the line number to the next line if it has been un-numbered, and re-work
all of your RETURN statements in a more efficient manner. I was inspired
to write this program because similar un-numbering programs only
un-numbered the source code, and not only missed things, but were
extremely slow! GS-UNNUM is very fast, however, the more options you

choose, the longer it will take to run. It still runs faster than most
programs that only un-number even with all options chosen.

One note about continuation of lines (Compiler only) - The BASIC
compiler will accept continuation of a line by placing an underscore
character as the last character of the line to be continued. GS-UNNUM
will support this feature only if the first character of the continued
line starts with a blank as the first character.

Changes since version 3.00

The '/R' option has been changed. A parameter must now accompany the use
of this option. '/R' optimizes the RETURN statements in your output file
so that only one RETURN will be present in the file. Version 3.00 added
this return statement as line 2 which has caused problems when using
metacommands such as COMMON. Version 4 corrects this by having you tell
it which line number has the RETURN statement to be used. If you want
GS-UNNUM to pick which RETURN statement is to be used, tell it to use
line 0. Regardless of which method you use for '/R', it will no longer
interfere with the use of metacommands such as COMMON. RETURN statements
in the form of "RETURN nnnnn" will be left alone, and the program will
terminate with an error message if you specify the line number of
a RETURN statement of the above form.

Clarifications

'/T' was not explained. What '/T' does is remove the actual " REM "
and " ' " that '/C' couldn't. '/C' removes the actual written
comment. '/T' also removes all unnecessary spaces, and puts a
physical end of line mark after the last nonspace character in the
line ('/C' does not). '/T' further eliminates branches to a numbered
comment when possible - this is done by checking to see if the next
line has a line number, if it doesn't, the comment is eliminated and
the line number is moved to the next line.

REMINDER

Remember to use the '/L' option if your input file has any lowercase
BASIC verbs, or important branching information will be missed and
you will end up with undefined line numbers in the output file when
you try to compile.




(C)Copyright GILMORE SYSTEMS, 1984, 1985



GS - BASIC Optimizing Utilities Page 3
Background Information


GS-VAREN version 2.10

This program will rename the variables in your BASIC source file to
shorter names, and optionally produce a report of your variable names
and what they have been renamed to. This program is the slowest running
of all three programs, but is very efficient in its search. To save
time, the use of this program is suggested on the intermediate file
produced by GS-UNNUM.

Changes since version 1.00

This program now looks for a file called GS-VAREN.TBL on the default
drive. If it finds it, it will use this file for the BASIC reserved
word list instead of the built-in default table. If it does not find
this file, it will create it with all the reserved words in the
built-in default table. You may eliminate words that you are not using
or modify the file in any other way. The fewer words in this table, the
faster the program will run. Words in this file must meet certain
requirements: 1) first character must be alphabetic, 2) total length
of word must not exceed 10 characters, 3) no imbedded spaces are
allowed, and 4) only one entry per line is allowed. Violation of any of
these rules will result in program termination with an error message.
Upper/Lowercase is unimportant. Note that reserved words requiring an
imbedded space are considered to be 2 separate words. For example, LINE
INPUT consists of 2 words, LINE and INPUT, which require 2 separate
entries. ON KEY would be another example.

If you start this program with an input filename only (no output
filename and no report filename), GS-VAREN will scan through your
input file with its built-in default table, and produce the file
GS-VAREN.TBL containing a list of all the BASIC reserved words it
found in your input file.























(C)Copyright GILMORE SYSTEMS, 1984, 1985



GS - BASIC Optimizing Utilities Page 4
Background Information


GS-RENUM version 3.10

This program will re-number the intermediate file produced by GS-UNNUM
so that it may be loaded into the BASIC interpreter. This is the fastest
running of all the programs. It does 1000 lines of code in about 60
seconds on an IBM with a hard disk.

CLOSING REMARKS FROM THE AUTHOR

Ironically, these three programs were written in the "C" programming
language. BASIC is an excellent language for small to intermediate size
programs, but when it comes to writing something major, nothing in my
opinion beats the "C" language short of assembler. After encountering
the aforementioned nightmare, I have permanently switched to "C". This
way I can devote my time to writing software products, instead of
devising ways to get around compiler and language limitations. All
future software products from GILMORE SYSTEMS will be written in "C",
assembler, or a combination of both.

Much time has been spent developing the above three programs, and
GS-UNNUM alone does much more than commercially available un-numbering
software. If you find this program of use, please send a small monetary
donation to GILMORE SYSTEMS for time and effort involved. A donation of
$20 or more will get you a customer number that entitles you to updates
and telephone assistance from GILMORE SYSTEMS. We accept both VISA and
MASTERCARD.

GILMORE SYSTEMS develops commercial software (not public domain), and
is offering these 3 programs to the public domain as a test for market
response. Should this test be successful, many sophisticated software
products will be made available to the public domain by GILMORE
SYSTEMS. The more people that donate, the more successful the test will
be!

GILMORE SYSTEMS specializes in custom software development and
consulting. Corporations in need of these services should feel free to
contact us for your developmental needs.


















(C)Copyright GILMORE SYSTEMS, 1984, 1985



GS-UNNUM Page 5
Background Information



GS-UNNUM version 5.00 - BASIC Un-numbering utility
(C)Copyright GILMORE SYSTEMS, 1984, 1985
BOX 511, NUTTING LAKE, MASS. 01865
Ph 617/646-3542

Usage: GS-UNNUM [d:][path]infile [d:][path]outfile [/c][/i][/l][/t][/r:nnnnn]
where [d:][path]infile is the input file,
[d:][path]outfile is the output file,
[/c] will remove COMMENTS in the output file,
[/i] will INDENT lines having removed numbers in the output file,
[/l] will scan for LOWERCASE BASIC verbs (otherwise lowercase ignored),
[/t] will TRIM excess space and optimize what /C couldn't,
[/r:nnnnn] optimizes RETURNs to just one RETURN. 'nnnnn' is the line no
of the stmt containing the RETURN. If nnnnn=0, GS-UNNUM chooses line.

NOTES: 1) DOS version 2.00 or higher and 128K RAM (Note: ANSI.SYS not required)
2) Input file MUST be an ASCII file!
3) Separate infile, outfile, and option fields with one or more spaces.
4) /T can only be used when /C specified but not with /I.
5) Error return codes are 0=No Errors, 1=Errors - Ideal for batch files.
6) Disk free space should be 1x input file size, and 2x when /T is used.
7) For Corporate use, contact GILMORE SYSTEMS for licensing fees.
































(C)Copyright GILMORE SYSTEMS, 1984, 1985



GS-VAREN Page 6
Background Information



GS-VAREN version 2.10 - BASIC Variable Renaming utility
(C)Copyright GILMORE SYSTEMS, 1984, 1985
BOX 511, NUTTING LAKE, MASS. 01865
Ph 617/646-3542

Usage is: GS-VAREN [d:][path]infile [d:][path]outfile [d:][path]report
Where [d:][path]infile is the input file,
[d:][path]outfile is the output file,
[d:][path]report is the report file (optional).

If program is started with input filename only, the file GS-VAREN.TBL will be
created with a list of BASIC reserved words used in your input file.
For normal usage, if GS-VAREN.TBL exists, the entries in this file will be used
for the BASIC reserved word list instead of the built in default list - if it
doesn't exist, it will be created from the built in default list.

NOTES: 1) DOS version 2.00 or higher and 128K RAM (Note: ANSI.SYS not required)
2) Input file MUST be an ASCII file! Line numbers in file are optional.
3) If disk space is low and you want a report, use 'LPT1' for report.
4) Error return codes are 0=No Errors, 1=Errors - Ideal for batch files.
5) Disk free space should be 1x input file size (with no report).
6) For Corporate use, contact GILMORE SYSTEMS for licensing fees.

































(C)Copyright GILMORE SYSTEMS, 1984, 1985



GS-RENUM Page 7
Background Information



GS-RENUM version 3.10 - BASIC Re-numbering utility pgm.
(C)Copyright GILMORE SYSTEMS, 1984, 1985
BOX 511
NUTTING LAKE, MASS. 01865
Ph 617/646-3542

Usage is: GS-RENUM [d:][path]infile [d:][path]outfile

Where [d:][path]infile is the input file,
[d:][path]outfile is the output file,

This program will re-number a BASIC program that was Un-Numbered by GS-UNNUM.

NOTES: 1) DOS version 2.00 or higher and 128K RAM (Note: ANSI.SYS not required)
2) Input file MUST be an ASCII file!
3) Error return codes are 0=No Errors, 1=Errors - Ideal for batch files.
4) Disk free space should be at approximately 1x input file size + 10%





































(C)Copyright GILMORE SYSTEMS, 1984, 1985


 December 7, 2017  Add comments

Leave a Reply