1 2 3 README file for 4 5 6 Bywater BASIC Interpreter, version 3.20 7 --------------------------------------------- 8 9 Copyright (c) 1993, Ted A. Campbell 10 for bwBASIC version 2.10, 11 October 1993 11 12 Version 2.20 modifications by Jon B. Volkoff, 13 25 November 1995 14 15 Patch level 1 release by Jon B. Volkoff, 16 15 March 1996 17 18 Patch level 2 release by Jon B. Volkoff, 19 11 October 1997 20 21 Version 2.30 modifications by Paul Edwards, 22 5 March 2008 23 24 Version 2.40 modifications by Paul Edwards, 25 26 Jan 2009 26 27 Version 2.50 modifications by Paul Edwards, 28 4 June 2009 29 30 Version 2.60 modifications by Paul Edwards, 31 6 November 2012 32 33 Version 2.61 modifications by Paul Edwards, 34 4 August 2014 35 36 Version 3.00 modifications by Howard Wulf, AF5NE 37 12 May 2015 38 39 Version 3.10 modifications by Howard Wulf, AF5NE 40 27 July 2016 41 42 Version 3.20 modifications by Howard Wulf, AF5NE 43 4 June 2017 44 45 46 47 48DESCRIPTION: 49 50 The Bywater BASIC Interpreter (bwBASIC) implements a large 51 superset of the ANSI Standard for Minimal BASIC (X3.60-1978), 52 a significant subset of the ANSI Standard for Full BASIC 53 (X3.113-1987), and many classic BASIC dialects in C. bwBASIC 54 seeks to be as portable as possible. 55 56 This version of Bywater BASIC is released under the terms of the 57 GNU General Public License (GPL), which is distributed with this 58 software in the file "COPYING". The GPL specifies the terms 59 under which users may copy and use the software in this distribution. 60 61 A separate license is available for commercial distribution, 62 for information on which you should contact the author. 63 64 65 66OBTAINING THE SOURCE CODE: 67 68 The source code for bwBASIC is available from 69 http://bwbasic.sourceforge.net 70 71 72COMMUNICATIONS: 73 74 email: tcamp@delphi.com (for Ted Campbell) 75 eidetics@cerf.net (for Jon Volkoff) 76 mutazilah@gmail.com (for Paul Edwards) 77 78 79A LIST OF BASIC COMMANDS AND FUNCTIONS IMPLEMENTED in bwBASIC: 80 81 The complete list of over 500 commands, functions and operators is 82 in the file "ALL.txt" in the DOCS directory. Documentation for each 83 dialect is also in the DOCS directory. Be aware that the commands, 84 functions and operators available depend upon the particular BASIC 85 dialect selected using the OPTION VERSION command. 86 87 88CHANGE HISTORY 89 90CHANGES FROM 3.10 to 3.20 91 92 * Implements most of the following BASIC dialects: 93 OPTION VERSION "BYWATER" ' Bywater BASIC 3 94 OPTION VERSION "BYWATER-2" ' Bywater BASIC 2 95 OPTION VERSION "CALL/360" ' SBC CALL/360 Mainframe BASIC 96 OPTION VERSION "CBASIC-II" ' CBASIC-II for CP/M 97 OPTION VERSION "DARTMOUTH" ' Dartmouth DTSS BASIC 98 OPTION VERSION "ECMA-55" ' ANSI Minimal BASIC 99 OPTION VERSION "ECMA-116" ' ANSI Full BASIC 100 OPTION VERSION "GCOS" ' GE 600 Mainframe BASIC 101 OPTION VERSION "HAARDT" ' bas 2.4 by Michael Haardt 102 OPTION VERSION "HANDBOOK1" ' The BASIC Handbook, 1st Edition 103 OPTION VERSION "HANDBOOK2" ' The BASIC Handbook, 2nd Edition 104 OPTION VERSION "HEATH" ' Heath Benton Harbor BASIC 105 OPTION VERSION "MARK-I" ' GE 265 Mainframe BASIC 106 OPTION VERSION "MARK-II" ' GE 435 Mainframe BASIC 107 OPTION VERSION "MBASIC" ' Microsoft BASIC-80 for Xenix 108 OPTION VERSION "PDP-8" ' DEC PDP-8 BASIC 109 OPTION VERSION "PDP-11" ' DEC PDP-11 BASIC 110 OPTION VERSION "RBASIC" ' Micronics RBASIC for 6809 FLEX 111 OPTION VERSION "RSTS-11" ' DEC RSTS-11 BASIC-PLUS 112 OPTION VERSION "SYSTEM/360" ' IBM System/360 Mainframe BASIC 113 OPTION VERSION "SYSTEM/370" ' IBM System/370 Mainframe BASIC 114 OPTION VERSION "TRS-80" ' TRS-80 Model I/III/4 LBASIC 115 OPTION VERSION "VINTAGE" ' Vintage BASIC 1.0.1 116 OPTION VERSION "XBASIC" ' TSC XBASIC for 6800 FLEX 117 118 * CONST variable [, ...] = value 119 Assigns the value to variable. 120 Any later assignment to the variable causus a VARIABLE NOT DECLARED error. 121 122 * DIM now supports lower and upper bounds. 123 OPTION BASE 1 124 DIM X( 9 ) ' lower bound is 1 125 DIM Y( 5 TO 9 ) ' lower bound is 5 126 127 * DIM now supports virtual variables. 128 OPTION BASE 1 129 OPEN "VIRTUAL.DAT" FOR VIRTUAL AS # 3 ' virtual data file 130 DIM # 3, A( 1000 ) ' array is virtual 131 LET A( 1000 ) = 0 ' value is written to the file 132 LET X = A( 1000 ) ' value is read from the file 133 CLOSE # 3 ' array is no longer valid 134 135 * ERROR 27, "Bad DATA" 136 Occurs when the READ command detects garbage in a DATA command. 137 138 * INPUT LINE 139 Same as LINE INPUT. 140 141 * MAT now supports lower and upper bounds. 142 OPTION BASE 1 143 MAT X( 9 ) = ZER ' lower bound is 1 144 MAT Y( 5 TO 9 ) = ZER ' lower bound is 5 145 MAT X = ZER( 9 ) ' lower bound is 1 146 MAT Y - ZER( 5 TO 9 ) ' lower bound is 5 147 148 * MAXLEN() 149 Returns the maximum string length. 150 151 * OPTION DIGITS integer 152 Sets the number of significant digits for PRINT. 153 Setting the value to zero restores the default. 154 155 * OPTION EDIT string$ 156 Sets the program name used by the EDIT command. 157 Setting this to "" disables EDIT command. 158 159 * OPTION FILES string$ 160 Sets the program name used by the FILES command. 161 Setting this to "" disables FILES command. 162 163 * OPTION PROMPT string$ 164 Sets the prompt. 165 166 * OPTION PUNCT AT char$ 167 Sets the PRINT AT character, commonly "@". 168 Setting this to "" disables PRINT AT. 169 Setting this to a non-punctuation character is not supported. 170 171 * OPTION PUNCT BYTE char$ 172 Sets the BYTE type suffix, commonly "~". 173 Setting this to "" disables BYTE suffix. 174 Setting this to a non-punctuation character is not supported. 175 176 * OPTION PUNCT COMMENT char$ 177 Sets the trailing COMMENT character, commonly "'". 178 Setting this to "" disables trailing comments. 179 Setting this to a non-punctuation character is not supported. 180 181 * OPTION PUNCT CURRENCY char$ 182 Sets the CURRENCY type suffix, commonly "@". 183 Setting this to "" disables CURRENCY suffix. 184 Setting this to a non-punctuation character is not supported. 185 186 * OPTION PUNCT DOUBLE char$ 187 Sets the DOUBLE type suffix, commonly "#". 188 Setting this to "" disables DOUBLE suffix. 189 Setting this to a non-punctuation character is not supported. 190 191 * OPTION PUNCT FILENUM char$ 192 Sets the FILE NUMBER prefix, commonly "#". 193 Setting this to "" disables the FILE NUMBER prefix. 194 Setting this to a non-punctuation character is not supported. 195 196 * OPTION PUNCT IMAGE char$ 197 Sets the shortcut IMAGE character, commonly ":". 198 Setting this to "" disables the shortcut IMAGE character. 199 Setting this to a non-punctuation character is not supported. 200 201 * OPTION PUNCT INPUT char$ 202 Sets the shortcut INPUT character, commonly "!". 203 Setting this to "" disables the shortcut INPUT character. 204 Setting this to a non-punctuation character is not supported. 205 206 * OPTION PUNCT INTEGER char$ 207 Sets the INTEGER type suffix, commonly "%". 208 Setting this to "" disables INTEGER suffix. 209 Setting this to a non-punctuation character is not supported. 210 211 * OPTION PUNCT LONG char$ 212 Sets the LONG type suffix, commonly "&". 213 Setting this to "" disables LONG suffix. 214 Setting this to a non-punctuation character is not supported. 215 216 * OPTION PUNCT LPAREN char$ 217 Sets the LEFT PARENTHESIS character, commonly "(". 218 Setting this to a non-punctuation character is not supported. 219 220 * OPTION PUNCT PRINT char$ 221 Sets the shortcut PRINT character, commonly "?". 222 Setting this to "" disables the shortcut PRINT character. 223 Setting this to a non-punctuation character is not supported. 224 225 * OPTION PUNCT QUOTE char$ 226 Sets the QUOTE character, commonly """". 227 Setting this to a non-punctuation character is not supported. 228 229 * OPTION PUNCT RPAREN char$ 230 Sets the RIGHT PARENTHESIS character, commonly ")". 231 Setting this to a non-punctuation character is not supported. 232 233 * OPTION PUNCT SINGLE char$ 234 Sets the SINGLE type suffix, commonly "!". 235 Setting this to "" disables SINGLE suffix. 236 Setting this to a non-punctuation character is not supported. 237 238 * OPTION PUNCT STATEMENT char$ 239 Sets the shortcut STATEMENT seperator character, commonly ":". 240 Setting this to "" disables the STATEMENT seperator. 241 Setting this to a non-punctuation character is not supported. 242 243 * OPTION PUNCT STRING char$ 244 Sets the STRING type suffix, commonly "$". 245 Setting this to "" disables STRING suffix. 246 Setting this to a non-punctuation character is not supported. 247 248 * OPTION RECLEN integer 249 Sets the default record length for RANDOM files, commonly 128. 250 Setting thisto zero means there is no default RANDOM record 251 length, so the record length must be specified in the OPEN 252 statement. 253 With OPTION RECLEN 128: 254 OPEN "FILE.DAT" FOR RANDOM AS #3 255 is considered to be the same as 256 OPEN "FILE.DAT" FOR RANDOM AS #3 LEN 128 257 With OPTION RECLEN 0: 258 OPEN "FILE.DAT" FOR RANDOM AS #3 259 causes an error. 260 261 * OPTION RENUM string$ 262 Sets the program name used by the RENUM command. 263 Setting this to "" disables RENUM command. 264 265 * OPTION SCALE integer 266 Sets the number of digits to round after the decimal point for PRINT. 267 Setting the value to zero disables rounding. 268 269 * OPTION USING DIGIT 270 * OPTION USING COMMA 271 * OPTION USING PERIOD 272 * OPTION USING PLUS 273 * OPTION USING MINUS 274 * OPTION USING EXRAD 275 * OPTION USING DOLLAR 276 * OPTION USING FILLER 277 * OPTION USING LITERAL 278 * OPTION USING FIRST 279 * OPTION USING ALL 280 * OPTION USING LENGTH 281 Sets the characters recognized by PRINT USING. 282 Setting these to a non-punctuation character is not supported. 283 284 * OPTION VERSION now requires a string instead of a literal. 285 Some version names have changed. 286 287 * OPTION VERSION "PDP-8" 288 Added LPT, PTP, PTR, TTY, TTY IN and TTY OUT commands. 289 Added GET() and PUT() functions. 290 291 * OPTION VERSION "CALL/360" 292 * OPTION VERSION "SYSTEM/360" 293 * OPTION VERSION "SYSTEM/370" 294 Added alphabet extenders. $ is a string variable. 295 296 * OPTION ZONE integer 297 Sets the PRINT zone width. 298 Setting the value to zero restores the default. 299 300 * REPEAT - UNTIL added 301 REPEAT 302 ... 303 EXIT REPEAT 304 ... 305 UNTIL expression ' exits when expression != 0 306 307 * SPC( X ) and TAB( X ) 308 No longer use control codes. 309 310 * UNTIL - UEND removed (to add REPEAT - UNTIL) 311 Here is a work-around for existin code using UNTIL-UEND: 312 UNITL expression -->> WHILE NOT expression 313 ... ... 314 EXIT UNTIL -->> EXIT WHILE 315 ... ... 316 UEND -->> WEND 317 318 * from Howard Wulf, AF5NE 319 320 321CHANGES FROM 3.00 to 3.10 322 323 * Implements most of the following BASIC dialects: 324 OPTION VERSION DARTMOUTH ' Dartmouth DTSS BASIC 325 OPTION VERSION MARK-I ' GE 265 Mainframe BASIC 326 OPTION VERSION MARK-II ' GE 435 Mainframe BASIC 327 OPTION VERSION SYSTEM-360 ' IBM System/360 BASIC 328 OPTION VERSION SYSTEM-370 ' IBM System/370 BASIC 329 OPTION VERSION CBASIC-II ' CBASIC-II for CP/M 330 OPTION VERSION ECMA-55 ' ANSI Minimal BASIC 331 OPTION VERSION HANDBOOK1 ' The BASIC Handbook, 1st Edition 332 OPTION VERSION HANDBOOK2 ' The BASIC Handbook, 2nd Edition 333 OPTION VERSION TRS-80 ' TRS-80 Model I/III/4 LBASIC 334 OPTION VERSION BASIC-80 ' Microsoft BASIC-80 for Xenix 335 OPTION VERSION ECMA-116 ' ANSI Full BASIC 336 337 * from Howard Wulf, AF5NE 338 339 340CHANGES FROM 2.61 to 3.00 341 342 * Code redesign from Howard Wulf, AF5NE 343 344 345CHANGES FROM 2.60 to 2.61 346 347 * Bug fix from Matthias Rustler 348 349 350CHANGES FROM 2.50 to 2.60 351 352 * New maths functions and append mode support from Edmond Orignac 353 354 * Bug fixes 355 356 357CHANGES FROM 2.40 to 2.50 358 359 * Bug fixes 360 361 * New compilation procedure for MVS and CMS 362 363 364CHANGES FROM 2.30 to 2.40 365 366 * Bug fixes from Bill Chatfield 367 368 * Updated documentation 369 370 * Added support for compiling on CMS (another IBM mainframe OS) 371 372 373CHANGES FROM 2.20pl2 to 2.30 374 375 * Minor bug fixes, cosmetic improvements and portability improvements 376 377 * Added support for compiling on MVS (IBM mainframe) 378 379 380CHANGES FROM 2.20pl1 to 2.20pl2 381 382bwb_cmd.c 383 Fixed calling stack level logic in RETURN statement to prevent erroneous 384 "RETURN without GOSUB" messages. 385 386bwb_cnd.c 387bwb_stc.c 388 389 Changed continuation condition for WHILE, ELSEIF, and LOOP UNTIL 390 to be != FALSE, not == TRUE. More in line with common commercial 391 BASIC implementations. 392 393bwb_mth.c 394 Fixed initialization in VAL function so that old results are not later 395 returned as values. 396 397bwb_var.c 398 Added parenthesis level checking to dim_getparams. Using multi-level 399 expressions as array subscripts was causing the program to bomb. 400 401bwx_iqc.c 402bwx_tty.c 403bwb_mes.h 404 Added second copyright notice. 405 406bwb_dio.c 407bwb_str.c 408 Added support for strings longer than 255 characters. 409 410bwb_prn.c 411 Disabled tab expansion and print width checks when not printing to a file. 412 413bwb_inp.c 414 Fixed LINE INPUT file reads to accommodate strings of length MAXSTRINGSIZE. 415 416bwx_ncu.h 417bwx_ncu.c 418 New files. Code for UNIX ncurses interface, compliments of L.C. Benschop, 419 Eindhoven, The Netherlands. 420 421Makefile.ncu 422 New files. Sample makefile for ncurses implementation. 423 424bwbasic.h 425 Revised defines for MININTSIZE and MAXINTSIZE from 16-bit to 32-bit limits. 426 Revised define for MAXSTRINGSIZE from 255 to 5000 characters. 427 Changed string length from unsigned char to unsigned int to support strings 428 longer than 255 characters. 429 Added support for new ncurses package. 430 Revised VERSION define to reflect above changes. 431 432 433CHANGES FROM 2.20 to 2.20pl1 434 435bwb_cnd.c 436 437 Moved init routine for bwb_while so that it would be initialized regardless 438 of expression value, not just if TRUE. This was causing some segmentation 439 faults in WHILE-WEND loops. 440 441bwb_elx.c 442 443 Plugged gaping memory leak. Temp variable space for expression evaluation 444 was being allocated but not freed when done (oops!). 445 446bwb_fnc.c 447 448 Added check for NULL return from getenv to prevent segmentation faults. 449 450bwbasic.h 451 Revised VERSION define to reflect above changes. 452 453 454 455CHANGES FROM 2.10 to 2.20: 456 457 * Plugged numerous memory leaks, resolved memory overruns and allocation 458 difficulties. 459 460 * General cleanup and bug fixes, too many to list in detail here. 461 The major problem areas addressed were: 462 463 - RUN command with file name argument 464 - nested and cascaded FOR-NEXT loops 465 - PRINT USING 466 - EOF, LOF functions 467 - string concatenation 468 - operator hierarchy 469 - multi-level expression evaluation 470 - hex constant interpretation 471 - hex and octal constants in INPUT and DATA statements 472 473 * Added a CLOSE all files feature (when no argument supplied). 474 475 * Added a unary minus sign operator. 476 477 * Added a MID$ command to complement the MID$ function. 478 479 * Added a RENUM facility in a standalone program. 480 481 * Added checking in configure for unistd.h (important on Sun systems). 482 483 484 485 486