Page 1 of 3

Vintage Chess Programming

Posted: Sat Oct 08, 2011 5:58 pm
by smatovic
Want to start some retro-programming on an Atari800 XE, my first home computer.

Found an C Compiler for the 6502 familiy, cc65, runs fine with the atari800 emulator on Linux.

I am interested in your opinions about how to implmenet things like Move Generation, Qsearch, Evaluation etc.

The 6502 is an 8 bit machine with a clock rate of about 1,7 MHz and mostly 64 KB RAM onboard.

--
Srdja

Re: Vintage Chess Programming

Posted: Sat Oct 08, 2011 6:21 pm
by smatovic
Transposition Tables are evidently a no go,
therefore are Killer and CounterMove Heuristics propably more important.

I wonder how deep such a machine could search? Is a Quiscence Search possible?

--
Srdja

Re: Vintage Chess Programming

Posted: Sat Oct 08, 2011 9:52 pm
by hgm
I did write a chess program for 6502 in those days (Usurpator II; it still competes in ChessWar through an emulator).

QS is no problem at all. Getting deeper than 3 ply full-width might be, however. Putting in chessic knowledge to know when to extend is therefore very important , or you will miss important tactics.

If I were to write a program for such a machine now, I would base it on ID and a PV through a tri-angular array.

Re: Vintage Chess Programming

Posted: Sat Oct 08, 2011 10:30 pm
by smatovic
I did write a chess program for 6502 in those days (Usurpator II; it still competes in ChessWar through an emulator).
Wow, how do you access xboard through the emulator?
f I were to write a program for such a machine now, I would base it on ID and a PV through a tri-angular array.
Ah, yes. Without a Transposition Table i need such an tri-angular array.
Thanks for the hints.

--
Srdja

Re: Vintage Chess Programming

Posted: Sat Oct 08, 2011 11:15 pm
by hgm
I obtained the C source code of a 6502 emulator on the 6502 forum, and fused it to a stub of a WB protocol driver. I linked it to a big array (well, only 4KB, because that was the size of my computer memory at the time)which contains the 6502 machine code as initialized data. Before running the emulator on that, I replace the subroutine calls to what used to be my monitor ROM for I/O by BRK instructions, which makes the emulator function return; I can then peek the emulated RAM forthe variables I know that particular JSR call wanted to print (e.g. holding the from or to rank and file), and then print it in WB protocol format. I then restart emulation directly behind the intercepted JSR. Similarly, when it breaks in a JSR for input, I let the C program read the WB command that contains the requested input (e.g. the move), and take that apart to feed it piece by piece to the emulated program. It sounds ,more complex than it is. (Also because the 6502 program hardly did any I/O: this machine had only a 20-char LED display for output...)

I was used to cumbersome I/O; at one time I had built the program into a match box, and the only way to enter the move was tapping on a set of staples. The WB version fortunately does not emulate the code for that!

Image

Re: Vintage Chess Programming

Posted: Sun Oct 09, 2011 4:52 am
by jshriver
Everything about this post is awesome :) Amazing work HGM.

Re: Vintage Chess Programming

Posted: Sun Oct 09, 2011 4:54 am
by michiguel
smatovic wrote:Transposition Tables are evidently a no go,
therefore are Killer and CounterMove Heuristics propably more important.

I wonder how deep such a machine could search? Is a Quiscence Search possible?

--
Srdja
I would implement a transposition table, even if it is 4 Kb. You will notice a big difference with that in k+p endgames, for instance.

Miguel

Re: Vintage Chess Programming

Posted: Sun Oct 09, 2011 9:13 am
by Mincho Georgiev
smatovic wrote:
I did write a chess program for 6502 in those days (Usurpator II; it still competes in ChessWar through an emulator).
Wow, how do you access xboard through the emulator?
f I were to write a program for such a machine now, I would base it on ID and a PV through a tri-angular array.
Ah, yes. Without a Transposition Table i need such an tri-angular array.
Thanks for the hints.

--
Srdja
I was a huge Sargon II and III fan in the past on 6502 (also on z80).
I'm not sure whether it's levels was close to nowadays and depth 8 meant level 8, but level 8 at sargon III was reached in about 30 minutes per move. Level 9 (although it was built-in) was never reached on my computer for some reason.

Re: Vintage Chess Programming

Posted: Sun Oct 09, 2011 12:34 pm
by sje
michiguel wrote:I would implement a transposition table, even if it is 4 Kb. You will notice a big difference with that in k+p endgames, for instance.
The authors of the Northwestern Chess 4.x program noted that there was a benefit of having a transposition table with only 256 entries. However, that was with a program which had a speed of only about 400 nodes per second.

Re: Vintage Chess Programming

Posted: Sun Oct 09, 2011 2:08 pm
by smatovic
very impressive work.

--
Srdja