Credit to LBPHacker for the R316 computer and TPTASM
Credit to lithium404 for the C to TPTASM compiler and patient support
Inspired heavily by this Wikipedia page: https://en.wikipedia.org/wiki/Tiny_BASIC
Still a prototype, make sure to report mistakes and bugs please
Usage of the command line:
Enter a command to run it immediately
Enter a line number, a space and then a command to store it at that line in the code (for example "4 PRINT A")
Enter RUN to start execution at line 0
Variables are capital letters from A to Z
Supported expression operations: +, -, *, /
Expressions support square brackets for grouping
Convenience features:
Note, that:
Keyboard layout reminder:
'+' is shift + '='
'*' is shift + '8'
'<' and '>' are shift + ',' and '.' respectively
Commands:
PRINT (list of exprs and strings)
Displays results of expressions and/or strings
Can be abbreviated as P
Examples:
PRINT 'Hi!'
PRINT A
PRINT 10-5
P 'Result:',C,[D-1]*2
LET (var) (expr)
Stores expression result in variable
Examples:
LET X X+1
LET H 10
IF (expr)(comparison)(expr) (command)
Executes command if comparison is true
Comparison operators: =, !=, <, >, <=, >=
Examples:
IF A+1>B PRINT 'YES'
IF B!=10 GOTO 5
GOTO (expr)
Continues execution at given line
GOSUB (expr)
Calls the subroutine at given line
INPUT (list of vars)
Asks for the values each of the variables
Examples:
INPUT Z
INPUT A,B,C
PLOT (x expr) (y expr)
Puts a white pixel at given position
PEEK (var) (addr expr)
Stores value from memory address to variable
POKE (addr expr) (expr)
Stores value into memory at address
RETURN
Returns from subroutine
LIST
Displays the program lines
DEBUG
Toggles printing currently executed line as the program runs
ERASE
Erases the program
CLEAR
Resets all variables to 0
END
Returns to the command line