Vintage Chess Programming

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

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

Vintage Chess Programming

Post 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
smatovic
Posts: 2657
Joined: Wed Mar 10, 2010 10:18 pm
Location: Hamburg, Germany
Full name: Srdja Matovic

Re: Vintage Chess Programming

Post 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
User avatar
hgm
Posts: 27807
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: Vintage Chess Programming

Post 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.
smatovic
Posts: 2657
Joined: Wed Mar 10, 2010 10:18 pm
Location: Hamburg, Germany
Full name: Srdja Matovic

Re: Vintage Chess Programming

Post 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
User avatar
hgm
Posts: 27807
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: Vintage Chess Programming

Post 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
User avatar
jshriver
Posts: 1342
Joined: Wed Mar 08, 2006 9:41 pm
Location: Morgantown, WV, USA

Re: Vintage Chess Programming

Post by jshriver »

Everything about this post is awesome :) Amazing work HGM.
User avatar
michiguel
Posts: 6401
Joined: Thu Mar 09, 2006 8:30 pm
Location: Chicago, Illinois, USA

Re: Vintage Chess Programming

Post 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
Mincho Georgiev
Posts: 454
Joined: Sat Apr 04, 2009 6:44 pm
Location: Bulgaria

Re: Vintage Chess Programming

Post 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.
User avatar
sje
Posts: 4675
Joined: Mon Mar 13, 2006 7:43 pm

Re: Vintage Chess Programming

Post 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.
smatovic
Posts: 2657
Joined: Wed Mar 10, 2010 10:18 pm
Location: Hamburg, Germany
Full name: Srdja Matovic

Re: Vintage Chess Programming

Post by smatovic »

very impressive work.

--
Srdja