View Single Post
Old 7th Jun 2019, 5:18 am   #10
ricard
Octode
 
ricard's Avatar
 
Join Date: Mar 2006
Location: Lund, Sweden
Posts: 1,632
Default Re: Fun with Z80 Assembler

Quote:
Originally Posted by Catkins View Post
I had two Microdrive units with my Spectrum. They were far more convienient than cassettes, until you invariably hit the dreaded "file not found", and you found you'd lost all your hard work. Cassettes were much more reliable than Microdrives, which stretched in use, and even snapped. I routinely ended up having to making multiple back-ups, on multiple microdrives, which was expensive
Yeah, the Microdrive really hammered in the need to make backups. I did some fairly serious hobby software development back in the day, in Z80 assembler, with the source code stretched over a number of files. At least once a day the content of one of the Microdrive cartridges wouldn't read properly and had to be reformatted, necessitating reverting to the backup. I rarely had the tape snap on one though, but the design seemed very brittle - as was the design of the ZX Printer (probably one of the few consumer devices to actually enhance the ozone layer, with its stylus burning away the metal surface coating on the associated printing paper).

I cut my programming teeth at school at which they had a globally little-known Swedish computer called the ABC80. It was originally intended to be a clone of the American TRS80 but ended up as a completely different machine just sharing the form factor (keyboard/computer unit, and dedicated matching monitor). ROM BASIC, but it got really fun when I got into Z80 assembly language.

Eventually I got a used ZX80 at home, eventually upgraded to a ZX Spectrum which saw a lot of use. Eventually I replaced the keyboard with a 'real' one bought surplus which I wired up to behave like the Spectrum keyboard matrix. It looked really klunky all in all with this full-sized keyboard stuck on top of the space originally occupied by the original 'dead mans hand' rubber one, but it significantly increased typing speed.

I did all sort of hacks via the expansion port, with a MIDI interface, SP0256 speech synthesizer chip, 8-bit A/D and D/A converters (Ferranti ZN449 and 425 or something like that), 8 bit parallel interface primarily to interface with an analog drum synthesizer I'd built, an EPROM programmer, and finally a 64 kbyte memory which could be swapped in banks for the built in ROM. I eventually ported the aforementioned ABC80 ROM to the Spectrum for instance.

Initially I'd hand assemble the Z80 assembly language to the point where I got to know by heart (and, staggeringly, still do - I wonder how much space in my brain has been sacrificed by the apparent permanent burn-in of the opcode list) a significant part of the Z80 opcodes in decimal. After a while I wrote a line assembler which assembled one instruction at a time into memory, and the program also doubled as a machine-language monitor so I actually used it for debugging too. Eventually I wrote a fully fledged assembler which would take a number of source files and assemble them to one binary.

Weirdly, after the Spectrum I got a second-hand ABC80 at home, because it was a machine I knew well and used real 5.25" disk drives as opposed to the Spectrum's Microdrives. The graphics on the ABC80 were on par with the blocky ZX80/81 graphics, but by that time I was more interested in embedded systems so didn't care much for graphics. I constructed a polyphonic music synthesizer again using the Z80, and did the software development on first the Spectrum and then the ABC80.

Eventually the limitations of 8-bit systems started to become a real pain, especially when the Internet started to become a part of our everyday lives, and sometime around 1996 or so I succumbed to the PC world, buying a second-hand 486 PC. But I've never really got into assembly language programming on any other architecture; with the PC, of course, high level languages like C do a better job than hand coding assembly language for 99.9% of the tasks at hand, and also, the opcode sets of 16- and 32-bit CPUs are much more complicated, so it's not really feasible to know them by rote.

As a side note, one of the more esoteric uses of Z80 assembly language was when a friend of mine and me at university needed to translate some hexadecimal into decimal during a lab session. He knew the Z80 opcodes in hex, and I knew them in decimal, so we'd start out with '0C3h', he'd say 'JP' and I'd say '195'.

Last edited by ricard; 7th Jun 2019 at 5:26 am.
ricard is offline