Last week I wrote about the diving I've done back into Spectrum BASIC coding.

I have to say that it's been a LOT of hard work to update the old code. Updating it to work on all the newer machines and emulators, while still being able to fit the original code's purpose; to work on a 16Kb contended-RAM spectrum has been... a challenge.

I've had to bend and break a good few rules, abandon a few design patterns and essentially 'go rogue' on whatever sense of modern coding decency that might exist these days...

In short, heaven! Coding in the 80s was a real wild west. Some of the Usborne books which covered the Commodore PET, Spectrum, ZX80, ZX81, C64, CPC464 and even the Apple II had so many little crazy stars and moon symbols to indicate places where you needed to put something machine-specific, that sometimes the code looked like a festival...

Spectrum BASIC is marvellous in many fun little ways, but it was incomplete and buggy. When you do pedestrian stuff, it works perfectly well, but when you try to move towards more esoteric things, krakens lie in wait.

It's been absolute joy to spend hours or days puzzling over why a single character can cause RAM to jump by a kilobyte.. why doing something one way works fine, while another way leads to a random reboot. Digging into the actual structure of the BASIC codelines and messing with them structurally has been like exploring a new frontier. I had written a VARS-walker back in the 80s, and had already messed about with x86 and z80 asm in the early 90s. (On one family holiday, my reading was a book on 8086/8088 assembly - I was such a nerd). But to actually pull apart the basic lines themselves, I don't think I'd ever done that purely because doing it on a hardware spectrum was (and i'll use the deep technical term here, sorry)... an arse.

In this modern age of PCs, where we have a speccy-in-a-window and can compile and debug code in seconds, the task of experimenting is fantastic. Back when it was a 5-minute reload from tape after a crash, it understandably wasn't. With all these advancements, it's been real fun to dig the Spectrum Next out and get back to Speccy programming.

Admittedly, I've had it in Spectrum 48k mode about 90% of the time since August... I've only dipped back into NextBASIC a few times just to try out some hacks to see if they still work (mostly they do!), so now I've finished the book project, I'm going to jump back to NextBASIC. I've got the itch to finish off some projects, download the latest z88dk (I hear there's a New C library for the Next), and have some fun.

Previous Post Next Post