Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Sargon chess game with option to save/load match

401 views
Skip to first unread message

ladislau szilagyi

unread,
Jun 25, 2023, 2:51:55 AM6/25/23
to
Hi all,

you may find here: https://github.com/Laci1953/RC2014-CPM/tree/main/sargon78

a version of the famous SARGON chess game, running on any Z80/Z180/Z280 CP/M system provided with an VT100 compatible terminal, including options to save / load a match to / from disk files (up to 10).

Ladislau


ladislau szilagyi

unread,
Jun 25, 2023, 4:20:16 AM6/25/23
to
Hi,

More useful features can be added, depending on the hardware platform you are using...

For example, I ported SARGON78 on Bill Shen's Z80ALL computer.

Here, I used the DS1302 real time clock to display the match actual time, but also to measure and display the timing of the chess moves:

player sargon
====== ======
01 e2-e4 00:00:05 e7-e5 00:00:01
02 d2-d3 00:00:16 b8-c6 00:00:49
03 g1-f3 00:01:13 g8-f6 00:00:55
04 f1-e2 00:00:08 d7-d5 00:00:49
05 e4-d5 00:00:12 d8-d5 00:01:10
06 b1-c3 00:00:24 f8-b4 00:01:33
07 c1-d2 00:00:34 b4-c3 00:01:38
08 d2-c3 00:00:09 c8-e6 00:01:40

Also, I designed a more friendly graphic interface for the game, using the Z80ALL's versatile VGA interface, which allows defining custom char bitmaps.

You will find here : https://groups.google.com/g/retro-comp/c/l8fC97vnSCA
a picture of the screen showing the chess board...

Ladislau


shadow 338 (shadow338)

unread,
Jun 27, 2023, 3:11:27 PM6/27/23
to

This is pretty cool. Thanks for sharing. Btw, how do you play the game under CP/M using the HEX file ?



dxforth

unread,
Jun 27, 2023, 11:01:48 PM6/27/23
to
On 28/06/2023 5:11 am, shadow 338 (shadow338) wrote:
>
> This is pretty cool. Thanks for sharing. Btw, how do you play the game under CP/M using the HEX file ?

sid sargon78.hex
g


ladislau szilagyi

unread,
Jun 28, 2023, 1:07:45 AM6/28/23
to
Pe marți, 27 iunie 2023, la 22:11:27 UTC+3, shadow 338 (shadow338) a scris:
> This is pretty cool. Thanks for sharing. Btw, how do you play the game under CP/M using the HEX file ?

In CP/M there is a command named LOAD.

Use-it like this:

>LOAD SARGON78.HEX

and the SARGON78.COM will be built...

regards,
Ladislau

Roger Hanscom

unread,
Jun 29, 2023, 10:43:55 AM6/29/23
to
Does it still cheat? Like the original version published in the Hayden book (in 1978) by Dan and Kathe Spracklen? Or has it been fixed?

Roger

ladislau szilagyi

unread,
Jun 29, 2023, 12:19:02 PM6/29/23
to
Pe joi, 29 iunie 2023, la 17:43:55 UTC+3, Roger Hanscom a scris:
> Does it still cheat? Like the original version published in the Hayden book (in 1978) by Dan and Kathe Spracklen? Or has it been fixed?
>
> Roger

Hi Roger,

you should ask Bill Forster!

