Category : BASIC Source Code
Archive   : LINKER.ZIP
Filename : LINKER.DOC

 
Output of file : LINKER.DOC contained in archive : LINKER.ZIP


















The QuickBASIC

Compiler/Linker Assistant

Shareware Version 1.0








(C) Copyright 1990 by Robin Duffy. All rights reserved.



QuickBASIC is a registered trademark of Microsoft Inc.


SECTION ONE: Introduction to LINKER

1.1 Program Overview

LINKER is a utility designed to help compile and link stand
alone programs from QuickBASIC 4.0+ source code. It operates much
like the compile options from within the environment but allows
you total control over the compiling and linking process. After
setting the options YOU want, simply press one key and let LINKER
do the work for you!

Why compile and link away from QuickBASIC? Good question. By
compiling away from the environment you can create smaller
programs that execute faster. For example, if your program does
not require use of the COM port, the code is STILL ADDED anyway.
Linking your program with NOCOM.OBJ (as supplied with QB 4) will
eliminate the extra code - if you link from the command line.
Another good example is using ON ERROR. ON ERROR has two
different sets of code, but both are added even if you only use
one of them. By setting your own options you can eliminate a lot
of useless code and gain speed as a benefit.

Compiling and linking from the DOS command line is fairly
simple if you are compiling only one module and linking with only
one library. Start adding modules and the process gets more
involved, fast. Worse yet, most "toolboxes" come as libraries you
must add, and there are special purpose object files to add as
well. Almost a hopeless situation - until LINKER.

Tell LINKER what compiler options you want. Set your own
link options as well. Specify three (or more) libraries and
throw in a couple of special purpose object files to boot. Give
it the name of your source file and press a key. LINKER will
give all the necessary commands to compile your source code.
Multiple modules? No problem. LINKER will find your MAKE file and
add the needed modules automatically. Compiling and linking away
from the QB environment need not be difficult - if you have the
right tool.

1.2 Requirements for LINKER

LINKER requires DOS 3.0 or later and at least 256K system
memory in order to operate. You may use LINKER with one disk
drive although a hard disk is strongly recommended for best
operation. This program is intended to be used with BC.EXE and
LINK.EXE as provided with QuickBASIC 4.0 + 4.5 and has not
been tested with other compilers.

COMMAND.COM must be available to LINKER through the COMSPEC
environment variable. Usually this poses no problem - COMSPEC is
set by DOS to the drive you booted from. In single drive systems,
however, this could become a problem. See the section called
"Compiling and Linking Your Program" for information concerning
this problem and a possible solution.

In addition to all this you will need your own source
files and your own libraries. LINKER is meant as an interface
for QB only and does not provide the programs necessary for
compiling and linking source files. This is left up to you to
provide.

1.3 Support Files for LINKER

In the course of normal operation LINKER uses and creates
several files. Listed below are some of these files and their
respective notes.

LINKER.HLP - This file contains the help screens for LINKER.
It should be placed in the same directory as LINKER.COM for
proper operation. LINKER can function without this file but
then help will not be available.

LINKER.DAT - This file is created by the program when you
push the F2 key (see "Program Operation" for more info).
This file is created in the directory where LINKER.COM is
located irregardless of the current directory.

BC.EXE - The QuickBASIC compiler program verions 4.0 or 4.5.
LINKER has not been tested with eariler versions.

LINK.EXE - As supplied with QuickBASIC.

*.OBJ - These are the compiled source object files. BC will
create these in the current directory. Link will then use
these to create the finished program.

*.LIB - The various library files. One is BCOM45.LIB, which
is generally used for stand-alone EXE files. Toolbox kits
often come in the form of libraries which can also be added.

*.BAS - Your BASIC source files.

*.MAK - If you use multiple modules QB will create a file
with a .MAK extension containing a list of all modules
included with your code. If it exists, LINKER will read this
file and add the specified modules to your program
automatically.

There is quite a bit to keep track of while compiling and
linking programs. You can see that without a utility such as
this creating stand-alones can be a grueling process. LINKER can
allow you to benefit from separate compiling and linking while
shielding you from the rigors of such a process. The next section
tells you how.

SECTION TWO: Program Operation

2.1 Getting Started

To start the program type LINKER from the DOS prompt. The
title screen will appear, and then the program continues to the
main screen in about 15 seconds if you don't first press a key.

The main screen is divided into three main sections of
information that you will need to enter. Some fields are
optional while others are required. To enter information just
type it in. You can use the up/down arrow keys to move from field
to field. Please note the text in the current field is in high
intensity - this will help you distingush the field you are in.
While entering information you may use the insert/del keys as
well as the left/right arrows. Let's now look at the top section
of information.

