| 1 |
Some Notes on Installation of the Bywater BASIC Interpreter: |
| 2 |
----------------------------------------------------------- |
| 3 |
|
| 4 |
0. Quick-Start Guide For Compiling |
| 5 |
|
| 6 |
To use the default configuration (which is reasonable for most situations): |
| 7 |
|
| 8 |
On Unix, type "configure; make". |
| 9 |
On MS-DOS using QuickC, type "nmake -f makefile.qcl". |
| 10 |
|
| 11 |
You can skip the rest of this file unless you want to customize the |
| 12 |
BASIC dialect that is supported, or something goes wrong in the |
| 13 |
above commands. |
| 14 |
|
| 15 |
1. Compiler Requirements |
| 16 |
|
| 17 |
Although earlier versions of bwBASIC would compile only with |
| 18 |
ANSI C compilers, versions 2.10 and higher can be compiled |
| 19 |
with "stock" C compilers, i.e., compilers that comply with |
| 20 |
the older Kernighan and Ritchie C standard. |
| 21 |
|
| 22 |
Section I-B of bwbasic.h allows you to specify some compiler |
| 23 |
features. If you have an ANSI C compiler, you needn't worry |
| 24 |
with this. For stock C compilers, the default configuration |
| 25 |
presumes that your compiler supports signal() and raise() |
| 26 |
with the signal.h header, supports setjmp() and longjmp() |
| 27 |
with the setjmp.h header, and has a separate string.h |
| 28 |
header. If your compiler does not have these features |
| 29 |
and the related header files, you can indicate this in |
| 30 |
section I-B by setting appropriate flags to FALSE. |
| 31 |
|
| 32 |
|
| 33 |
2. Configuration of header files |
| 34 |
|
| 35 |
You may need to examine file "bwbasic.h" to make important |
| 36 |
changes for specific hardware and compiler configurations. |
| 37 |
You may also need to change "bwx_tty.h" if you are using the |
| 38 |
TTY implementation or "bwx_iqc.h" if you are using the version |
| 39 |
for PCs with Microsoft QuickC (see below on "implementations"). |
| 40 |
If you want to redefine messages or even the BASIC command |
| 41 |
names, you will need to edit "bwb_mes.h". |
| 42 |
|
| 43 |
|
| 44 |
3. Makefiles |
| 45 |
|
| 46 |
Several makefiles are provided: "makefile.qcl" will compile |
| 47 |
the program utilizing the Microsoft QuickC (tm) line-oriented |
| 48 |
compiler on DOS-based p.c.'s, and "makefile" will compile the |
| 49 |
program on Unix-based computers utilizing either a stock C |
| 50 |
compiler or Gnu C++. I have also compiled the program utilizing |
| 51 |
Borland's Turbo C++ (tm) on DOS-based machines, although I have |
| 52 |
not supplied a makefile for Turbo C++. |
| 53 |
|
| 54 |
If you try the "IQC" implementation, you will need to alter |
| 55 |
makefile.qcl to include bwx_iqc.c (and bqx_iqc.obj) instead |
| 56 |
of bwx_tty.*. |
| 57 |
|
| 58 |
|
| 59 |
4. Implementations |
| 60 |
|
| 61 |
The present status of bwBASIC allows two major implementations |
| 62 |
controlled by the IMP_TTY and IMP_IQC flags in bwbasic.h. |
| 63 |
IMP_TTY is the base implementation and presumes a simple |
| 64 |
TTY-style environment, with all keyboard and screen input |
| 65 |
and output directed through stdin and stdout. If IMP_TTY is |
| 66 |
defined as TRUE, then the file bwx_tty.h will be included, |
| 67 |
and a makefile should include compilation of bwx_tty.c. |
| 68 |
IMP_IQC is a somewhat more elaborate implementation for |
| 69 |
the IBM PC and compatible microcomputers utilizing the |
| 70 |
Microsoft QuickC compiler. This allows some more elaborate |
| 71 |
commands (CLS and LOCATE) and the INKEY$ function, and |
| 72 |
allows greater control over output. If IMP_IQC is defined |
| 73 |
as TRUE in bwbasic.h, then bwx_iqc.h will be included and |
| 74 |
bwx_iqc.c should be compiled in the makefile. |
| 75 |
|
| 76 |
Only one of the flags IMP_TTY or IMP_IQC should be set |
| 77 |
to TRUE. |
| 78 |
|
| 79 |
|
| 80 |
5. Flags Controlling Groups of Commands and Functions |
| 81 |
|
| 82 |
There are a number of flags which control groups of commands |
| 83 |
and functions to be implemented. |
| 84 |
|
| 85 |
(core) Commands and Functions in any implementation of |
| 86 |
bwBASIC; these are the ANSI Minimal BASIC core |
| 87 |
|
| 88 |
INTERACTIVE Commands supporting the interactive programming |
| 89 |
environment |
| 90 |
|
| 91 |
COMMON_CMDS Commands beyond ANSI Minimal BASIC which are common |
| 92 |
to Full ANSI BASIC and Microsoft BASICs |
| 93 |
|
| 94 |
COMMON_FUNCS Functions beyond the ANSI Mimimal BASIC core, but |
| 95 |
common to both ANSI Full BASIC and Microsoft-style |
| 96 |
BASIC varieties |
| 97 |
|
| 98 |
UNIX_CMDS Commands which require Unix-style directory and |
| 99 |
environment routines not specified in ANSI C |
| 100 |
|
| 101 |
STRUCT_CMDS Commands related to structured programming; all |
| 102 |
of these are part of the Full ANSI BASIC standard |
| 103 |
|
| 104 |
ANSI_FUNCS Functions unique to ANSI Full BASIC |
| 105 |
|
| 106 |
MS_CMDS Commands unique to Microsoft BASICs |
| 107 |
|
| 108 |
MS_FUNCS Functions unique to Microsoft BASICs |
| 109 |
|
| 110 |
|
| 111 |
6. Configurations |
| 112 |
|
| 113 |
The file bwbasic.h includes a number of configuration options |
| 114 |
that will automatically select groups of commands and functions |
| 115 |
according to predetermined patterns. These are: |
| 116 |
|
| 117 |
CFG_ANSIMINIMAL Conforms to ANSI Minimal BASIC standard X3.60-1978. |
| 118 |
|
| 119 |
CFG_COMMON Small implementation with commands and functions |
| 120 |
common to GWBASIC (tm) and ANSI full BASIC. |
| 121 |
|
| 122 |
CFG_MSTYPE Configuration similar to Microsoft line-oriented |
| 123 |
BASICs. |
| 124 |
|
| 125 |
CFG_ANSIFULL Conforms to ANSI Full BASIC standard X3.113-1987 |
| 126 |
(subset at present). |
| 127 |
|
| 128 |
CFG_CUSTOM Custom Configuration specified by user. |
| 129 |
|
| 130 |
Only one of these flags should be set to TRUE. |
| 131 |
|
| 132 |
|
| 133 |
7. Adding Commands and Functions |
| 134 |
|
| 135 |
In order to add a new command to bwBASIC, follow the following |
| 136 |
procedure: |
| 137 |
|
| 138 |
(a) Write the command body using function bwb_null() in bwb_cmd.c |
| 139 |
as a template. The command-body function (in C) must receive a |
| 140 |
pointer to a bwb_line structure, and must pass on a pointer to |
| 141 |
a bwb_line structure. The preferred method for returning from |
| 142 |
a command-body function is: return bwb_zline( l ); this will |
| 143 |
discriminate between MULTISEG_LINES programs which advance to |
| 144 |
the next segment and those which advance to the next line. |
| 145 |
|
| 146 |
(b) Add prototypes for the command-body function in bwbasic.h; |
| 147 |
you'll need one prototype with arguments in the ANSI_C section |
| 148 |
and one prototype without arguments in the non-ANSI_C section. |
| 149 |
|
| 150 |
(c) Add the command to the command table in bwb_tbl.c in the |
| 151 |
group you have selected for it. |
| 152 |
|
| 153 |
(d) Increment the number of commands for the group in which |
| 154 |
you have placed your command. |
| 155 |
|
| 156 |
The procedure for adding a new function is parallel to this, except that |
| 157 |
you should use fnc_null() in bwb_fnc.c as the template, and the |
| 158 |
function name must be added to the function table in bwb_tbl.c. |