It’s Snake, In A QR Code, But Smaller

We’re not sure that many of you have recognised the need in your life for an x86 machine code program encoded into a QR code, but following on from someone else work [donno2048] has created a super-tiny Snake clone in assembly which comes in at only 85 bytes long. It fits far better in a QR code than the previous effort, but perhaps more useful is a web page demo which runs an in-browser DOS compatibility library. We followed the compilation instructions and got it running on our Manjaro installation, with the result of a somewhat unplayable but recognisable Snake, we’re guessing because it was written for a slower platform. The web version is more usable, and allows us to investigate its operation more thoroughly.

To achieve a working game in so little code is an impressive feat, and since we found different keys responded on machines with different keyboards we’re curious how it does its keyboard input. Also we think it has the Snake bug where turning back on yourself means instant game over. We would be interested to hear the views in the comments of readers who know something about x86 assembly, to help explain these points.

Videos Teach Bare Metal RP2040

When we write about retrocomputers, we realize that back in the day, people knew all the details of their computer. You had to, really, if you wanted to get anything done. These days, we more often pick peripherals and just assume our C or other high level code will fit and run on the CPU.

But sometimes you need to get down to the bare metal and if your desire is to use bare metal on the RP2040, [Will Thomas] has a YouTube channel to help you. The first video explains why you might want to do this followed by some simple examples. Then you’ll find over a dozen other videos that give you details.

Any video that starts, “Alright, Monday night. I have no friends. It is officially bare metal hours,” deserves your viewing. Of course, you have to start with the traditional blinking LED. But subsequent videos talk about the second core, GPIO, clocks, SRAM, spinlocks, the UART, and plenty more.

As you might expect, the code is all in assembly. But even if you want to program using C without the SDK, the examples will be invaluable. We like assembly — it is like working an intricate puzzle and getting anything to work is satisfying. We get it. But commercially, it rarely makes sense to use assembly anymore. On the other hand, when you need it, you really need it. Besides, we all do things for fun that don’t make sense commercially.

We like assembly, especially on platforms where most people don’t use it. Tackling it on a modern CPU is daunting, but if you want to have a go, we know someone who can help.

Continue reading “Videos Teach Bare Metal RP2040”

Connecting A Keyboard To A Vintage PC-XT, The Hard Way

We’re not sure if there’s any single characteristic that qualifies someone as a hacker. After all, we’re a pretty eclectic bunch, with skills that range all over the map, and what one person feels is trivial, others would look upon as black magic. But there’s one thing we’re sure of: if you find yourself reading the original POST code for the PC-XT motherboard just to get a keyboard working, you’re pretty much our kind of people.

That was the position [Anders Nielsen] found himself in as work progresses on his “PC-XT from Scratch” project, which seeks to build a working mid-80s vintage IBM Model 5160 using as many period-correct parts as possible. The first installment of the series featured the delicate process of bringing the motherboard up, lest the magic smoke was released. After seeing some life out of the old board, [Anders] needed a little IO, specifically video and keyboard. The video side of the equation was relatively trivial, with an early-90s VGA card from eBay — not exactly period correct, but good enough to get something to display. Continue reading “Connecting A Keyboard To A Vintage PC-XT, The Hard Way”

Robot Pet Is A Chip Off The Old Logic Block

When [Ezra Thomas] needed inspiration for his senior design project, he only needed to look as far as his own robot. Built during his high school years from the classic 1979 Frank DaCosta book “How to Build Your Own Working Robot Pet”, [Ezra] had learned the hard way the many limitations and complexities of the wire wrapped 74xx series logic chips surrounding its 8085 processor.

[Ezra] embarked on a quest to recreate the monstrosity in miniature, calling it Pet on a Chip. Using a modern FPGA chip allows the electronics to shrink by an order of magnitude and provides flexibility for future expansion. Implementing an 8 bit CPU on the amply sized FPGA left plenty of room for a VGA GPU, motor controller, serial UART, and more. Programming the CPU is handled by a custom assembler written in Python.

The results? Twelve times less weight, thirteen times less power draw, better performance, and a lot of room for growth. [Ezra] hints at an I2C bus expansion as well as a higher level programming language to make software development less of a hurdle.

