Z80 I/O Madness

While the 8080 started the personal computer revolution, the Z80 was quickly a winner because it was easier to use and had more capabilities. [Noel] found out though that the Z80 OUT instruction is a little odd and, in fact, some of the period documentation was incorrect.

Many CPUs used memory-mapped I/O, but the 8080 and Z80 had dedicated I/O addressing pins and instructions so you could fill up the memory map with actual memory and still have some I/O devices. A quick look in the famous Zak’s book on Z80 programming indicates that an instruction like OUT (C),A would write the A register to the output device indicated by the BC register pair (even though the instruction only mentions C. However, [Noel] missed the note about the B register and saw in the Zilog documentation that it did. Since he didn’t read the note in the Zak’s book until later, he assumed it was a discrepancy. Therefore, he went to the silicon to get the correct answer.

Breadboarding a little Z80 system allowed him to look at the actual behavior of the instruction. However, he also didn’t appreciate the syntax of the assembly language statements. We’ve done enough Z80 assembly that none of it struck us as particularly crazy, especially since odd instruction mnemonics were the norm in those days.

Still, it was interesting to see him work through all the instructions. He then looks at how Amstrad used or abused the instructions to do something even stranger.

If you want to breadboard a minimal Z80 system, consider this one. If you enjoy abuse of the Z80 I/O system, you don’t want to miss this Z80 hack for “protected mode.”

Continue reading “Z80 I/O Madness”

Porting CP/M To A Z80 Thing

It is hard to describe the Brother SuperPowerNote. It looks like a big old Z80-based laptop, but it says it is a notebook. The label on it says (with lots of exclamation marks) that it is a word processor, a communications system, a personal scheduler, and a spreadsheet organizer. Brother also promises on the label that it will “Increase your power to perform on the job, on the road or at home!” Plenty of exclamation marks to go around. The label also touts DOS or Windows, but [Poking Technology] didn’t want that. He wanted CP/M. See how he did it in the video below.

This is a very early laptop-style word processor with a floppy and a strange-looking screen. It also had serial and parallel ports, odd for a word processor, and probably justified the “communication system” claim on the label.

Continue reading “Porting CP/M To A Z80 Thing”

Cowgol Development Environment Comes To Z80 And CP/M

Cowgol on Z80 running CP/M ties together everything needed to provide a Cowgol development environment (including C and assembler) on a Z80 running the CP/M operating system, making it easier to get up and running with a language aimed to be small, bootstrapped, and modern.

Cowgol is an experimental modern language for (very) small systems.

The Zilog Z80 was an 8-bit microprocessor common in embedded systems of the 1970s and 1980s, and CP/M was a contemporary mass-market operating system. As for Cowgol? It’s an Ada-inspired compiler toolchain and programming language aimed at very small systems, such as the Z80.

What’s different about Cowgol is that it is intended to be self-hosted on these small systems; Cowgol is written in itself, and is able to compile itself. Once one has compiled the compiler for a particular target architecture (for example, the Z80) one could then use that compiler on the target system to compile and run programs for itself.

Thankfully, there’s no need to start from scratch. The Cowgol on Z80 running CP/M repository (see the first link of this post) contains the pre-compiled binaries and guidance on using them.

Cowgol is still under development, but it works. It is a modern language well-suited to (very) small systems, and thanks to this project, getting it up and running on a Z80 running CP/M is about as easy as such things can get.

Thanks to [feinfinger] for the tip!

Zilog’s Forgotten Operating System: Z80-RIO

When it comes to famous operating systems for the Z80 and similar Zilog processors, the first and maybe only one to come to mind is CP/M, which was even made its presence known on the dual-CPU (8502 and Z80) Commodore 128. Yet Zilog also developed its own operating system, in the form of the comprehensively titled Z80 Operating System with Relocatable Modules and I/O Management (Z80-RIO for short). With limited documentation having survived, [Ralf-Peter Nerlich] has set out to retain and recover what information he can on RIO and the associated Programming Language Zilog (PLZ) after working with these systems himself when they were new.

A Zilog MCZ 1/20 system from around 1979. (Credit: Herb Johnson)
A Zilog MCZ 1/20 system from around 1979. (Credit: Herb Johnson)

Perhaps unsurprisingly, neither Z80-RIO nor PLZ were targeting the regular consumer market when they were brought to market in the late 1970s, but were part of Zilog’s focus on industrial markets, as well as laboratories and elsewhere that could benefit from a versatile, programmable computer system for control and automation.

As part of an integrated hardware/software solution, Zilog released a series of computer systems, such as the MCZ 1/20 of which a number of examples survive today. Herb Johnson’s collection and restoration projects provide a good overview of not only the base systems, but also the expansion cards available for these systems. Right along with the Z80-RIO OS providing the ability to customize the system for the target usage, the underlying hardware could also be configured with just the expansion boards required, or conceivably even custom boards.

Of course, it doesn’t take many guesses to figure out what happened to Z80’s RIO OS and related, with the 1980s heralding massive shifts in the computer markets. Although now functionally obsolete for decades, it’s good to see such preservation efforts of 1970s computing systems and related software. These are after all the foundations on which modern day computing is built.

(Thanks to [Stephen Walters] for the tip)

How To Chase The Beam With A Z80

The more accomplished 8-bit microcomputers of the late 1970s and early 1980s had a dedicated display chip, a CRT controller. This took care of all the jobs associated with driving a CRT display, generating the required timing and sequencing all the dots to make a raster. With a CRT controller on hand the CPU had plenty of time to do other work, but on some cheaper machines there was no CRT controller and the processor had to do all the work of assembling the display itself.

[Dr. Matt Regan] had a Sinclair ZX81 which relied on this technique, and he’s put up the first of what will become a series of videos offering a deep dive into this method of creating video. The key to its operation lies in very careful use of timing, with operations executed to keep a consistent number of clock cycles per dot on the display. He’s making a very low resolution version of the display in the first video, which he manages to do with only an EPROM and a couple of 74 logic chips alongside the Z80. We’re particularly impressed with the means of creating the sync pulses, using opcodes carefully chosen to do nothing of substance except setting a particular bit.

This method of assembling a display on such a relatively slow microprocessor has the drawback of no means of creating a grayscale, and of course it’s only available in glorious black and white. But it’s the system which gave a first experience of computing to millions, and for that we find the video fascinating. Take a look, below the break.

If this has caused you to yearn for all things Sinclair, read our tribute to the man himself.

Continue reading “How To Chase The Beam With A Z80”

An Easy Z80 And VGA Upgrade For The Apple II

The Apple II was at the forefront of the home computer revolution when it came out in 1977. In its era, nobody really cared about hooking up the Apple II to a VGA monitor, but these days, it’s far easier than sourcing an original monitor. The V2 Analog is a useful tool that will let you do just that, plus some other neat tricks, besides.

As demonstrated on Youtube by [Adrian’s Digital Basement], The V2 Analog is basically a slot-in video card for the Apple II, II+, and IIe. It’s based upon the AppleII-VGA, which uses a Raspberry Pi Pico to snoop the 6502 CPU bus and copy the video memory. It then outputs a high-quality VGA signal that is far nicer than the usual composite output options.

As a bonus, the V2 Analog can be reconfigured to run as an emulated AppliCard Z80 expansion card instead. This card was originally intended to allow Apple II users to run CP/M applications. The V2 Analog does a great job in this role, though it bears noting it can’t handle VGA output and Z80 emulation at the same time.

Project files are available on Github for the curious. The Apple II may be long out of production, but it’s certainly not forgotten. Video after the break.

Continue reading “An Easy Z80 And VGA Upgrade For The Apple II”

Addressable LEDs From A Z80

If you buy WS2812s under the Adafruit NeoPixel brand, you’ll receive the advice that “An 8 MHz processor” is required to drive them. “Challenge Accepted!“, says [ShielaDixon], and proceeded to first drive a set from the 7.3 MHz Z80 in an RC2014 retrocomputer, and then repeat the feat from a 3.5 MHz Sinclair ZX Spectrum.

The demos in the videos below the break are all programmed in BASIC, but she quickly reveals that they call a Z80 assembler library which does all the heavy lifting. There’s no microcontroller behind the scenes, save for some glue logic for address decoding, the Z80 is doing all the work. They’re all implemented on a pair of RC2014 extension cards, a bus that has become something of a standard for this type of retrocomputer project.

So the ubiquitous LEDs can be addressed from some surprisingly low-powered silicon, showing that while it might be long in the tooth the Z80 can still do things alongside the new kids. For those of us who had the Sinclair machines back in the day it’s particularly pleasing to see boundaries still being pushed at, as for example in when a Z80 was (almost) persuaded to have a protected mode.

Continue reading “Addressable LEDs From A Z80”