OSDN Git Service

6b4ff8cb13a95f6cbb80346771f0f84c934addc7
[bif-6809/bif-6809.git] / README.TXT
1 Information about BIF as of April 2019.\r
2 \r
3         Joel Matthew Rees, Amagasaki, Hyogo, Japan.\r
4                                         joel.rees@gmail.com\r
5                                         http://reiisi.blogspot.com\r
6                                         https://defining-computers.blogspot.com/\r
7                                         etc.\r
8         Copyright 2000, 2019 Joel Matthew Rees\r
9 \r
10 -----\r
11 \r
12 (The following can be found in its original form in the bif-c \r
13 repositories. bif-c is buggy, by the way.)\r
14 \r
15 -----\r
16 \r
17 BIF was a dialect of the early fig-standard FORTH.  It was a student\r
18 project, not a commercial product, and no warranty has ever been made \r
19 concerning it, whatsoever.  It was written on the Color Computer 2 in \r
20 6809 assembler; the assembler used was disk EDTASM+.  It also ran on \r
21 the Color Computer 3, with the expected limitations of requiring the \r
22 32 column screen, etc. \r
23 \r
24 License information -- the rights to BIF and the materials with it, \r
25 and restrictions on distribution -- are described in the file \r
26 BIFDOC.TXT, which really should distributed with the source along with \r
27 this README.TXT. \r
28 \r
29 The short version of the licensing information is that I am distributing \r
30 BIF6809 under the essential terms of the Internet Systems Consortium \r
31 ISC License:\r
32 \r
33 =========\r
34 Permission to use, copy, modify, and/or distribute this software for \r
35 any purpose with or without fee is hereby granted, provided that the \r
36 accompanying copyright notices and this permission notice appear in \r
37 all copies.\r
38 \r
39 THE SOFTWARE IS PROVIDED “AS IS” AND ISC DISCLAIMS ALL WARRANTIES \r
40 WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF \r
41 MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY \r
42 SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES \r
43 WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN \r
44 AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, \r
45 ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS \r
46 SOFTWARE.\r
47 =========\r
48 \r
49 I add here the stipulation that I claim right to the word "BIF" as \r
50 the name of a programming language.\r
51 \r
52 If you are going to distribute or redistribute the obect or source of \r
53 bif in any of its forms, it really makes no sense not to include the \r
54 BIFDOC.TXT and this README.TXT. If you do something like that and \r
55 you or anyone that gets the results has problems with it, and you come \r
56 to me looking for help, expect to be teased mercilessly about it. And \r
57 expect to be on the bottom of my priority list, not out of spite, \r
58 out of self-protection.\r
59 \r
60 -----\r
61 \r
62 I have reconstructed something approximating my source disks (using the \r
63 great emulator, xroar: https://www.6809.org.uk/xroar/ and the imgtool\r
64 distributed with MAME, along with the *nix tools). Some useful commands \r
65 are noted in commands.txt.\r
66 \r
67 The name of the disk image is (appropriately?) bifsource.dsk. It can be \r
68 directly attached by xroar's disk emulator tools, and should be similarly \r
69 useable with VCC, MAME, etc. al.\r
70 \r
71 -----\r
72 \r
73 The assembler source files are readable by the a variety of text editors,\r
74 that respond flexibly about line termination. But if you try editing them\r
75 with a normal editor and then assembling the result with EDTASM+, be very \r
76 careful about line termination. Be prepared to use *nix command line tools \r
77 like tr, cut, sed/awk, perl, etc. \r
78 \r
79 The source files retain the original line numbers as used by EDTASM+, \r
80 which is why you will want the *nix tools. But I have included source to a \r
81 short C program, stripln.c, which strips the line numbers. This program \r
82 may also be useful for converting line endings, if that is necessary. Look \r
83 for it in the junkbox directory, and be prepared to compile it. \r
84 \r
85 If you are under the burden of using Microsoft OSses, the Cygwin project \r
86 should be of quite a bit of assistance, including the *nix command line \r
87 tools and gcc and clang, etc.\r
88 \r
89 -----\r
90 \r
91 Macros are used in the source, but shouldn't cause too much confusion \r
92 to a programmer with assembler experience. If anyone is brave enough \r
93 to try to port it, key routines will be EMIT, KEY, ?TERMINAL, CR, R/W, \r
94 and several routines in the EDITOR vocabulary where I used direct \r
95 video I/O out of laziness.\r
96 \r
97 -----\r
98 \r
99 BIF might be useful for experimentation and for learning about FORTH, \r
100 for someone who has access to a Color Computer or an emulator. The \r
101 executable file may be run on the Color Computer by LOADMing it via \r
102 Color Computer Disk BASIC. (More details in BIFDOC.TXT.) \r
103 \r
104 It is assembled to be EXECed at hexadecimal 1300 (&H1300). \r
105 \r
106 -----\r
107 \r
108 One specific warning must be given:\r
109 \r
110 DO NOT ATTEMPT TO ACCESS ORDINARY DISKS FORMATTED FOR USE BY OTHER\r
111 OPERATING SYSTEMS WHILE BIF IS RUNNING! Because of disk buffering, it \r
112 will be difficult to avoid unintentional writes to the disk. \r
113 \r
114 If you do try looking at an OS-9 or Color Computer DOS (etc.) disk with \r
115 BIF, don't blame me if you destroy the directory and/or other valuable \r
116 data.\r
117 \r
118 -----\r
119 \r
120 I tried a re-write in C (bif-c), but it's not working well. Issues with \r
121 file systems (no real file system in BIF) and the current standardization \r
122 committees ideas about what is meaningful code, problems with my own \r
123 attention span, etc. keep it full of bugs. And I used a number of neat \r
124 tricks that get in the way in C. \r
125 \r
126 One thing I want to retain is the use of nested binary trees in the \r
127 symbol table. \r
128 \r
129 Incidentally, said re-write has been in process for over thirty years.\r
130 Real life keeps getting in the way.\r
131 \r
132 -----\r
133 \r
134 I am including source to a Q&D C program, 32col.c, which will re-format \r
135 files extracted from BIF disks for normal text editors. Mac-isms and \r
136 Codwarrior-isms can probably be discerned by comparing it with stripln.c, \r
137 mentioned above. \r
138 \r
139 When I brought the BIF high-level source with me, I used some feature of \r
140 Color Computer BASIC and BIF that I have forgotten to dump some of the \r
141 Forth style screen listings. \r
142 \r
143 The program stripln can be used to strip line numbers from such screen \r
144 listings, as well. \r
145 \r
146 The documentation is ASCII text, with CR/LF line termination, and should\r
147 be examined carefully by anyone considering a port.  Bear in mind that\r
148 it was written toward Color Computer users.\r
149 \r
150 I apologize for not alphabetizing the FORTH words by name. I did it once \r
151 with a C program, but got too ambitious and lost the results in the \r
152 process of trying to split it up into modules. I haven't had enough time \r
153 to finish the modularization, yet, either. (Getting an iBook so I could \r
154 work on the train just gave me more things to do on the train.)\r
155 \r
156 Files in this distribution --\r
157 \r
158 6809 Assembly Language Source files:\r
159 \r
160 README.TXT\r
161         this file.\r
162 BIFDOC.TXT\r
163         general explanations, including descriptions of every word.\r
164 BIFU.I\r
165         structure of the per-user variable page.\r
166 BIF.M\r
167         macros, including the inner interpreter (basis of the virtual machine),\r
168         the dictionary (symbol table) structure offsets,\r
169         and invocations for the fundamental objects.\r
170 BIFDP.A\r
171         things kept in the direct page, \r
172         including the behaviours for the fundamental objects (was not a good idea after all),\r
173         and the index to the per user variable page. \r
174 BIFST.A\r
175         cold and warm boot routines and the initial value table for the per-user variable page.\r
176 BIF.ASM\r
177         the main source file (includes other parts),\r
178         basic expression evaluation, more of the inner interpreter, \r
179         basic vocabulary access, basic symbol parsing.\r
180 BIFB.A\r
181         basic I/O, more of the inner interpreter, extended expression evaluation,\r
182         the rest of the basic symbol table access.\r
183 BIF1.A\r
184         data movers, common expression evaluation,\r
185         stack pointer access, more of the inner interpreter,\r
186         high-level compiler.\r
187 BIF1B.A\r
188         common expression evaluation, extended expression evaluation,\r
189         innards of the high-level compiler, more of the high-level compiler,\r
190         compiler directive.\r
191 BIF2.A\r
192         more common expression evaluation, common constants,\r
193         I/O constants, character typing constants,\r
194         symbol table globals, compiler globals, parser globals, I/O globals.\r
195 BIF2B.A\r
196         compiler globals, more high-level compiler,\r
197         more common expression evaluation, formatted output.\r
198 BIF3.A\r
199         more basic symbol table, symbol table, more compiler, more formatted output,\r
200         more data movers, more low-level parser (formatted input), more I/O,\r
201         more extended expression evaluation, more expression evaluation, \r
202         more compiler directives, an extension to the inner interpreter.\r
203 BIF3B.A\r
204         more formatted output, more innards of the high-level compiler,\r
205         more high-level compiler.\r
206 BIF4.A\r
207         more innards of the expression evaluator, more common expression evaluation,\r
208         more I/O (buffer handling).\r
209 BIF4B.A\r
210         more high-level compiler, more compiler directive.\r
211 BIF5.A\r
212         more innards of the high-level compiler, more I/O (buffering),\r
213         disk access, error handling, more formatted output.\r
214 BIF5B.A\r
215         more error handling, screen-based sector (character) editor.\r
216 BIF6.A\r
217         more parser (formatted input), I/O (terminal), compiler (input),\r
218         symbol table (lookup).\r
219 BIF6B.A\r
220         symbol table, compiler innards, null vector test, \r
221         more screen-based sector editor.\r
222 BIF7.A\r
223         compiler, formatted output, compiler directives\r
224 BIF7B.A\r
225         error handling, symbol tables, compiler directives.\r
226 stripln.c,\r
227 32col.c, \r
228         C language source and Macintosh executables for stripping line \r
229         numbers and reformatting 32 column source code "screens". The two \r
230         XXX.GXX.out files below are output of the 32col program.\r
231 \r
232 -----\r
233 \r
234 Hopefully, I will shortly have time to reconstruct useful things from the \r
235 following files on the tools.dsk disk image and/or the cs431 disk image:\r
236 \r
237 TOOLS.G00, TOOLS.G00.out\r
238         FORTH source for disk listing, screen handling, definition dumping, \r
239         sector copying, forward referencing, buffer maintenance, \r
240         experimenting with hardware, double (32 bit) integer math, etc.,\r
241         and a post-fix assembler.\r
242 PAIRS.G28, PAIRS.G28.out\r
243         a "database" example from one of my FORTH books.\r
244 \r
245 and\r
246 \r
247 SCR33.ARR\r
248         arrays for CS431.\r
249 SCR34.LOC\r
250         some math for CS431.\r
251 SCR40.431\r
252         test suite for CS431.\r
253 \r
254 \r
255 \r