[rec.games.chess] The Game of Chess - Summary

mechjgh@tness1.UUCP (8753) (04/22/87)

I thought I would post a summary of the responses
to the questions about the availability of source
code for chess on VAXen. If your response isn't
here, I didn't get it. Thanks to all.

(P.S. I didn't get any source code, but the last
posting about Ken Thompson getting busted for taking
chess to Russia I found interesting).

Greg Hackney
-------

  from  ihnp4!sun!gorodish!guy (Guy Harris)

> Does anyone know why AT&T neglected to port the game of chess to
> VAXs when they released System 5 Unix ?

Why System V?  The first VAX UNIX release from AT&T was UNIX 32/V,
from which 4BSD developed, and System III came out after that.

Most likely, the reason why they didn't port it is that there are
large chunks of PDP-11 assembly-language code in it, and nobody felt
like rewriting it.  (Note that while it does run under VAX 4BSD, it
does so in PDP-11 compatibility mode.)

> Does anyone have the source code to chess ?

Grab a PDP-11 V7, S3, or maybe S5 tape, and start from there.  Make
sure you have a PDP-11 instruction set description handy, and maybe a
VAX one if you decide to rewrite the stuff in VAX assembler....

-------
   from  seismo.CSS.GOV!rick (Rick Adams)

Here is an ls -l of a V7 /usr/src/games/chess:

total 60
   1 -rw-r--r--  1 bin      sys           512 Apr 22  1986 README
   2 -rwxr-xr-x  1 bin      sys          2048 Apr 22  1986 agen.c
   4 -rw-r--r--  1 bin      sys          3584 Apr 22  1986 att.s
   3 -rw-r--r--  1 bin      sys          2560 Apr 22  1986 bgen.s
   2 -rw-r--r--  1 bin      sys          2048 Apr 22  1986 bheur.c
   3 -rw-r--r--  1 bin      sys          2560 Apr 22  1986 bmove.s
   1 -rw-r--r--  1 bin      sys          1024 Apr 22  1986 book.c
   2 -rw-r--r--  1 bin      sys          2048 Apr 22  1986 bplay.c
   2 -rw-r--r--  1 bin      sys          2048 Apr 22  1986 ctrl.s
   1 -rw-r--r--  1 bin      sys          1024 Apr 22  1986 data.c
   2 -rw-r--r--  1 bin      sys          2048 Apr 22  1986 init.c
   3 -rw-r--r--  1 bin      sys          3072 Apr 22  1986 io.c
   3 -rw-r--r--  1 bin      sys          2560 Apr 22  1986 makefile
   2 -rw-r--r--  1 bin      sys          1536 Apr 22  1986 mater.c
   1 -rw-r--r--  1 bin      sys          1024 Apr 22  1986 old.h
   4 -rw-r--r--  1 bin      sys          4096 Apr 22  1986 pio.c
   3 -rw-r--r--  1 bin      sys          3072 Apr 22  1986 play.c
   2 -rw-r--r--  1 bin      sys          1536 Apr 22  1986 qsort.s
   1 -rw-r--r--  1 bin      sys          1024 Apr 22  1986 savres.c
   2 -rw-r--r--  1 bin      sys          1536 Apr 22  1986 setup.c
   2 -rw-r--r--  1 bin      sys          1536 Apr 22  1986 stat.c
   3 -rw-r--r--  1 bin      sys          3072 Apr 22  1986 stdin.c
   3 -rw-r--r--  1 bin      sys          2560 Apr 22  1986 wgen.s
   3 -rw-r--r--  1 bin      sys          2560 Apr 22  1986 wheur.c
   3 -rw-r--r--  1 bin      sys          2560 Apr 22  1986 wmove.s
   2 -rw-r--r--  1 bin      sys          2048 Apr 22  1986 wplay.c

-------
   from  jle <crdec.arpa!jmleonar>

Greg, I'd be REAL interested if you find/hear about the source to chess...

                                            Joe Leonard
                                        <jmleonar@crdec.arpa>

-------
   from  ihnp4!pegasus!hansen

< Does anyone know why AT&T neglected to port the game of chess to
< VAXs when they released System 5 Unix ?

Because it was written in PDP-11 assembly language.

< Does anyone have the source code to chess ?

