How Small Can You Make A C Executable?

It’s well known that the difference in executable size between a compiled binary and one hand-written in optimized assembler will be significant. The compiler brings in all manner of boilerplate whether it needs all of it or not, which is responsible for the extra space. [Weineng] has fallen down the rabbit hole of trying to make the smallest possible gcc-compiled C executable, and the resulting write-up is a fascinating read.

Surprisingly the smallest C program isn’t “Hello World”, but one which simply does nothing but return 0. This results in a binary weighing in at a surprisingly large 15,816 bytes — something which surely could be improved. There follows a set of clever compiler flags and bits of code manipulation to remove some debugging information, and strip out unnecessary stuff executed before void main().

At 13,632 bytes it’s still a little on the chunky side, so it’s time to examine what libraries it brings in. More compiler flags get it down to 8,704 bytes. Removing a code comment section and error handling with more flags takes it to 4,320 bytes. Then there’s code which dictates how memory is allocated, which brings it down to 400 bytes. That’s an impressive reduction!

Reading this as hardware people we maybe don’t have the elite knowledge of compiler flags it takes to manage something like this. But we’ve all at times had to reduce the size of a bit of software, so we’re sure some of the techniques used are going to be interesting to quite a few readers.

After all, even hardware people need to trim the fat at times.

A New Life For A Rare Console

One of the delights of our tips line is that from time to time it brings us retrocomputing hardware that, despite years of reporting, we were not aware existed. [Hitmanmcc] has just such a machine, an NEC PC Engine LT. It’s a PC engine in a laptop form factor, and like many of this super-rare console, it has succumbed to capacitor failure. We’re treated to the process of bringing it back to life.

Replacing capacitors was only part of the story for this repair, as the electrolyte had caused damage elsewhere on the board. In particular there is a small transformer that forms part of an inverter to generate an LCD bias voltage, and this had been destroyed. Fortunately the art of switching power conversion has advanced in the decades since the console was produced, and a small module was procured to do the same job.

The result of all this surgery is another rare console rescued from e-waste, and an opportunity for the rest of us to take a look too. The PC engine is a relative rarity here, but we’ve had a few hacks over the years. This converter for its American cousin is one.

An Unlikely Host For An 8080 Emulator

To emulate vintage microprocessor hardware, it’s normal to find a modern host that provides alongside the number-crunching grunt, sufficient physical connections to interface with its support hardware. Thus if you were shopping around it might be reasonable to pick something with a powerful core and plenty of pins. Yet to emulate an 8080, [Ted Fried] has eschewed both of these — opting for an ATtiny85, a microcontroller deficient in both pins and processing power.

This seemingly impossible feat is achieved by reducing the physical connection to an SPI bus and offloading the support functions to a Teensy. The emulation code is significantly optimized C, and includes a 128 byte cache to speed up matters. This delivers a speed claimed to be only very slightly slower than a real 8080 when booting CP/M, which is quite a feat.

We’re sure that CP/M enthusiasts will have fun with this project, and we especially like the full write-up. Going to the effort of making fake 1975 electronics magazine covers for the project really is going the extra mile, and we appreciate that. Meanwhile if you’d like one of your own, the whole thing can be found in a GitHub project.

If you’re not familiar with the 8080, maybe we can get you started.

An Ethernet WiFi Router On A Pi Pico 2W

We are all in search of the fastest in a wireless router, to give ourselves the best connectivity to the world. But what about the slowest? Gigabit Ethernet may not be for everyone, as Matt Deeds demonstrates with bit-banged 10baseT Ethernet on a Raspberry Pi Pico 2W.

The project is written in Rust, and is in part a port of an earlier project. It makes use of Ethernet magnetics, but the rest of the works is all done in software. He says it’s full-speed on transmit and reduced speed on receive, but we’re guessing if you’re using 10baseT in 2026 then speed isn’t your number one concern anyway. It provides a WiFi router as well as a wired connection, making it possibly the cheapest Ethernet to wireless solution possible.

We like projects that extract the last ounce of power from a part to make it do something its designers never intended. In this case we’ve seen a few other bit-banged Ethernet projects before, even another on the Pi Pico.

An RGB Keyboard For Your Hackaday Communicator Badge

The most recent Hackaday event badge has been the Communicator, a handheld wireless terminal with a rather nice QWERTY keyboard. It’s good enough as delivered, but [makeTVee] has gone one better and made his Communicator keyboard into a fully RGB light-up experience.

The feat is achieved with the help of a new front panel holding some very thin side-emitting addressable LEDs. The keys are custom-printed, and there’s a TPU mat to hold them all together. The LEDs are driven from one of the device’s GPIOs.

We saw this badge in real life at the recent Hackaday Europe conference in Lecco, Italy. It really is as good as it looks in the video below, the care and attention which has gone into the build is extremely impressive.The original badge used a silicone cast set of keys, and we’d say if you are making a device with a keyboard then these might make a very good option.

If you’re not familiar with the Communicator, it’s worth having a look at the launch announcement.

Continue reading “An RGB Keyboard For Your Hackaday Communicator Badge”

The World’s First GPIB Speech Synthesizer, And It’s For A GRiD Compass

The GRiD Compass is a legendary portable computer — a taste of an early-80s future with bubble memory, tough enough for NASA to take them into space, and one of the machines which defined the beginnings of the form factor we know today as a laptop. They’re not easy to come by, but [Scott M. Baker] got his hands on one. As well as nursing it back to health, he’s made an unusual peripheral, a GPIB speech synthesizer.

The GRiD arrived in one piece despite sketchy packaging, and after a little confusion over its line voltage it ran as well as the day it was made. It was designed to use GPIB as its interface for large peripherals such as printers or disk drives, so it was that interface picked for the speech synthesizer. It emulates a GPIB printer, and bytes are sent to the synthesizer chip by printing to LPT1, making driving it an easy process.

The synth itself is a clever design that allows the use of all the various speech chips of the day. It achieves this using a GPIB carrier board holding the interfacing, and a set of plug-in modules, one for each different chip. It’s certainly an unusual peripheral.

You can see more details in the video below the break, meanwhile if you can’t get the real thing there’s a cyberdeck tribute you can make.

Continue reading “The World’s First GPIB Speech Synthesizer, And It’s For A GRiD Compass”

Web-Based Control For A CB Radio

There was a time when a CB radio was a simple affair: a small box with a channel selector, volume, and squelch controls. No longer it seems, because they can now be multi-mode devices that equal the capabilities of amateur radio rigs if not surpass them. [ThatCrazyDcGuy] has one, an Albrecht AE-5900, which has the interesting feature that it can be entirely controlled from its microphone. This led to a web-based interface for the rig, through clever emulation of the microphone.

The communication between rig and microphone is a serial line, for which an FT232 USB-to-serial interface is pressed into service. A USB sound card handles the audio along with some little transformers for isolation, and a USB hub joins everything together. The whole is mounted on perfboard in a small enclosure, and plugged into a Raspberry Pi which acts as a server. This is running a Python script that expose a web front end to control the rig. We like the way this has been done, with minimal intrusion into the radio itself.

Far less so than this CB to 6 meter conversion we featured a while back.