Pootling around the Raspberry Pi forums late last night, I found something that rightfully shouldn’t exist. It’s a two-player chess game for the Pi – nothing so unusual there – written in assembly language, with no OS. Which is highly unusual.

Xu Ji, one of the three Imperial College students who wrote this piece of…bravura showing-off, had this to say in the forums:

My two friends and myself have successfully written a chess game for the Pi. It’s a graphical game with a colourful chess board, so we interface with the GPU and whatnot, and we do it all in assembly without an OS running on it.

We actually wrote the assembler too (in fact this was the actual assignment for the project), but it was based on the ARM7 assembler so it’s probably compatible with official assemblers (although we have not tested this).

It is due to the fact that we ourselves wrote the assembler (in C) and we only had 2 weeks for this that we only support a limited number of instructions in (our version of) assembly language. For example we are forced to use labels for variable names.

The game is written to replace kernel.img inside the OS and is about 15 thousand lines.

We thought some people may find the chess game interesting as a project, and it may inspire others to try writing games in assembly, so we are posting the link to the repo here:

Given our restrictive language we didn’t think we’d make it, but somehow it actually works…

It really does, too. Here are Xu Ji, Bora Mollamustafaoglu and Gun Pinyo, giving a storming demo. We hope you got top marks for this, guys: you totally deserve it.

If you’d like to learn more about assembly language, we highly recommend that you get your Pi out and start working through Baking Pi, a course developed last year by Alex Chadwick at the University of Cambridge, which will take you from knowing nothing at all to being able to build a simple operating system on the Pi. You can read more about Baking Pi here.

Are you serious?!? Do what on the C64 and Amiga? How many people do you know that created a chess game for the C64 or the Amiga? Get lost pal, this project requires A LOT of talent and work. She said “first year project”… If this is their first year project, I wonder what they’ll do next…

Hey! Pal! The Commodore 64 was a faboulous machine, it got kids interested in programming! That is what the Pi was for! and… HEY, I wrote a chess program in BASIC for the commodore 64 and the APPLE II too! (I used MIN-MAX and lots of arrays) ((NOT EASY on 48 K!)