Early pre-IBM personal computers had very little operating system on them, but most of them came with a Microsoft BASIC interpreter built-in. PC makers gladly paid Microsoft a small fee to include this feature. The programming language was free and open, inviting all to write programs, a policy which was inverted in stark contrast with Microsoft's later monopoly.
TRS-80 Extended Color BASIC was a licensed version of Microsoft BASIC, substantially enhanced by Tandy Radio Shack engineers. It included core BASIC features along with very easy to use graphics and sound capabilities.
The CS 370 project in Fall 2003 is to implement a compiler for "as much of TRS-80 Extended Color BASIC as we can". A vintage 1981 BASIC is selected as a relatively simple, yet real, language to write a compiler for.
| name | description/comment/example |
|---|---|
| CLOAD | |
| CLEAR | |
| CSAVE | |
| DATA | |
| END | |
| FOR | |
| GOSUB | |
| GOTO | |
| IF | |
| INKEY$ | |
| INPUT | |
| LIST | |
| NEW | |
| NEXT | |
| READ | |
| REM | |
| RESTORE | |
| RETURN | |
| RUN | |
| SKIPF | |
| SOUND | |
| STEP | |
| THEN | |
| TO |
| name | description |
|---|---|
| ASC | return the ASCII integer for the first character in a string |
| CHR$ | return the one-letter string for a given ASCII integer |
| CLS | clears the screen. The parameter is OPTIONAL color (default: green) |
| INT | convert number to integer |
| JOYSTK | |
| LEFT$(s, n) | return the leftmost n characters of s |
| LEN | string length |
| MID$(s, n) | return middle n characters of s |
| PEEK | returns contents of a memory address (CS 370 will not do this one) |
| SET | |
| RESET | |
| RIGHT$(s, n) | return rightmost n characters of s |
| RND | returns a random number |
| VAL | converts a string to a number |
+ - * / = > >= => <= =< < <> ><
strings, enclused in double quotes decimal integers consisting of 1 or more digits real numbers consisting of one or more digits with a period character somewhere
: is a statement separator ( ) override default operator precedence
white space includes newlines and tabs REM marks a comment line