Cram Basic in 768 bytes
- Transfer

For those who were lucky enough to write their first BASIC program in the late eighties, the 16 kilobyte interpreter volume seems quite natural. This was not always the case, interpreters with a volume of 8 and 4 kilobytes are known, of course, with a more modest set of functions. But this time, it seemed, the impossible was done - the interpreter is compressed up to 722 bytes. This is less than 768, which means that it can be placed not in four, but in three 256-byte ROM chips. Yes, there were some!
And 768 bytes is, by the way, 21, (3) times smaller than 16384. The
interpreter is written for the processor 8008 , which is not very popular among retrocomputers. For it, there is already a BASIC interpreter - SCELBAL, but it is 8 kilobyte. The 8008 instruction system resembles the 8080 instruction system without half the instructions. Or the Z80 command system without 90% of the instructions.
The first version of the interpreter, in which there were already the words GOTO, INPUT, PRINT, as well as a standard method for editing BASIC interpreters, was provided, took 570 bytes. Then the list of words was expanded to the following: FETCH, GOTO, IF, LET, NEW, OUT, PRINT, STOP, VIEW and XECUTE.
Some of them will seem strange to you. And the thing is that this interpreter recognizes words by the first letter. Therefore, INPUT had to be turned into FETCH, LIST into VIEW, and RUN into XECUTE. But GOSUB and RETURN should not be foreseen at all - then we would have to go beyond the planned volume.
The author understands the users of the MCM / 70 laptop computer, also executed on 8008, equipped with a dual cassette player and programmed in APL language with its one-letter commands.
The project together with the emulator is available here under the MIT license. The author does not have real iron at 8008. You can also download the assembler source and compilation result with comments separately.
The easiest way to build an entire project with GitHub is to use NETBEANS 8.2, you will also need SDL2. To assemble an assembler, an AS macro assembler is required .