Not for that one. However, the GNU project has one available, I believe.

					Tony Hansen
					ihnp4!pegasus!hansen
-------

   from  ihnp4!decwrl!granite!aps (Armando P. Stettner)

Maybe it is because half of the chess program was in assembly
for a PDP-11 and was therefore not very portable. 
	aps.
-------

   from  ihnp4!pruxd!ga (Greg Astfalk)

My understanding is that the chess program in earlier versions
of Unix was in fact written in PDP 11/70 assembler.  I was
lead to believe it was never re-written in C.  I also asked
around about any public domain chess program and concluded,
after expending very little effort, that there is none.  If
you get more info I would appreciate being told about it.

-------

   from  ihnp4!anvil!bob

Chess was written in PDP11 assembly (I've seen the code but no longer have it)
and ran on the VAX in PDP11 machine emulation mode.  I believe it's shipped
with 4.2BSD.  I guess AT&T didn't consider it worth the trouble.  Also, they
may be worried about export problems.  K. Thompson/Bell Labs got hit with
a fine for trying to bring their Chess computer board to Russia for a
tournament!

Bob Toxen

-------

ken@rochester.ARPA (Ken Yap) (04/23/87)

Actually it wasn't the V7 chess program that got into trouble with
export control, it was Ken Thompson's special chess machine (Belle,
think that is the program though) with hardware assist.

Ken's remark was something along the lines: ... the only way you could
make a weapon out of it is if you dropped it out of a plane and hit
somebody...

	Ken (not that Ken)

dave@lsuc.UUCP (04/24/87)

In article <183@tness1.UUCP> mechjgh@tness1.UUCP (8753) writes:
>  from  ihnp4!sun!gorodish!guy (Guy Harris)
>
>Most likely, the reason why they didn't port it is that there are
>large chunks of PDP-11 assembly-language code in it, and nobody felt
>like rewriting it. 
>
>> Does anyone have the source code to chess ?
>
>Grab a PDP-11 V7, S3, or maybe S5 tape, and start from there.  Make
>sure you have a PDP-11 instruction set description handy, and maybe a
>VAX one if you decide to rewrite the stuff in VAX assembler....

Fascinating. We're running Edition VII Workbench (basically v7
with a few bits of BSD thrown in) on a Perkin-Elmer 3220, with source.
The source to chess is here -- I just tried compiling it, and it
compiles fine.  A bunch of the routines are indeed written in assembler.

The P-E 3220 is equivalent to the old Interdata 7/32 and 8/32,
the first 32-bit machine (and I believe the first non-PDP-11)
to which UNIX was ever ported.  It doesn't have a PDP-11
compatibility mode, or anything like that, as far as I know.
I presume the assembler must be very similar to PDP-11 assembler,
since someone must have translated it.

There's no indication as to where the P-E chess sources come from.
The README file contains one sentence ("This program not the one that
won the U.S. championship.").  The P-E UNIX port, as far as I know,
was originally done at the University of Woollongong, Australia,
and cleaned up and turned into Edition VII Workbench by TWG ("The
Woollongong Group"), a (US?) company formed by ex-Woollongong people.

I'd be interested in further light anyone can shed on this;
I'm curious as to what was involved in rewriting or translating the
assembler.

David Sherman
The Law Society of Upper Canada
Toronto
-- 
{ seismo!mnetor  cbosgd!utgpu  watmath  decvax!utcsri  ihnp4!utzoo } !lsuc!dave

ed@mtxinu.UUCP (Ed Gould) (04/25/87)

>Actually it wasn't the V7 chess program that got into trouble with
>export control, it was Ken Thompson's special chess machine (Belle,
>think that is the program though) with hardware assist.

Actually, although I no longer remember all of the details, it wasn't
Ken's custom hardware at all that was the problem.  Things like the
HP terminal that went with it were on the list, though.

-- 
Ed Gould                    mt Xinu, 2560 Ninth St., Berkeley, CA  94710  USA
{ucbvax,decvax}!mtxinu!ed   +1 415 644 0146

"A man of quality is not threatened by a woman of equality."

davy@pur-ee (Dave Curry) (04/28/87)

The PDP-11 chess has been ported to Sun workstations... looking at the
source is amusing.  Some poor slob actually sat down and translated the
assembly language (the PDP-11 assembly language is in comments alongside
the 68000 code).  Yuck.  What a fun way to spend a weekend.

Chess is also the reason for the existence of the infamous "v6run" and
"v7run" programs from older Berkeley UNIXes...  somewhere in there is a
statement to the effect of "this is not guaranteed to run anything, it
was written so we could run chess".  (You should have seen how much
garbage we used to run under "v7run" here -- a basic interpreter,
restor, zork...).

