Still pondering over BASIC

Last month I put a bit of effort into fixing BINSIC – the collection of Groovy scripts that allows the execution of Sinclair ZX80/81 BASIC programs – and I have been thinking about the thing that they offer that modern computers don’t: the ability to switch on and just write a simple program to solve a problem.

The obvious thing to do would be a browser plug-in that replicates the straight-to-coding environment: particularly for Chromebooks and the like.

BASIC lacks expressive power but it is simple to use and would be a good choice, though I guess the line numbers abstraction would have to go.

BINSIC – Sinclair BASIC emulator – is back

BINSIC was my 2012 project to emulate Sinclair ZX80/81 BASIC on a modern computer.

It is a series of Groovy classes that provide a mixture of interpretation and ‘domain specific language’ (i.e. executing BASIC as native Groovy).

Over the years bitrot seems to have set in and the code in the GitHub repo wouldn’t work and the BINSIC jar that would allow Java users to execute some BASIC without a Groovy install disappeared.

I have fixed all that now. You can see the Groovy at the GitHub BINSIC repo – and use that to explore or edit the code.

If you just want to cut to the chase then have a look here:

There you’ll find a jar and test.bas – an implementation of Conway’s Game of Life.

To run the code download both and execute:

java -jar binsic.jar test.bas

When the code starts specify filled cells with a character like ‘*’ and empty cells with a space. (You don’t have to fill in a whole line, but a blank line needs at least a single space.

When you have filled in the initial grid type ‘DONE’ and hit enter and the code should start – to advance through the generations hit enter.

Feel free to experiment with your own BASIC programs – I have copied a few from the classic BASIC Computer Games and they generally work – but I’ve not tried anything very long. All contributed programs would be gratefully accepted – happy to consider pull requests at the repo.

BASIC is out of fashion these days – but you can read about the motivation behind the project here.

Back from the dead (almost)

hexmon BASICThe graphic you can see here is the partially recovered code of a program I wrote thirty years ago – “hexmon” – to display chunks of ZX80 memory in hexadecimal format (at least I think that’s what it did).

I am determined to fully recover it – but as you can see it works well so far and the machine code string in the middle looks particularly good – especially as I can see it ends with C9 which I know is the Z80 “return” command.