chess engine in assembly

Discussion of chess software programming and technical issues.

Moderator: Ras

Carey
Posts: 313
Joined: Wed Mar 08, 2006 8:18 pm

Re: chess engine in assembly

Post by Carey »

Zach Wegner wrote:I should add one more that has a bunch of assembly in it, maybe for VAX.

It's the standard Unix chess game, written by Ken Thompson in 1979.

http://minnie.tuhs.org/UnixTree/V7/usr/src/games/chess/

I've wanted to do a port of it to pure C, but I just can't read the assembler...
It's various versions of Thompson's T.Belle program. (For the record, he told me that the 'T' doesn't stand for anything. Not 'Tinker' or "Telephone' or "Thompson's". The USCF required a first name, so he chose 'T'.

I have a few versions of TBelle on my site, if you are interested.

Including some that are pure C. Well, actually pure Pre-C. He wrote it in a dialect before K&R C became 'standardized' and public. (Ahhh, the joys of working at Bell, with K & R themselves....)


http://classicchess.googlepages.com/Chess.htm
User avatar
George Tsavdaris
Posts: 1627
Joined: Thu Mar 09, 2006 12:35 pm

Re: chess engine in assembly

Post by George Tsavdaris »

Carey wrote: There have been lots of chess programs written in assembler.

Until compilers became efficient, assembler was very common.

Some famous programs that were written in Assembler (or a low level language similar to assembler):

Sargon
Chess 4.x (2.x & 3.x were Fortran & Assembler)
Ostrich (early parallel program, using up to 8 processors)
Tech
MyChess
MacHack 6

There are certainly many others. That's just a few famous ones off the top of my head.
I'm surprised you and nobody else mentioned the mighty Fritz! Or does my memory deceives me? :?
After his son's birth they've asked him:
"Is it a boy or girl?"
YES! He replied.....
Carey
Posts: 313
Joined: Wed Mar 08, 2006 8:18 pm

Re: chess engine in assembly

Post by Carey »

George Tsavdaris wrote: I'm surprised you and nobody else mentioned the mighty Fritz! Or does my memory deceives me? :?
I personally have no idea. I'm more familiar with the programs of old, rather than the more recent stuff.

It's certainly not unreasonable for semi-modern programs to have chunks of assembler in key areas like the evaluator or MakeMove or such.

But since at least the late 80's, compilers have been good enough that you can write most of a program in C (or whatever) and only have key chunks written in assembler.

With the compilers available for the last 10 years, there just isn't much reason to write a program in assembler unless you just want to.

Up through the Pentium or so, decent programmers could match what a compiler could do, and sometimes beat it.

But after that, with the complexity of current CPUs, the compiler can outperform all but the best assembler programmers, so there isn't as much incentive to work with assembler.

It's possible that some major chess program in the past 10 years is mostly in assembler, but if so, they are wasting their time. They'd get better results by improving the evaluator than spending months writing assembler code to get an extra 5% speed.

Unless, of course, they are just doing assembler for fun... Some people still like it.
Dann Corbit
Posts: 12777
Joined: Wed Mar 08, 2006 8:57 pm
Location: Redmond, WA USA

Re: chess engine in assembly

Post by Dann Corbit »

George Tsavdaris wrote:
Carey wrote: There have been lots of chess programs written in assembler.

Until compilers became efficient, assembler was very common.

Some famous programs that were written in Assembler (or a low level language similar to assembler):

Sargon
Chess 4.x (2.x & 3.x were Fortran & Assembler)
Ostrich (early parallel program, using up to 8 processors)
Tech
MyChess
MacHack 6

There are certainly many others. That's just a few famous ones off the top of my head.
I'm surprised you and nobody else mentioned the mighty Fritz! Or does my memory deceives me? :?
Fritz may be largely assembly, but there is C or C++ code in versions as old as 5.32 (MSVCRT.DLL is referenced in the binary) and the more recent versions have the Eugene Nalimov tablebase code in them, so at least a large portion of the program is not in assembly.

However, it is quite likely that Fritz is largely written in assembly.