I managed to make the V6 source assemble and run under V7 (mostly you
have to change seeks to lseeks and so on), but being a miserable chess
player, I didn't feel like spending the time to port it to a Vax.

--Dave Curry

stern@bnl.UUCP (Eric G. Stern) (04/28/87)

> In article <183@tness1.UUCP> mechjgh@tness1.UUCP (8753) writes:
> >  from  ihnp4!sun!gorodish!guy (Guy Harris)
> >
> >Most likely, the reason why they didn't port it is that there are
> >large chunks of PDP-11 assembly-language code in it, and nobody felt
> >like rewriting it. 
> >
> >> Does anyone have the source code to chess ?
> >
> >Grab a PDP-11 V7, S3, or maybe S5 tape, and start from there.  Make
> >sure you have a PDP-11 instruction set description handy, and maybe a
> >VAX one if you decide to rewrite the stuff in VAX assembler....
> 
> Fascinating. We're running Edition VII Workbench (basically v7
> with a few bits of BSD thrown in) on a Perkin-Elmer 3220, with source.
> The source to chess is here -- I just tried compiling it, and it
> compiles fine.  A bunch of the routines are indeed written in assembler.
> 
> 
> There's no indication as to where the P-E chess sources come from.
> ...
> I'd be interested in further light anyone can shed on this;
> I'm curious as to what was involved in rewriting or translating the
> assembler.
> 
> David Sherman
> The Law Society of Upper Canada
> Toronto
> -- 
> { seismo!mnetor  cbosgd!utgpu  watmath  decvax!utcsri  ihnp4!utzoo } !lsuc!dave

A few years back, I had a go at rewriting the PDP-11 assembler parts of
chess in C.  The result was that it mostly worked, but there was some
subtle problem in move ranking.  Also under BSD 4.2 (but not on VAX/VMS or
PDP-11 V7) there is a problem with the display.  If anyone is interested
in taking this over, let me know.

				Eric G. Stern
				Dept of Physics, SUNY
				stern@bnl.arpa
				stern@bnl.bitnet
				...!philabs!sbcs!bnl!stern

jmc@warwick.UUCP (04/29/87)

If anyone is interested I produced m68k assembler versions of the assembler
parts of the chess source and had it working ok.

Mail me and I'll send you those bits

John Collins
..... !ukc!acorn!xisl!jmc

john@polyof.UUCP (05/08/87)

In article <183@tness1.UUCP>, mechjgh@tness1.UUCP (8753) writes:
> > Does anyone know why AT&T neglected to port the game of chess to
> > VAXs when they released System 5 Unix ?
> Most likely, the reason why they didn't port it is that there are
> large chunks of PDP-11 assembly-language code in it, and nobody felt
> like rewriting it.  (Note that while it does run under VAX 4BSD, it
> does so in PDP-11 compatibility mode.)

I did in fact re-write the assembly code in C and I do have it running
on our Gould PN6000, and our Vax 780, and Apollo's.  It works just fine,
and makes the same mistakes as the V7 one did in assembler. (IE it
doesnt recognize a "check" by a pawn all the time.

Anyway, awhile ago I posted a thing saying that if anyone wanted chess
(as with empire), send me a copy of their unix version 6/7 source license,
along with a SAST, and Ill send you a copy.  No binary licenses accepted,
no system 3-5, or BSD licenses.  Only version 6/7.
(IE if you already have source for the chess, I can give you what you 
already have + the new code.... I can't just post it, cause the algorithms
are exactly the same as those in the *.s files.)

PS if I compile the  C code (which essentially is alot of multi-line
#defines in place of the assembler subroutine calls), chess runs about
10-20% slower; not a bad price to pay for portability.
You can always cc -S and doctor your machines assembler code yourself.

John Buck
Polytechnic Univ.
Route 110
Farmingdale, NY
11735

(516-454-5191)
decvax!rti!polyof!john
philabs!polycatt!polyof!john
trixie!polyof!john