R.T. Russell's Z80 BBC Basic Is Now Open Source
cowlark.com
cowlark.com
For background: many programmes produced on colour videotape by the BBC in the 70s, were distributed to overseas broadcasters on black and white film only. When the BBC destroyed the original videotapes, this left the black and white films as the only remaining copies of these programmes. In some cases, however, the colour information had been accidentally embedded into the black and white film (a notch filter should have been used to remove it).
So around 2008, Richard developed a piece of software, in BBC BASIC, which was able to recover the embedded colour signal and restore several programmes held in black and white to their full colour glory.
I'm currently working on a homebrew Z80 computer on breadboards and wirewrapped boards, and building all the (simple) hardware and software from scratch, using vintage chips (strictly no post-1989 chips) and Steve Ciarcia's Build Your Own Z80 Computer as a reference, but with a much higher spec (32K or better).
My original plan is porting Li-Chen Wang's Tiny BASIC (https://en.wikipedia.org/wiki/Tiny_BASIC) to my homebrew computer, and describing its operation at my local hackerspace. Basically, after Bill Gates' has written his letter, there was a revolt in the microcomputer scene and many hobbyists sought alternative implementations. Around the same time, Li-Chen Wang released his hobby project - Tiny BASIC, with full source in public domain. In retrospect, it can be seen as a free software project before the free software movement. Although its functionality was extremely limited Proof-of-Concept and never widely used, but I believe it's a piece of important legacy of the FLOSS community worth mentioning.
But now, since BBC Basic is now free, I'm looking forward to port BBC Basic to my system as well!
I built my own computer with breadboards and a very simple EEPROM. My goal was to have it just turn on a few LED lights and do so according to a few very simple switches. That was satisfying enough. The wow it works moment was worth the many hours with things like an oscilloscope.
If you want to do more than what I did - just get the thing to turn on - then I highly recommend the BBC BASIC. It is just built better than other BASICs that were doing the rounds and definitely suits a hardware oriented project.
If you wanted a breadboard built computer to do actual interfacing, maybe to a strain gauge or other hardware then you will do well to take the BBC BASIC route. You can talk to your IO controller with it and do so with the built in assembler. Your code for presenting results or storing data can be done in BASIC and you can drop down to assembler to do the nitty gritty stuff quite easily. On today's modern computer even if running Linux you are kind of stuck as to where to start, with BBC BASIC you can accomplish low level things from first principles.
Whatever you end up doing with your project, I think that there is definite merit in doing it with BBC BASIC, I think you can beat a path that others (particularly in the UK) will see as a good one to follow. Good luck and have fun stripping those wires!
The UK owes a lot to the people such as Sophie Wilson (who wasn't Sophie then) that were extremely forward thinking. The BBC Micro was just for kids. Rather than dumb it down the creators went the other way.
Anyone not familiar with the BBC Micro (because they weren't a kid in the UK in the 1980's) can't really appreciate how good it was and for its time. Perhaps an analogy could be found between arcade games machines and home consoles of the era, the arcade machine just worked, the console was just compromised in every way in comparison to what you had in the arcade original.
It was the same with the BBC and home computer rivals. There was just an edge of performance to it that no other home computers had. This was because the hardware had all the add ons, e.g. a decent sound chip, not just one but two competent graphics chips, a socket next to the keyboard to put your home blown EEPROM in and every port you could imagine at the back and under the machine.
The BBC Model B was a true Rolls Royce of a machine and we gave it to kids.
BBC BASIC was equally deluxe. The built in assembler that was embedded in was awesome. Particularly when you only had a 6502 which has all of three registers - X, Y and A. I was doing assembler at school and plenty of other kids were. No extra software was needed, nobody needed to pay for a compiler, it was all in there.
The rest of BBC BASIC was sophisticated compared to all other BASICs of the time. You could and did write procedures at a time when other BASICs would have you doing GOSUB with a line number.
Later when I moved on to the IBM PC with MS-DOS I felt extremely disappointed. It was actually backward! It lacked the sophistication the BBC Micro had. It was MS-DOS that I found particularly dumb, I just felt 'is this all there is?' and could not believe this was the new 'better'.
Exposure to BBC BASIC, UNIX and today's Linux makes me wonder whether Microsoft's products from MS-DOS to Windows have really advanced computing as we know it. I am not knocking Microsoft entirely as I do believe some of their products such as Word 2.0c were fantastic at enabling progress. But with Microsoft came a particular model of personal computing, we stayed on floppy disks far too long and Microsoft BASIC introduced things that are best not taught - i.e. the GOTO statement.
Anyway, the BBC Micro and BBC BASIC were free from this Microsoft way of doing things, the BBC Micro got it right and it was a vision that was gifted to a generation of schoolchildren.
They later spun the processor division off, calling it “Acorn RISC Machines”, where Sophie Wilson still works - except, it was shortened to the acronym, ARM. Yes, that ARM.
https://www.riscosopen.org/content/downloads/raspberry-pi
It is the closest you can get to a BBC Micro today, and it is extremely close. A BASIC library for working with the GPIO pins is even included.
The whole thing is Apache 2.0 licensed.
Acceptance of transgenderedness means that we call people by the name they wish to choose but it does not mean we eradicate the past. Same if someone gets married and changes their name. It should be no big deal and nothing awkward.
It is all about merit. It gets a bit silly if we give people extra cringeful 'well done!' marks just because of some identity politics thing.
Sophie is not the only successful transgender person in UK tech, however I think she just gets on with her work. Also fully admirable is Kate Craig Wood and she does write on the subject of how it all works out. Since your interest is piqued and this is the internet, here you go. Again, I would say in Kate's work it is more her business that defines her rather than the transgendered aspect, so you should find how they run their business (not beholden to VC money etc.) quite fascinating too:
One thing I find really interesting about BBC Basic is that all the low-level routines (floating point, graphics, etc.) are available for your own assembly programs so you can use them even when you are not using Basic. I don't know if other 8 bit machines had this.
Not that BBC BASIC was written badly and needing extra assembler stuff. Commodore people had to poke obscure data into obscure places for things that should have been in BASIC.
On the Sinclair machines you were using REM/CODE statements to store HEX, so you would need to look up the hex codes for all your commands and then type them in. So much to get wrong!
So no, the BBC was in its on league.
A parallel today is browsers. Remember when Internet Explorer did not have dev tools? Or when you needed Firebug for Firefox?
Chrome came along with proper dev tools, changing all that. I think that the BBC BASIC was analogous to that.
I am glad I was not alone in finding the PC experience after the arcade grade instant-on performance of the BBC. I didn't get Pascal but Wordwise takes me down memory lane. You had some fine ROMS... All bank switchable of course.
In reality kids were largely not allowed to go anywhere near the beige Rolls Royces gathering dust in classroom cupboards, because they were so expensive and/or because nobody was trained to use them.
The massive gaming and programming ("computer literacy") explosion in the UK in the 80s was almost entirely thanks to the ZX Spectrum, ZX81 and ZX80.
I totally forgot about Frak. I will have to see if someone has uploaded that being played to YouTube. Inevitably they will play better than I would and I would also avoid the risk of getting hooked into a game...
https://www.youtube.com/watch?v=UgiA10MfOu4
From the comments, the levels on stage 1 spell 'FRAK'. As per the comments, I don't think I knew that!
It was such a rich diversity of games then, it was more like listening to music in that you don't just have the one song you listen to, depending on your mood you have different things to listen to. With modern consoles you just have the one or two things in practice, you don't have the repertoire.
As well as the BBC Micro there was also the CUB monitor and disk drives. Imagine that!
This was mid eighties, I don't think I did any formal computer lessons at school, it was a lunchtime thing where things like Frak certainly got played. I know you envy my fortune - and in a regular state school.
During one holiday I made things like a pantograph arm for drawing with - bits of carefully cut perspex, potentiometers and the A/D port, then some code to do the trig and draw something on a screen. This was my first go at using a saw, a file, a soldering iron and also my first experience learning the reality does not match the dream. The noise in the A/D was ridiculous and having real time screen updates was also not exactly without lag.
This was an entirely self directed project, no competition or even idea from a magazine. Just a desire to draw at a time when ambition just worked. It was useless at what it did but there was more maths in that than what 99% of the population ever use, even if simple trig.
To think nowadays kids all have their own laptops/tablets/phones and there is zero recognition that 32K of RAM and a beige box could be special. But they actually do much better things now than anything I was ever up to.
Mostly I'd just play with "PRINT" and "COLOUR" in BBC BASIC.
Incidentally, the BBC Micro had a real operating system, and a lot of BASIC functionality just shelled out to the OS. Russell's Z80 version replicates a lot of this itself, so commands like LOAD and SAVE to load and save raw memory will just work. EXEC, which reads console input from a file, and SPOOL, which writes console output to a file, both work too, which means converting to and from text is easy.
Of course, none of the graphics primitives work, but all the hooks are there if you want to extend it!
If anyone's interested in what BBC BASIC looks like, a little while ago I managed to recover a program I wrote in it in 1991. It uses graphics so I haven't tried it on the Z80 version, but it's interesting to look at nevertheless; and there's an emulator too: