Increase MAX_STATIC_DATA
[bazic.git] / README
1 baZic version 0.1
2 =================
3
4 (C) 2001 David Given
5 http://www.cowlark.com
6 dg@cowlark.com
7
8 Introduction
9 ------------
10
11 Welcome to baZic, my totally mad Basic interpreter for the Z-machine!
12
13 Please note that this is unfinished. While enough exists to run a decent game
14 of Hunt the Wumpus, there are big chunks of functionality missing; roughly 50%
15 of the Basic language. Notably, unimplemented features are:
16
17 * String operators (the hooks are there, I just need to write the code)
18 * Subroutines (GOSUB & friends)
19 * Procedures (SUB & friends)
20 * Proper arrays
21
22 I am unlikely ever to finish this; the Basic language is just too annoying for
23 words. It's even more annoying to implement than to write in. (It uses the
24 Parser from Hell.) If you wish to continue it, be my guest.
25
26 What you *do* get, however, is:
27
28 * Dynamic memory allocation, complete with block coalescing
29 * A full mark/sweep garbage collector
30 * Dynamic typing
31 * Full tokenisation for fast(!) execution of programs
32 * Full detokenisation when listing them again
33 * An interactive Basic development environment (cough, cough)
34 * State-of-the-art implementations of Hunt the Wumpus and Guess the Number
35   built in to the very interpreter
36 * Pseudo-arrays
37
38 The memory allocator is nicely modular if you feel like ripping it out. Ditto
39 the garbage collector.
40
41 Usage
42 -----
43
44 Run the program in the normal way. You get presented with a Basic prompt. You
45 can now type in lines of Basic code and they will get executed. You can add
46 lines to the current program by prefixing them with a line number. Most basic
47 Basic keywords work. 
48
49 SAVE, LOAD and QUIT work as expected (for a text adventure). LIST has some
50 extra features; LIST -1 will display the program's byte code (for those with a
51 morbid curiosity). LIST -2 will dump the currently defined variables.
52
53 If you modify the current program, all currently defined variables are lost.
54 Variables are dynamically typed; while you can put $ and % on the end of the
55 names if you want, they're meaningless.
56
57 Arrays are funny. Rather than implement DIM, I just added a quick hack to
58 concatenate the array index on the end of the array name. So you don't need to
59 declare an array, and storage is only taken up for those elements that actually
60 exist. If you have any array entries defined, LIST -2 may do strange things
61 (the name of the array entry variables aren't strictly printable).
62
63 The SCRIPT keyword allows you to load one of several predefined programs into
64 the interpreter's memory. Use it with no arguments to list the available
65 programs. Give it the program index for more information. SCRIPT 0 gives a
66 brief guide to baZic (even briefer than this, although written when I had more
67 sleep).
68
69 Bugs
70 ----
71
72 This program contains no bugs whatsoever. Excuse me, the New World Order made
73 me say that.
74
75 Credits
76 -------
77
78 You can blame Graham Nelson, for the Inform compiler with which this is
79 written, and Acorn, for producing the BBC Microcomputer on which I got the hack
80 habit.
81
82 License
83 -------
84
85 This code is licensed under the MIT open source license.
86
87 Copyright (c) 2001, David Given All rights reserved.
88
89 Permission is hereby granted, free of charge, to any person obtaining a copy of
90 this software and associated documentation files (the "Software"), to deal in
91 the Software without restriction, including without limitation the rights to
92 use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
93 of the Software, and to permit persons to whom the Software is furnished to do
94 so, subject to the following conditions:
95
96 The above copyright notice and this permission notice shall be included in all
97 copies or substantial portions of the Software.  THE SOFTWARE IS PROVIDED "AS
98 IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
99 LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE
100 AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
101 LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
102 CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
103 SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
104