BASIC commands

The BASIC programming language doesn’t have functions or libraries or a standard API - it has a number of built-in commands, and that is all you ever get. Different versions of BASIC has different commands, and you could buy expansions that “added” more commands to the version that your computer came with - actually they didn’t “add” anything as much as they replaced the entire language with another, that just happened to also include all the old commands.

The commands available for the Commodore 64 ARE:

ABS FN LOAD REM SYS
AND FOR LOG RESTORE TAB(
ASC FRE MID$ RETURN TAN
ATN GET NEW RIGHT$ THEN
CHR$ GET# NEXT RND TIME
CLOSE GOSUB NOT RUN TIME$
CLR GOTO ON SAVE TO
CMD IF OPEN SGN USR
CONT INPUT OR SIN VAL
COS INPUT# PEEK SPC( VERIFY
DATA INT POKE SQR WAIT
DEF LEFT$ POS STATUS
DIM LEN PRINT STEP
END LET PRINT# STOP
EXP LIST READ STR$

Categories

Not all of them are equally important, and I won’t implement every single one. To get a better idea of what the various commands are doing, I’ve sorted them into categories

Math

Strings

Input/Output

Memory management

Source code - editor/environment

Variables

Program flow

As I won’t be writing code that runs on a particular machine, or let the BASIC program access the hardware, all the Memory management can be omitted. I also don’t think I will be using file I/O, so I can skip most of those commands. Regarding math and string, I’ll add in the library-functions once I get going with most of the rest. They can probably give me some inspiration on how to include additional libraries, if I want to make an extended BASIC.

Development plan

I will begin with the editor, and implement simple input and output functions - notably PRINT - and add literals and variables, before going on with letting the user create actual programs, to edit, run, and store. Only then will I begin looking into program flow, and only then begin on math and strings.

→ continue to Editor