The original source was taken from his GitHub folder (https://github.com/billforsternz/retro-sargon) by John Squires ( https://github.com/z80playground/sargon-cpm), I just took John's version and updated-it with save/load options.

Ladislau

ladislau szilagyi

unread,
Jun 30, 2023, 7:56:21 AM6/30/23
to
Hi,

I fixed a bug related to saving/loading a game ( the saved info was incomplete...)

The files at https://github.com/Laci1953/RC2014-CPM/tree/main/sargon78 are now refreshed.

Ladislau


ladislau szilagyi

unread,
Jul 1, 2023, 8:28:23 AM7/1/23
to
Hi,

for RC2014's provided with the SC110 board (SIO/2 + CTC), and using my customized CP/M ( https://github.com/Laci1953/RC2014-CPM/tree/main/PutSys ),

I published here: https://github.com/Laci1953/RC2014-CPM/tree/main/sargon78/SC110

a Sargon78 game version which displays also the chess pieces move timings, e.g. :

PLAYER SARGON
====== ======
01 e2-e4 00:00:06 e7-e5 00:00:01
02 d2-d3 00:00:08 b8-c6 00:00:10
03 g1-f3 00:00:09 f8-b4
CHECK 00:00:09
04 c1-d2 00:00:08 g8-f6 00:00:11
05 b1-c3 00:00:12 0-0 00:00:17
06 f1-e2 00:00:08 b4-c3 00:00:20
07 d2-c3 00:00:10 d7-d6 00:00:16
08

I use the SC110's CTC, on interrupts, to implement a simple real-time clock, using only HH:MM:SS, and measure the time needed to make a move.

It will not work for the "official" RC2014's CP/M, because the BIOS of this "official" CP/M uses interrupts to handle console input, and in sargon's code I setup a different interrupt vector table, conflicting with the one already used by CP/M.

My CP/M does NOT use interrupts for console input, therefore setting-up an interrupt table for CTC works without any problem...

Ladislau

ladislau szilagyi

unread,
Jul 1, 2023, 11:12:01 AM7/1/23
to
Hi,

here are some statistics related to the Sargon's performance:

I (with white) played the same moves, on a RC2104 (with SC110) then on a Z80ALL , selecting the level 3.

RC2014(with SC110) Z80ALL

select look ahead (1-6) select look ahead (1-6)
3 3

player sargon player sargon
====== ====== ====== ======
01 d2-d3 00:00:10 d7-d5 00:00:02 01 d2-d3 00:00:12 d7-d5 00:00:00
02 g1-f3 00:00:08 b8-c6 00:02:28 02 g1-f3 00:00:14 b8-c6 00:00:43
03 e2-e3 00:00:10 c8-e6 00:02:30 03 e2-e3 00:01:18 c8-e6 00:00:44
04 b1-c3 00:00:10 g8-f6 00:03:03 04 b1-c3 00:00:20 g8-f6 00:00:53
05 f1-e2 00:00:08 h7-h5 00:03:18 05 f1-e2 00:00:50 h7-h5 00:00:58
06 h2-h3 00:00:10 d8-d6 00:03:26 06 h2-h3 00:00:14 d8-d6 00:01:00
07 e1-g1 00:00:13 0-0-0 00:04:13 07 e1-g1 00:00:52 0-0-0 00:01:14
08 c1-d2 00:00:17 c8-d7 00:04:34 08 c1-d2 00:00:18 c8-d7 00:01:20
09 a2-a3 00:00:21 g7-g6 00:04:07 09 a2-a3 00:00:33 g7-g6 00:01:12
10 b2-b4 00:00:14 d5-d4 00:03:35 10 b2-b4 00:00:15 d5-d4 00:01:03
11 c3-a2 00:00:36 d4-e3 00:04:30 11 c3-a2 00:00:36 d4-e3 00:01:19
12 d2-e3 00:00:18 e6-a2 00:05:30 12 d2-e3 00:00:18 e6-a2 00:01:42
...
(only the first 12 moves are displayed ...)

Do not forget that Z80ALL works with a 25MHz Z80... so the results were not a surprise for me.

Using level 3, a decent chess match can be played...

But I do admit that using a level higher than 3, given the Z80 speed limitations, is not quite practical...

Ladislau

ladislau szilagyi

unread,
Jul 2, 2023, 5:17:11 AM7/2/23
to
Hi,

I made the necessary modifications to enable playing Sargon78 for RC2014's provided with the SC110 board (SIO/2 + CTC) and using the old "official" CP/M.

The version is published here: https://github.com/Laci1953/RC2014-CPM/tree/main/sargon78/SC110

and enables seeing the chess pieces move timings, e.g. :

PLAYER SARGON
====== ======
01 e2-e4 00:00:06 e7-e5 00:00:01
02 d2-d3 00:00:08 b8-c6 00:00:10
03 g1-f3 00:00:09 f8-b4
CHECK 00:00:09
04 c1-d2 00:00:08 g8-f6 00:00:11
05 b1-c3 00:00:12 0-0 00:00:17
06 f1-e2 00:00:08 b4-c3 00:00:20
07 d2-c3 00:00:10 d7-d6 00:00:16
08 ...

Ladislau

ladislau szilagyi

unread,
Jul 2, 2023, 5:51:07 AM7/2/23
to
Hi all,

@Roger Hanscom:

I asked Bill Forster (billfo...@gmail.com) about the issue of "Sargon cheating".

Here is what I received from him:
----------------(quote)--------------
Hello,

I've never heard of this "cheating". What could this even mean? If the program plays better than it is supposed to this is a good thing! Maybe he means that there is a bug such that the position changes in the computer's favour. For example it quietly removes some material from the opponent's position? Who knows.

Anyway, in my experience Sargon plays absolutely legal chess. Not particularly well, but very legally. Some people took my engine and ran it against many other engines and I didn't hear of any illegal moves or anything like that. I played and experimented an awful lot as I slowly delved ever more deeply into the code, without noticing anything bad like this.

If you look beyond the one file you link to on my Github, you will see I documented my project in great detail.

Thanks for your interest in my work.

Kind regards,

Bill.
----------------(quote)--------------

So, Roger, if you still believe that this version of Sargon cheats, please come forward with some proof.

regards,
Ladislau

Roger Hanscom

unread,
Jul 2, 2023, 11:51:07 AM7/2/23
to
On Sunday, July 2, 2023 at 2:51:07 AM UTC-7, ladislau szilagyi wrote:

...<snip>....

> So, Roger, if you still believe that this version of Sargon cheats, please come forward with some proof.

And .... how am I going to do that? My experience with Sargon was in the early 1980's. As I said, the version I was using came from the Sargon book published by Hayden. I no longer have the files I was working with at that time. As I remember it, there was some "chatter" about the problem, so it wasn't just me. There was speculation at that time that what was published in the book contained (purposeful?) errors in it in order to <ahem> encourage interested parties to buy the actual software. The software was considerably more expensive than the book, and I (as a poor student) had trouble just scraping together enough $'s to buy the book. Purchasing the software was entirely out of the question.

> I've never heard of this "cheating". What could this even mean?

It means that when the play got down to a very few pieces on the board, illegal moves were made, and sometimes even pieces just disappeared. 40 years ago is a *LONG* time to come up with "some proof". Who knows, maybe the program has been improved since then, and polished? All I can tell you is that after the anticipation of having a chess program and saving the $'s to buy the book, I was sorely disappointed.

BTW, my question about Sargon wasn't to disparage the program. It was merely to find out if the problems I encountered in the early 1980's had been solved.

Roger

ladislau szilagyi

unread,
Jul 2, 2023, 1:13:31 PM7/2/23
to
Hi Roger,

I took the sargon78 source code from John Squires GitHub page ( https://github.com/z80playground/sargon-cpm ), then I added the save/load game feature (, and piece move timing measurement for RC2014+SC110) (, and piece move timing measurement and graphics interface for Bill Shen's outstanding Z80ALL).

I did not touched the chess algorithms present in the source code.

John Squires mentions " I found the source code to Sargon Chess from https://github.com/billforsternz/retro-sargon/blob/master/stages/sargon-z80.asm "

I quote from Bill Forster's GitHub page (https://github.com/billforsternz/retro-sargon/tree/master), where he explains how it reconstructed the source code:

"Andre Adrian's Z80 port (http://www.andreadrian.de/schach/sargon.asm) - I used this, plus the scan of the book above and my own paper copy to get to stages/sargon1.asm which is the starting point of my conversion pipeline, being as close to the exact text of the Sargon program in the book as I can make it."

By the way, it is very interesting to read the Andre Adrian's web page related to Chess ( http://www.andreadrian.de/schach/ ) ...

I have all the admiration for the work done by these experts, and I am sure that they made every effort to achieve something special, with the best intentions.

Back to the "cheating" issue: I read too some opinions, about the "old" TRS or Apple II Sargon, behaving oddly (cheating?), e.g. breaking the "en-passant" rule, but I do not think that these opinions should be expanded in an arbitrary way to all the implementations of Sargon chess program.

And, back to the "proof": for me, the absolute proof would be a log of a chess match, played with my Sargon78 program, to show that the program "cheats".

This being said,

please enjoy playing with Sargon78 !

Ladislau


retrogear

unread,
Jul 4, 2023, 8:32:33 AM7/4/23
to

> Back to the "cheating" issue: I read too some opinions, about the "old" TRS or Apple II Sargon, behaving oddly (cheating?), e.g. breaking the "en-passant" rule, but I do not think that these opinions should be expanded in an arbitrary way to all the implementations of Sargon chess program.
>
> And, back to the "proof": for me, the absolute proof would be a log of a chess match, played with my Sargon78 program, to show that the program "cheats".
>

If you play a supposedly flawed Apple II Sargon on two different computers and input each counter move from one to the other would it theoretically end in a draw ?
I wonder if this would be the way to reveal an errant move ?

Larry G

ladislau szilagyi

unread,
Jul 4, 2023, 9:43:48 AM7/4/23
to
Hi,

about the topic of "a chess program is cheating", my opinion is that's a very complex issue.

I do not want to discuss the possibility that the author(s) of a given chess program included in the source code some routines that break the official rules of the chess game ( https://www.fide.com/FIDE/handbook/LawsOfChess.pdf ) with the intention to win the game...

More likely, the root cause of the issue is, more or less, related to a program bug or ignoring a chess game rule that is difficult to implement.

Example: do you consider that Sargon78 is cheating because it ignores the following rule: "The game may be drawn if any identical position is about to appear or has appeared on the chessboard at least three times" ?

I do not think so, because this rule is difficult to be implemented, and therefore the authors simply have decided to ignore this rule !

So, in this particular case, in my opinion, Sargon78 is not "cheating" ; it simply has a limitation of ignoring the rule mentioned before.

I can accept this as a minor deficiency of Sargon78.

On the other hand, the problem of a possible software bug is much more serious... but, have any one of you found such a ''bug" while playing chess with Sargon78?

What's your opinion on this issue?

regards,
Ladislau

Udo Munk

unread,
Jul 4, 2023, 1:09:29 PM7/4/23
to
ladislau szilagyi schrieb am Dienstag, 4. Juli 2023 um 15:43:48 UTC+2:
> On the other hand, the problem of a possible software bug is much more serious... but, have any one of you found such a ''bug" while playing chess with Sargon78?
>
> What's your opinion on this issue?

The source published had a bug that was fixed by someone, who wrote an article including his fix
in Byte, Dr. Dobbs ... don't know anymore. The bug was acknowledged by the authors. It is difficult
to find this article nowadays.

ladislau szilagyi

unread,
Jul 4, 2023, 2:08:05 PM7/4/23
to
Hi Udo,

yes, I heard too this story about the "bugged" Sargon source code published in their Hayden book.
But, as you said, bugs can be found and fixed.
Exactly this happened in this case too, this Sargon source code passed through many hands, and eventually all the found bugs were fixed (e.g. : how was solved a "castling bug", here: https://hiarcs.net/forums/viewtopic.php?f=1&p=113701 ).

Ladislau

Tom Szolyga

unread,
Jul 4, 2023, 3:23:24 PM7/4/23
to
Has anyone tried the 8086 version on a current X86 processor? For example, what would the performance be on a Ryzen 7, 8 core running at 3.7GHz with 64GB of memory? Perhaps a 8086 to C or C++ would be required. It would be interesting to see a 1978 program running on afterburners.

Tom

ladislau szilagyi

unread,
Jul 5, 2023, 3:53:23 AM7/5/23
to
Hi Tom,

you can easily try-it.

Just go to Bill Forster's GitHub page: https://github.com/billforsternz/retro-sargon , and read the "How can I try it out?" paragraph.

I used the Tarrasch Chess GUI, as Bill recommended...

regards,
Ladislau

0 new messages