Microchess for the Commodore 64 and KIM-1
By gracious permission of Peter Jennings, the original author and copyright holder, the original source code and hex dump of the original Microchess for the Commodore KIM-1 are available for download. I've also converted Microchess to the Commodore 64/128, playable on the real system and any emulator, if you don't have a KIM-1 of your own. You must read and accept the license agreement below before you download! Usage and/or possession of the binaries, hex dump and/or source code constitutes your binding acceptance of terms. Thanks to Paul Foerster for providing the original hard copy from which the C64 and .pdf versions were generated.
Microchess was developed in 1976, originally for the KIM-1. Later versions included 1.5, ported to the Commodore PET and Commodore Chessmate; and 2.0, for the Apple II and the Tandy Colour Computer series. The port to the C64 is an "unofficial" version done by yours truly with Peter's blessing. Microchess was notable for its reasonably astute playing ability despite taking up barely 1K of RAM (virtually all the memory in the KIM-1, however). Impressed with his creation, Commodore contracted Jennings to create the Chessmate, a standalone chess game, in 1977.
This program and its associated breakdowns and documentation are provided for your personal use only and appear here exclusively by permission of the copyright holder. Please contact the copyright holder before re-distributing, re-publishing or disseminating this copyrighted work. Microchess is not GPL or in the public domain. Please respect the author's copyright.
To play, simply load it into any emulator or place it on a floppy in your C64/128's disk drive, and then LOAD the program ,8 and RUN. Other than the menu interface, which is fairly self-explanatory, the actual game play is identical to the KIM-1 version below. Use the S key for ST (which will pause the game and drop you into the program's monitor menu), P key for PC, and 0-9 and A-F. There is no GO key during play (there is a GO key in the "monitor") since it is not used during actual game play. During the computer's processing time the screen will blank for speed improvement; when waiting for a key, the border will sparkle.
Downloading this program indicates your acceptance of all license terms. This particular port (not necessarily the other downloads) is freeware as long as the copyright message is intact.
(If you want the original .zipped Acrobat version, here it is, but it's 900K and a large download so please use the text version unless you need the symbol table [it does include it].)
You must clear (i.e. reset) the game when you play it for the first time in a session. The game is not cleared automatically for you when you start the program (either the KIM-1 or 64 version).
The computer will display its move in ax yy zz format, where a is the player (0 if computer, 1 if yours :-), x is the chess piece (memory locations of your pieces and the computer's pieces in parentheses):
0: King (you, 0060; computer, 0050) 1: Queen (you, 0061; computer, 0051) 2: King's Rook (you, 0062; computer, 0052) 3: Queen's Rook : 4: King's Bishop : 5: Queen's Bishop : 6: King's Knight : 7: Queen's Knight : 8: K R Pawn : 9: Q R Pawn : A: K N Pawn : B: Q N Pawn : C: K B Pawn : D: Q B Pawn : E: Q Pawn : F: K Pawn (you, 006F; computer, 005F)and yy and zz are the from and to square respectively. Each ranges from 00 to 77, with 00 being KIM's queen rook, and 77 being your king rook. For example, the move 0F 13 33 means King's Pawn from King's Pawn 2 to King's Pawn 4 (white). The computer may take some time to compute its move and will flash the LEDs as it thinks. Never interrupt it with ST during this process; doing so will destroy the computer's image of the chess board, as much of its scratch pad work lives in the processor stack and will be overwritten by the KIM monitor. Press ST only when it has finished and is displaying its final move. (As a safeguard, the S key is ignored in the C64/128 version while it is computing its move.)
To enter your move, enter FROM and TO locations (piece is not needed). The computer verifies your piece by showing what is on that FROM square; if it is one of your men, it will start with a 1. (An FF shows no piece there.) For example, should you key 63 43 and the screen reads 1F 63 43, that means KIM thinks your King's Pawn is there and that you're advancing it two spaces. When ready, press F to enter the move, and then PC to tell the computer to play. The legality of your moves is never verified, and you may make multiple moves on a single turn -- as long as you press F after each one -- before pressing PC (in fact, as you'll see below, for special moves you will have to). You may move the computer's men at any time as well. The computer also does not warn you if you are in check, and its strategy expects that you will move out of check when you are placed in it.
Castling is accomplished by moving the king, then rook, then pressing PC. If the computer signals a castle by moving its king two spaces over, you will need to also move its rook for it.
While you of course can capture en passant by making the appropriate lateral capture and moving forward, the computer does not know how and will not construct its strategy with it in mind.
Queening pawns must be done manually by altering the game board image from the KIM monitor. Stop the game with ST, remove the queened pawn by entering CC in its location (see table above) and set your Queen at 0061 to this queened pawn. After adjustment, set PC to 0000 and GO to resume the game. As only one Queen can be on the board at once, if you still have a Queen you must select some other captured piece and then move that as if it were a queen. The computer will also not autopromote its queened pawns, so you'll have to do that as well.
The computer will resign if it ends up in checkmate or stalemate; the display will read 'ff ff ff' (and in the 64 version, the background will turn grey). You are, of course, expected to show the same courtesy when you are checkmated, and restart the game.
Starred locations in the hex dump indicate points of adjustment for skill level. By default, 08 at $02F2 and FB at $018B indicates normal mode with an average time per move of ~100s. If you are an impatient or poor player, try 00/FB for ~10 seconds "Blitz", or 00/FF for ~3 seconds "Super-Blitz". Of course, the computer's ability to analyse moves will be progressively impaired.
Openings can be loaded into locations $00C0-$00DB which Microchess will attempt to play from, as long as you do. The 64 version has the five openings from the article available. By default, the game will try to play the Giuoco Piano opening.