The following statements are supported:
- PRINT <expression>
- LET <var> = <expression>
- IF <expression> <statement>
- GOTO <expression>
- GOSUB <expression>
- RETURN
- INPUT <var>
- FOR <var> = <expression> TO <expression> [STEP <expression>]
- NEXT
- END
and additionally, these commands can be issued if not prefixed by a line number:
- LIST
- RUN
- NEW
<var> is a letter A-Z. A single array called @ is supported, its elements are @( <expression> ). The array uses all remaining memory after the program - it will eventually collide with the stack. Two system variables are available in ^ (address of start of array) and _ (current state of Random Number Generator). ^ can be used to work out how much free memory there is by subtracting it from the highest RAM address, and then subtracting 8+however much stack the program is likely to use (a few tens of bytes typically).
Signed 16-bit integer arithmetic is supported, with no overflow detection. Operators are + - * /.
Comparison operators are = <> < > <= >=. The result of a comparison is 1 if true, 0 if false.
Three functions taking a single parameter are available: ABS, USR and RND. The USR(x) function calls the address x. The RND(x) function returns a random number between 0 and x-1.
Program editing features are minimal - lines can be deleted by typing the line number by itself. Unlike in most BASIC implementations, overwriting a line is not permitted, a line must be deleted and then re-entered.
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.