The top section consists of path information concerning your
computer set up. It is necessary for LINKER to know where you
keep certain items. Please enter the path to your source file
directory, the directory where you keep BC and LINK, your library
directory, and where you keep miscellaneous object files. When
specifying paths the drive parameter is optional. For hard disk
use both of the following examples are valid:

c:\qb\basfiles
\qb\library

If you do not specify a drive the path must start with the
"\" character. If you leave a path blank LINKER will use the
current directory.

LINKER is set up to allow maximum organization of your hard
disk. If you are using a one or two drive system please see the
sections dealing will those situations under "Compiling and
Linking Your Program" elsewhere in this text.

The middle section is where you specify your options for BC
and LINK, what libraries you want to link with, and any special
purpose object files you may want to add to your program. The
options for BC and LINK are in the form of command line switches.
Specify these switches as though you were giving them on the
command line (ie: /o /s /t for BC.EXE)

There is one field for compiler options and two for link
options. There are up to 27 different options you can specify for
LINK, so the extra field has been added. You may use either of
the link option fields or a combination of both.

Additional .OBJ files are any special purpose object files
you may want to add to your program. These are object files such
as NOCOM.OBJ, NOEM.OBJ, and SMALLERR.OBJ. By using object files
such as these you can shrink the size of your code dramatically.
The path to these files are given in the top section. Consult
your QB manual for more information on these object files.


When specifying multiple libraries and/or object files be
sure to separate each name in the field with a space. You can fit
more files in the field by not giving an extension. Extensions
are not necessary for any of the information you enter. LINKER,
BC, and LINK know what the extensions are and will add them for
you.

The final section is where you tell LINKER what source file
you wish to compile and the name you want to give it. The field
is designed to accept only ONE file name. If your program
consists of several separate modules QB will create a make file
in your source directory containing all the modules to your
program. LINKER will detect this file if it exists and add all
the modules in the make file to your program. The compiler
options you specify will be applied to all modules so they are
all compiled the same. Consult your QB manual for more
information about .MAK files.

In the last field place the name you wish to give your
program. If you desire the same name as your source file just
leave this field blank. The extension .EXE is assumed.

2.2 Other Features

LINKER has a couple other features to aid you in creating
your program. After entering the above information you may save
it to a data file by pressing the F2 key. This creates a file
called LINKER.DAT in the same directory where LINKER.COM is
located. LINKER will read and load this file at startup. This
will save you the doldrum of entering all the above information
every time you wish to use the program. You can save all the
information, including your source name if you so desire.

Pressing the F1 key will activate LINKER's help system. A
small menu will appear in the middle of the screen listing the
help topics available to you. Highlight the topic you want help
on and press the ENTER key to see it. The help system is recursive
so you may bring up the help menu while in help to view other
subjects. At the bottom of each help screen are listed all your
available options. Pressing ESC at any time will exit help and
return you to the main screen. Please be sure that LINKER.HLP is
in the same directory as LINKER.COM or help will not be
available!

Press the ESC key at the main screen to exit the program
without compiling or linking your program.

Pressing the TAB key will compile and link your program. The
next section deals with this subject in more detail.

SECTION THREE: Compiling and Linking your Program

3.1 General Operation

Now that you have entered all the necessary data to create
your program, press the TAB key and let it fly. LINKER will first
locate your source file(s) and then call BC to compile them one
at a time. If your program compiles with errors LINKER will
detect this condition and halt the process. You will then be
brought back to the main screen where you may be able to correct
the problem and then try it again.

If everything compiles OK, LINKER will then call LINK.EXE to
link your program. LINKER will set up the link call using the
switches, libraries, and additional object files you specified in
the information section. Once again LINKER will supervise the
linking process and return you to the main screen if an error
occurs. If your program links with no errors LINKER will
automatically exit to DOS so you may try out your new program.

LINKER was written to be used primarily on a hard disk
system. Using it on single and double drive systems is not
impossible however. The sections below explain how this may be
accomplished.

3.2 Single 5.25" Drive System:

I'm not going to kid you here. Using a single drive system
poses some serious limitations to your final program size. You
will need three blank floppy disks. Label them A, B, and C, then
set them up as follows:

DISK A
------
COMMAND.COM
LINKER.COM
BC.EXE
LINK.EXE
Your source file(s)

DISK B
------
BCOM40.LIB or
BCOM45.LIB or
Other run-time library
Any toolbox library
Any additional OBJ files

DISK C
------
BLANK

