Friday, December 11, 2009

Initial BASIC Language Subset

Below is a list of BASIC commands that will be implemented first. These commands will allow simple programs to be entered and run. It will allow the expression parser and the complicated blocking code to be implemented and tested. These are listed in the approximate order to be implemented.
  1. LET (assignment)
  2. PRINT
  3. INPUT
  4. DIM (for arrays)
  5. REM
  6. IF/THEN/ELSE/ENDIF
  7. FOR/NEXT
  8. DO/LOOP (with WHILE/UNTIL)
The features listed below will be part of the initial implementation:
  1. Double precision math operators (+,-,*,/, \, MOD, and ^)
  2. Variables (with any size name)
  3. Constants
  4. Numerical functions (ABS, FIX, INT, RND, SGN, and SQR)
  5. Scientific functions (ATN, COS, EXP, LOG, SIN, and TAN)
  6. Relational operators (=,<>,<,<=,>, >=, AND, EQV, IMP, NOT, OR, and XOR)
  7. Print functions (comma, TAB, and SPC)
  8. Multiple dimension arrays
  9. Multiple statements per line
The important thing is to get something working and not to over complicate the initial stage. Important and necessary features like strings and integers with associated operators and variables, SELECT CASE, subroutines and user functions etc. will come in later stages. Notice the lack of a GOTO command - this was intentional. Initially classic BASIC line numbers will be used (despite the lack of a GOTO) as a way of entering the lines into memory via console mode. Eventually this will be replaced with a screen editor, but a screen editor is a major undertaking in itself, so this will be delayed for a later stage.