The Pet On A Chip is a wonderfully engineered project and we hope that we’ll be seeing more such from [Ezra] as time goes by. Watch his Pet On A Chip in action in the video below the break.

If [Ezra]’s FPGA escapades have you wondering how to get started, you can check out this introduction to FPGA from the 2019 Hackaday Superconference. And if you have your own FPGA creation to share, please let us know via the Tip Line!

Continue reading “Robot Pet Is A Chip Off The Old Logic Block”

Oddball X86 Instructions

David Letterman made the top ten list famous. [Creel] has a top ten that should appeal to many Hackaday readers: the top 10 craziest x86 assembly language instructions. You have to admit that the percentage of assembly language programmers is decreasing every year, so this isn’t going to have mass appeal, but if you are interested in assembly or CPU architecture, this is a fun way to kill 15 minutes.

Some would say that all x86 instructions are crazy, especially if you are accustomed to reduced instruction set computers. The x86, like other non-RISC processors, has everything but the kitchen sink. Some of these instructions might help you get that last 10 nanoseconds shaved off a time-critical loop.

Continue reading “Oddball X86 Instructions”

A 6502 Computer, With Acres Of Breadboard And Dozens Of Chips

Imagine you’re time-warped back to 1979 and tasked with constructing a personal computer. Could you do it? [RadicalBrad] thinks he can, and his 6502-based “Super VIC” build looks like it’s off to a great retrocomputing start.

Most emulations of old hardware these days go the FPGA route, and while we respect those projects immensely, there’s something to be said for applying a highly artificial constraint at the outset of a project. [RadicalBrad] chose to design like it’s 1979, and limited his ode to the machines of his youth to the 6502 CPU and logic and RAM chips available before 1980. The computer will support NTSC video output and 4-channels of 8-bit sound. No circuit boards will be used – everything is to be assembled on solderless breadboards. So far he has 48 (!) of them ganged together, which sounds like an enormous amount of space to work with, but he still found things crowded enough that some of the DIP bodies were trimmed a bit to fit more closely on the breadboards. The SRAM posed a problem, though, in that the 512K chips he wanted were not available in DIPs. To stay faithful to the constraints, he soldered the SOJ-packaged RAM chips into 40-PIN DIP headers – all 25 chips! We can’t recall a PC of the era sporting 12 megabytes of RAM, but no matter – it’s too cool not to love.

[RadicalBrad] has his work cut out for him, and this could take years to finish. We’re keen to follow his progress and can’t wait till it boots for the first time. Until it does, we’ll just gaze upon such discrete computing wonders as this almost-as-simple-as-possible computer, or even this delightfully noisy adder for a relay computer.

35C3: A Deep Dive Into DOS Viruses And Pranks

Oh, the hijinks that the early days of the PC revolution allowed. Back in the days when a 20MB hard drive was a big deal and MS-DOS 3.1 ruled over every plain beige PC-clone cobbled together by enthusiasts like myself, it was great fun to “set up” someone else’s machine to do something unexpected. This generally amounted to finding an unattended PC — the rooms of the residence hall where I lived in my undergrad days were a target-rich environment in this regard — and throwing something annoying in the AUTOEXEC.BAT file. Hilarity ensued when the mark next booted the machine and was greeted with something like an inverted display or a faked hard drive formatting. Control-G was good to me too.

So it was with a sense of great nostalgia that I watched [Ben Cartwright-Cox]’s recent 35C3 talk on the anatomy and physiology of viruses from the DOS days. Fair warning to the seasoned reader that a sense of temporal distortion is inevitable while watching someone who was born almost a decade after the last meaningful release of MS-DOS discuss its inner workings with such ease. After a great overview of the DOS API elements that were key to getting anything done back then, malware or regular programs alike, he dives into his efforts to mine an archive of old DOS viruses, the payloads of most of which were harmless pranks. He built some tools to find viruses that triggered based on the system date, and used an x86 emulator he designed to test every day between 1980 and 2005. He found about 10,000 malware samples and explored their payloads, everything from well-wishes for the New Year to a bizarre foreshadowing of the Navy Seal Copypasta meme.

We found [Ben]’s talk a real treat, and it’s good to see someone from the current generation take such a deep dive into the ways many of us cut our teeth in the computing world.

Continue reading “35C3: A Deep Dive Into DOS Viruses And Pranks”