Start LINKER from Disk A. Leave the paths to your source
files, BC and LINK blank. Set the library and object file paths
to "b:" (without quotes). Set the switches as you desire, but
include the /PAU switch for LINK. After the above is done press
the TAB key to start. When LINK starts you will be prompted to
swap disks in drive a:. When LINK asks for the disk for drive b:
insert your B disk. You will need to swap disks a couple of more
times before the process is complete.

Before LINK writes the final executable program, it will ask
you to place a new disk in drive a:. Insert your final blank disk
(DISK C) into your drive and push ENTER twice. The third disk
will now contain your finished program.

You can create an extra 29K of disk space if you start
LINKER from a different disk and eliminate it from DISK A. Once
the main screen appears it is safe to remove the program diskette
from the drive. If you push F2 with a different disk in the drive
than the one you started from you will just create another
LINKER.DAT file.

3.3 Single 3.5" Drive System

This configuration will give you much needed breathing room.
You can do the entire process from one disk. However, if you
follow the procedure for a 5.25" drive system (without the third
blank disk) you can create programs of virtually unlimited size.
You will still need to swap disks when prompted.

3.4 Dual Drive System (any size drives)

The procedure is basically the same as a single drive
system. The advantage here is no disk swapping should be needed.
Put DISK A in drive a: and DISK B in drive b:. For two 5.25"
drives I still recommend using the /PAU link option and a third
blank disk.

3.5 Hard Disk System

Here is where you will receive the full benefit of LINKER's
services. You are encouraged to separate different type files
into their own subdirectories. Doing so will make finding
different files much easier as well as cleaning your QB
directory up quite nicely. QuickBASIC itself can be set up to use
multiple sub directories. I believe this promotes good hard disk
organization.

Another advantage is the speed. LINKER can compile and link
your program about three times as fast on a hard disk as on
floppies. Yet another advantage is in the additions you can make
to your program. Some toolbox kits will not fit on a floppy disk
along with a run-time library. Using a hard disk means you can
use two, three, or more libraries and three or four special
purpose object files without fear of the "Disk Full" error.

To use LINKER on a hard disk just enter the path information
into the proper areas and use it. LINKER was designed to be run from
a directory in your PATH on an empty directory. You are still free
to choose the method that suits you best.

SECTION FOUR: Other Information

4.1 Registered Extras

When you register for LINKER you will receive the registered
version of the program. This version has many features the
shareware version does not. Here is a short synopsis of some of
these features.

Multiple Data Files - Instead of only creating one data
file you can create as many as you desire. This means even
less typing for you. Each data file can contain complete
information. The value of this will be seen in the next
feature.

Command Line Operation - The registered version will allow
you to specify the source file and data file to use on the
command line. When given this way LINKER will go right to
compiling and linking, and then exit right back to DOS.

Text Editor - A text editor is included to work directly
with your source code. You may optionally specify your own
editor to use in place of the one supplied. This editor has
block operations and help. Useful if your source compiles
with errors.

Quiet Mode - Shut off those beeps and whistles for those
late-night programming sessions. Good for the whole family!

No Title Screen - The registered version takes you straight
to the main screen. Why should you have to look at the title
every time you start the program?

4.2 Site License Agreement

This program is distributed by the Shareware concept. It is
not free. You are granted limited license to use LINKER on your
system to determine its suitability.

You are encouraged to give LINKER to your friends and upload
it on your favorite BBS provided you adhere to these terms:

You cannot charge a fee for the program. You may charge a
distribution fee if you advise users this fee is for distri-
bution purposes only and not for the program itself.

You must include all the files included with this package in
complete and unmodified form.

If you find this utility helpful and plan to use it on your
system, please register your copy. Once registered you will
receive another copy of this program that has features not
available in the shareware version. Registration covers you, the
user, and you may use the program on any number of systems you
own.
To register your copy of LINKER, please send $10, your name,
address, and the type(s) of computers you own to:

Robin Duffy
P.O. Box 53
Tateville, KY
42558

All registrations are appreicated.

-----------------------------------------------------------------
REGISTRATION FORM

Please use this form when registering LINKER. Thanx!

Name? ________________________________

Address? ______________________________

______________________________

What type of computer(s) do you own? ____________________________

_________________________________________________________________

_________________________________________________________________

Where did you get your copy of LINKER? __________________________

_________________________________________________________________

_________________________________________________________________

Do you have any comments about LINKER? __________________________

_________________________________________________________________

_________________________________________________________________

_________________________________________________________________









SUPPORT SHAREWARE!


  3 Responses to “Category : BASIC Source Code
Archive   : LINKER.ZIP
Filename : LINKER.DOC

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/