Obfuscated C 8080 Emulator Ported

[Oscar] is no stranger to writing hard-to-read C code. While most of us do that by accident, there are those who strive to write the most unreadable code and enter it in the IOCCC — the International Obfuscated C Code Contest. One of his winning entries was a single C function that emulates an 8080. With a few support files, the plucky little emulator will run CP/M.

The emulator won best in show, but that was in 2006. Things have changed a bit and [Oscar] has updated the code so that you can continue to try it if you want to give yourself a headache reading code. The portability isn’t a CPU issue — modern CPUs will happily run code from 2006. The problem is the compiler and operating system. Compilers are much stricter these days, and Linux needs a little extra coaxing to give access to the input stream the way the faux computer needs it.

Continue reading “Obfuscated C 8080 Emulator Ported”

Linux Fu: Forward To The Past!

Ok, so the title isn’t as catchy as “Back to the Future,” but my guess is a lot of people who are advanced Linux users have — at least — a slight interest in retrocomputing. You’d like an Altair, but not for $10,000. You can build replicas of varying fidelities, of course. You can also just emulate the machine or a similar CP/M machine in software. There are many 8080 or Z80 emulators out there, ranging from SIMH to MAME. Most of these will run on Linux or — at the least — WINE. However, depending on your goals, you should consider RunCPM. Why? It runs on many platforms, including, of course, Linux and other desktop systems. But it also will work with the Arduino, Teensy, ESP32, or STM32 processors. There is also experimental support for SAM4S and Cyclone II FPGAs.

It’s pretty interesting to have one system that will work across PCs and embedded hardware. What’s more is that, at least on Linux, the file system is directly translated (sort of), so you don’t have to use tricks or special software to transfer files to and from CP/M. It is almost like giving Linux the ability to run CP/M software. You still have to have virtual disks, but they are nothing more than directories with normal files in them.


Of course, if your goal is to simulate a system and you want to have 180 kB floppies or whatever, then the direct file system isn’t a benefit. But if you want to use CP/M software for education, nostalgia, or cross-development, this is the way to go, in my opinion.

It isn’t just the file system, either. If you need a quick utility inside your bogus CP/M environment, you can write it in Lua, at least on desktop systems. On the Arduino, you can access digital and analog I/O. Theoretically, you could deploy an embedded Altair for some real purpose fairly cheaply. Continue reading “Linux Fu: Forward To The Past!”

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!

Bill, Steve, And Gary… Computer Pioneers

If you ask your neighbor who Bill Gates or Steve Jobs is, they’d probably know. But mention Gary Kildall, and you are likely to get a blank stare unless you live next door to another Hackaday reader. [Al’s Geek Lab] has a great three-part documentary on Gary Kildall who, in case you didn’t know, was the man behind CP/M, a very influential operating system in the early days of computing and one that set the stage for the PC revolution.

You probably know the folktale that when IBM was looking for an operating system, Bill Gates took the meeting, and Gary Kildall went surfing instead. But like most capsule histories, there is plenty more to the story, and it isn’t as simple as people make it out.

We forget, sometimes, how innovative Digital Research — Kildall’s company — was for the time. We think of CP/M as the venerable CP/M 2.2, which was fine. But there was multitasking CP/M and GEM — a precursor to the graphical user interface found everywhere today. Sure, it looks antiquated now, but it was light years in front of everyone else.

If you watch the whole series, you’ll learn that the IBM story isn’t totally apocryphal, but the truth is much different. Kildall didn’t want the IBM deal, and for what seemed like good reasons at the time. Of course, Gates negotiated a deal with IBM that would build a huge company, so it is easy to look back and say that not taking the deal was a mistake, but we would have probably made the same decision as Kildall at that time.

This isn’t the first time we’ve wondered what a world where CP/M won would have looked like. If you want to look inside CP/M, you can. Of course, it still powers many retrocomputers and even has some surprising clones.

Continue reading “Bill, Steve, And Gary… Computer Pioneers”

An Odd Home Computer From The 1980s

If you were around when the Altair 8800 was king, you might remember the name Cromemco. They were an early vendor of add-ons for the Altair, along with companies like Godbout and Morrow. The company was mostly famous for a very crude digital camera for the Altair and a similarly-crude graphics interface card. They graduated into building S-100 bus computers. Like many similar companies, they could taste the upcoming home PC market, and they wanted a piece of it. Their answer? The $1,800 C-10 Cromemco Personal Computer, and you can see [Vintage Geek’s] thoughts on the odd machine in the video below.

The system ran CP/M and, like many similar systems, got lost in the rush to get the IBM PC. Compared to other computers of the time, the C-10 was compact. The keyboard layout seems odd today, but there wasn’t really much standardization in those days.

Continue reading “An Odd Home Computer From The 1980s”

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”