BMOW title
Floppy Emu banner


Holy cow, BMOW runs actual software! In this case it’s Microchess, a 1 kilobyte marvel from 1976. Here it is, showing the first few moves of the Giuco Piano opening:

The two-letter code for each piece indicates the color and type. For unknown reasons, “C” means rook (castle?) and “R” means knight. The three hex bytes at the bottom show the piece ID and start and end positions for the most recent move.

The original Microchess was written by Peter Jennings in 1976, and was one of the earliest examples of commercial software. It targeted the KIM-1, a 6502-based hobbyist computer whose only output was a six-character hex LED display. Those three hex bytes in the screenshot were the entire output of that original KIM-1 version. The text-based chess board was added later to support more capable computers with video displays. Amazingly, the entire Microchess program is just 924 bytes. Allowing a few dozen more bytes for runtime memory needs, it still fits in one kilobyte. Good luck writing a functional chess program in 1K on a modern PC!

Porting Microchess to BMOW was fairly painless. It’s written in 6502 assembly, and BMOW’s instruction set is an imperfect 6502 superset, so there wasn’t much work to do there. The I/O routines were already separated from the rest of the code, so I only needed to point them at the existing keyboard and video I/O routines in BMOW’s ROM to finish the job.

There are still some bugs to work out. BMOW Microchess does make legal moves, but they’re not always very sensible. I wasn’t expecting top-quality chess play, but it often seems to not realize that a piece is at risk of capture. I was able to easily capture a bishop and queen, without it making any attempt to defend them. Hopefully after I dig into the Microchess code further, I can determine if it’s a bug related to BMOW’s imperfect emulation of 6502 behavior, or something else. Meanwhile, back to chess!

Read 3 comments and join the conversation 

3 Comments so far

  1. Steve November 8th, 2008 9:12 am

    It might be interesting to extend Microchess to show a graphical board display, instead of the text board. That would look a lot more impressive.

    The next piece of software I’ll probably attack is a BASIC interpreter. Ideally there would be a generic 6502 BASIC, with only keyboard input and text output, that would be simple to port. Enhanced BASIC looks like a decent candidate. I might also try to port a “real” BASIC, such as Commodore BASIC, but I’m guessing that’s tied so tightly to the hardware that it would be more difficult to port.

    The software I’d most like to get working is a Z-machine interpreter for Infocom’s text adventure games. There’s already a portable Z-machine interpreter called Frotz, but it’s written in C. I might be able to find one of the original 6502 interpreters for the Apple II or similar computers, but it would likely be just a binary image and not a source listing, which would make it difficult to port. So no matter what direction I approach it from, getting Zork and its siblings running on BMOW is likely to be a pretty big challenge.

  2. Steve November 11th, 2008 7:11 am

    I finally got Microchess fully working, curing the problem where it didn’t seem to recognize it was about to capture a piece. The program listing at actually has two OCR errors in it! I discovered them after many hours of debugging, only to then find that the version at Peter Jenning’s site already has those errors fixed.

    There were more problems after that, including one significant BMOW hardware bug. My handling of the V (overflow) flag differed from the 6502. Some instructions like CLC (clear carry) were also clearing V, and the CMP (compare) instruction was storing V, neither of which is true of the 6502. It was tricky, but I was eventually able to make BMOW’s handling of the V flag consistent with 6502’s through a combination of microcode changes, GAL changes, and two new wire wraps.

  3. Lee Davison January 10th, 2009 7:07 pm

    EhBASIC is as much a “real” BASIC as the C= BASIC and directly supports both hex and binary numbers as well as quite a few usefull extra commands, operators and functions.

    But then I’m biased. 8^)=

Leave a reply. Comments may not be monitored regularly. For product support questions, visit the Contact page.