Vintage Chess Programming

Discussion of chess software programming and technical issues.

Moderators: hgm, Harvey Williamson, bob

Forum rules
This textbox is used to restore diagrams posted with the [d] tag before the upgrade.
smatovic
Posts: 814
Joined: Wed Mar 10, 2010 9:18 pm
Location: Hamburg, Germany
Full name: Srdja Matovic
Contact:

Vintage Chess Programming

Post by smatovic » Sat Oct 08, 2011 3:58 pm

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

smatovic
Posts: 814
Joined: Wed Mar 10, 2010 9:18 pm
Location: Hamburg, Germany
Full name: Srdja Matovic
Contact:

Re: Vintage Chess Programming

Post by smatovic » Sat Oct 08, 2011 4:21 pm

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

User avatar
hgm
Posts: 23604
Joined: Fri Mar 10, 2006 9:06 am
Location: Amsterdam
Full name: H G Muller
Contact:

Re: Vintage Chess Programming

Post by hgm » Sat Oct 08, 2011 7:52 pm

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.

smatovic
Posts: 814
Joined: Wed Mar 10, 2010 9:18 pm
Location: Hamburg, Germany
Full name: Srdja Matovic
Contact:

Re: Vintage Chess Programming

Post by smatovic » Sat Oct 08, 2011 8:30 pm

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

User avatar
hgm
Posts: 23604
Joined: Fri Mar 10, 2006 9:06 am
Location: Amsterdam
Full name: H G Muller
Contact:

Re: Vintage Chess Programming

Post by hgm » Sat Oct 08, 2011 9:15 pm

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

User avatar
jshriver
Posts: 1105
Joined: Wed Mar 08, 2006 8:41 pm
Location: Morgantown, WV, USA
Contact:

Re: Vintage Chess Programming

Post by jshriver » Sun Oct 09, 2011 2:52 am

Everything about this post is awesome :) Amazing work HGM.

User avatar
michiguel
Posts: 6387
Joined: Thu Mar 09, 2006 7:30 pm
Location: Chicago, Illinois, USA
Contact:

Re: Vintage Chess Programming

Post by michiguel » Sun Oct 09, 2011 2:54 am

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

Mincho Georgiev
Posts: 454
Joined: Sat Apr 04, 2009 4:44 pm
Location: Bulgaria
Contact:

Re: Vintage Chess Programming

Post by Mincho Georgiev » Sun Oct 09, 2011 7:13 am

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.

User avatar
sje
Posts: 4675
Joined: Mon Mar 13, 2006 6:43 pm

Re: Vintage Chess Programming

Post by sje » Sun Oct 09, 2011 10:34 am

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.

smatovic
Posts: 814
Joined: Wed Mar 10, 2010 9:18 pm
Location: Hamburg, Germany
Full name: Srdja Matovic
Contact:

Re: Vintage Chess Programming

Post by smatovic » Sun Oct 09, 2011 12:08 pm

very impressive work.

--
Srdja

Post Reply