Compilation of XT chess programs

This forum is for general discussions and questions, including Collectors Corner and anything to do with Computer chess.

Moderators: Harvey Williamson, Steve B, Watchman

Forum rules
This textbox is used to restore diagrams posted with the fen tag before the upgrade.
User avatar
BenRedic
Member
Posts: 163
Joined: Mon Jan 09, 2017 11:29 am
Location: Norway

Compilation of XT chess programs

Post by BenRedic »

I've been playing around with different virtual PC configurations in PCem for playing chess programs from different eras. One of the things I tried was to see how many early chess programs I could fit on a floppy that could boot on an XT. This is the result. It's not the biggest collection, and it's not the best or the strongest programs, but they all fit snuggly into a a 5,25" 360kB floppy image that boots to DOS and gives you 8 chess programs from 1976-85, all ready to run on an XT with 256 kB RAM and CGA, or any capable emulator. If anybody is interested it can be downloaded from https://www.dropbox.com/s/tlrh0y8bj9cvplo/CHESS4XT.img.

Most of these should be well known. The rarest one is probably the '76 BASIC program.

For emulation, any PC emulator like PCem, DosBox and Virtualbox should do the trick. If you don't have one installed I can recommend the online JavaScript emulator at https://www.pcjs.org/machines/pcx86/ibm/5160/cga/. Just point to the img-file, mount it and boot. The disk is chock full, so sadly I couldn't fit any bat-files to make it easier to run the programs, but if you know how to type the name of an EXE/COM file and CD into a directory you should be fine.

A single readme.txt outlines the contents of the disk. See also screenshots below.

Code: Select all

Early PC chess programs for XT/256kB/CGA compiled by sheikh Ben Redic Fy Fazan:
CHESS76.EXE (1976) Randy Miller. Compiled BASIC. Uses custom 8x8 notation, 
	i.e. 'e2-e4' is entered as '57,55'.
CHESS81.EXE aka Chess C.4 (1981) Michael Rakaska. Compiled BASIC, published
	in Creative Computing December 1981. Press I for instructions.
CHESS88.EXE (1984) Don Berg.
BLUEBUSH.COM (1983).
PARTNER: Chess Partner (1983).
SPOC the Chessmaster (1983). Use cursor keys + HOME to move pieces.
Turbo Chess (1985) Kaare Danielsen. PASCAL, released with Borland Turbo
	Gameworks as a showcase for the platform.
MYCHESS.COM (1984) David Kittinger. Originally for CP/M in 1979, ported to
	DOS in 1984. Early 80s home computer champion, went on to power the
	first games in the Chessmaster series. Probably the strongest one here.
Image
Image
Image
Image
Image
Image
Image
Image
Image
Thank you for an interesting game.
User avatar
Tibono2
Full Member
Posts: 696
Joined: Mon Jan 16, 2017 7:55 pm
Location: France
Contact:

Post by Tibono2 »

Hi BenRedic,

Thanks!

A couple of questions, please:
Did you find out how to move chessmen using Spoc :? ? Didn't find it (DosBox)
And... is there a way to castle using Partner, or does it simply ignore this rule?
Cheers,
Tibono
User avatar
BenRedic
Member
Posts: 163
Joined: Mon Jan 09, 2017 11:29 am
Location: Norway

Post by BenRedic »

Tibono2 wrote: A couple of questions, please:
Did you find out how to move chessmen using Spoc :? ? Didn't find it (DosBox)
And... is there a way to castle using Partner, or does it simply ignore this rule?
SPOC: It's in the readme.txt. Cursor keys to move, HOME to pick up and drop pieces.

Code: Select all

SPOC the Chessmaster (1983). Use cursor keys + HOME to move pieces. 
Castling in Chess Partner: Move the rook to the kings position, i.e. H1-E1.
Thank you for an interesting game.
User avatar
Tibono2
Full Member
Posts: 696
Joined: Mon Jan 16, 2017 7:55 pm
Location: France
Contact:

Post by Tibono2 »

Thanks!
mychess
Member
Posts: 96
Joined: Tue Jul 31, 2007 8:55 pm

Post by mychess »

Hello BenRedic,

I didn't find Chess by Parker Brothers for PC, but I have a scoop that I haven't seen anywhere else.
Thanks for the compilation of the old chess programs, no need to search in the old hard disks, or worse in the floppies 5 "1/4 !!!
I remember Chess88, nice display on PC (better than Mychess on Trs-80), but it was weaker.
The scoop is that Don Berg's Chess88 is the implementation of Sargon I on PC.

Cordially.
User avatar
mclane
Senior Member
Posts: 1600
Joined: Sun Jul 29, 2007 9:04 am
Location: Luenen, germany, US of europe
Contact:

Post by mclane »

I find it strange that we cannot find broughtons chess engine / parker chess for pc but that we have it for Atari 800.
Was it ever released on pc ??
What seems like a fairy tale today may be reality tomorrow.
Here we have a fairy tale of the day after tomorrow....
User avatar
BenRedic
Member
Posts: 163
Joined: Mon Jan 09, 2017 11:29 am
Location: Norway

Post by BenRedic »

mclane wrote:I find it strange that we cannot find broughtons chess engine / parker chess for pc but that we have it for Atari 800.
Was it ever released on pc ??
I recently asked in this forum if anybody has it. I have been looking for it as well. I have seen ads and reviews for it in old computer magazines, so I am pretty sure it exist(ed).
Thank you for an interesting game.
User avatar
BenRedic
Member
Posts: 163
Joined: Mon Jan 09, 2017 11:29 am
Location: Norway

Post by BenRedic »

mychess wrote:The scoop is that Don Berg's Chess88 is the implementation of Sargon I on PC.
Didn't know that, thanks! Although the level selector should have rung a bell.
Thank you for an interesting game.
User avatar
BenRedic
Member
Posts: 163
Joined: Mon Jan 09, 2017 11:29 am
Location: Norway

Post by BenRedic »

BenRedic wrote:
mclane wrote:I find it strange that we cannot find broughtons chess engine / parker chess for pc but that we have it for Atari 800.
Was it ever released on pc ??
I recently asked in this forum if anybody has it. I have been looking for it as well. I have seen ads and reviews for it in old computer magazines, so I am pretty sure it exist(ed).
Pictures here.

ImageImage
ImageImage
Thank you for an interesting game.
User avatar
BenRedic
Member
Posts: 163
Joined: Mon Jan 09, 2017 11:29 am
Location: Norway

Post by BenRedic »

BenRedic wrote:
mychess wrote:The scoop is that Don Berg's Chess88 is the implementation of Sargon I on PC.
Didn't know that, thanks! Although the level selector should have rung a bell.
Hm, just tested a couple of games, and I can't really say this looks much like Sargon. For starters, Sargon always opens with a centre pawn (d or e). Chess88 does this as white, but as black it likes to bring out knights on move 1, often subsequently finding them chased around the board. Even weirder: All the knight-jumping seems to be part of its book, because it typically jumps instantly around the first three moves, before it starts to spend time thinking. Sargon 1 had no opening book whatsoever, just a short opening routine that ensured that move 1 is a center pawn move. Sargon should be out of its "book" at move 2.

Also, when I let it play white it quickly deviates from the play of Sargon.

It may be based on or inspired by the Sargon 6502 source code, like a lot of chess programs from the years after the release of the Sargon book, but something must have been changed in the translation to 8088. If anything, the play of Chess88 reminds me of SOMA, or the Randy Miller BASIC program.
Thank you for an interesting game.
mychess
Member
Posts: 96
Joined: Tue Jul 31, 2007 8:55 pm

Post by mychess »

The listing of Sargon I (THE BOOK!) is from 1978.
I think that Don Berg added code to the great Sargon translation.
I say translation, because fundemental routine like PINFND is identical to that off Sargon I.
I will try to find the changes for the opening library.

Code: Select all

;**********************************************************          |
; PIN FIND ROUTINE                                                   |
;**********************************************************          |
; FUNCTION: --          To produce a list of all pieces pinned       |
;                       against the King or Queen, for both white    |
;                       and black.                                   |
;                                                                    |
; CALLED BY: --         FNDMOV                                       |
;                       EVAL                                         |
;                                                                    |
; CALLS: -- PATH                                                     |
;                       ATTACK                                       |
;                                                                    |
; ARGUMENTS: --         None                                         |
;**********************************************************          |  0D24 :                    sub_D24         proc near              
PINFND:     XRA         A           ; Zero pin count                 |  0D24 : C7 06 C0 09 00 00                  mov     word ptr ds:9C0h, 0
            STA         NPINS                                        |  0D2A : BE 00 00                           mov     si, 0
            LXI         D,POSK      ; Addr of King/Queen pos list    |  0D2D :                    loc_D2D:                               
PF1:        LDAX        D           ; Get position of royal piece    |  0D2D : 8A 9C 79 01                        mov     bl, [si+179h]
            ANA         A           ; Is it on board ?               |  0D31 : 80 FB 00                           cmp     bl, 0
            JZ          PF26        ; No- jump                       |  0D34 : 75 03                              jnz     short loc_D39
            CPI         -1          ; At end of list ?               |  0D36 : E9 B5 00                           jmp     loc_DEE
            RZ                      ; Yes return                     |  0D39 :                    loc_D39:                               
            STA         M3          ; Save position as board index   |  0D39 : 80 FB FF                           cmp     bl, 0FFh
            LIXD        M3          ; Load index to board            |  0D3C : 75 01                              jnz     short loc_D3F
            MOV         A,BOARD(X)  ; Get contents of board          |  0D3E : C3                                 retn
            STA         P1          ; Save                           |  0D3F :                    loc_D3F:                                
            MVI         B,8         ; Init scan direction count      |  0D3F : B7 00                              mov     bh, 0
            XRA         A                                            |  0D41 : 89 1E B6 09                        mov     ds:9B6h, bx
            STA         INDX2       ; Init direction index           |  0D45 : 8A 87 D1 00                        mov     al, [bx+0D1h]
            LIYD        INDX2                                        |  0D49 : A2 D0 09                           mov     ds:9D0h, al
PF2:        LDA         M3          ; Get King/Queen position        |  0D4C : B5 08                              mov     ch, 8
            STA         M2          ; Save                           |  0D4E : BF 00 00                           mov     di, 0
            XRA         A                                            |  0D51 :                    loc_D51:                                
            STA         M4          ; Clear pinned piece saved pos   |  0D51 : A0 B6 09                           mov     al, ds:9B6h
            MOV         C,DIRECT(Y) ; Get direction of scan          |  0D54 : A2 B4 09                           mov     ds:9B4h, al
PF5:        CALL        PATH        ; Compute next position          |  0D57 : C6 06 B8 09 00                     mov     byte ptr ds:9B8h, 0
            ANA         A           ; Is it empty ?                  |  0D5C : 8A 8D 9C 00                        mov     cl, [di+9Ch]
            JRZ         PF5         ; Yes - jump                     |  0D60 :                    loc_D60:                               
            CPI         3           ; Off board ?                    |  0D60 : E8 93 FF                           call    sub_CF6
            JZ          PF25        ; Yes - jump                     |  0D63 : 3C 00                              cmp     al, 0
            CPI         2           ; Piece of same color            |  0D65 : 74 F9                              jz      short loc_D60
            LDA         M4          ; Load pinned piece position     |  0D67 : 3C 03                              cmp     al, 3
            JRZ         PF15        ; Yes - jump                     |  0D69 : 74 7B                              jz      short loc_DE6
            ANA         A           ; Possible pin ?                 |  0D6B : 3C 02                              cmp     al, 2
            JZ          PF25        ; No - jump                      |  0D6D : 74 1F                              jz      short loc_D8E
            LDA         T2          ; Piece type encountered         |  0D6F : 80 3E B8 09 00                     cmp     byte ptr ds:9B8h, 0
            CPI         QUEEN       ; Queen ?                        |  0D74 : 74 70                              jz      short loc_DE6
            JZ          PF19        ; Yes - jump                     |  0D76 : A0 BC 09                           mov     al, ds:9BCh
            MOV         L,A         ; Save piece type                |  0D79 : 3C 05                              cmp     al, 5
;X p45                                                               |  0D7B : 74 20                              jz      short loc_D9D
            MOV         A,B         ; Direction counter              |  0D7D : 80 FD 05                           cmp     ch, 5
            CPI         5           ; Non-diagonal direction ?       |  0D80 : 72 06                              jb      short loc_D88
            JRC         PF10        ; Yes - jump                     |  0D82 : 3C 03                              cmp     al, 3
            MOV         A,L         ; Piece type                     |  0D84 : 75 60                              jnz     short loc_DE6
            CPI         BISHOP      ; Bishop ?                       |  0D86 : 74 4A                              jz      short loc_DD2
            JNZ         PF25        ; No - jump                      |  0D88 :                    loc_D88:                               
            JMP         PF20        ; Jump                           |  0D88 : 3C 04                              cmp     al, 4
PF10:       MOV         A,L         ; Piece type                     |  0D8A : 75 5A                              jnz     short loc_DE6
            CPI         ROOK        ; Rook ?                         |  0D8C : 74 44                              jz      short loc_DD2
            JNZ         PF25        ; No - jump                      |  0D8E :                    loc_D8E:                               
            JMP         PF20        ; Jump                           |  0D8E : 80 3E B8 09 00                     cmp     byte ptr ds:9B8h, 0
PF15:       ANA         A           ; Possible pin ?                 |  0D93 : 75 51                              jnz     short loc_DE6
            JNZ         PF25        ; No - jump                      |  0D95 : A0 B4 09                           mov     al, ds:9B4h
            LDA         M2          ; Save possible pin position     |  0D98 : A2 B8 09                           mov     ds:9B8h, al
            STA         M4                                           |  0D9B : EB C3                              jmp     short loc_D60
            JMP         PF5         ; Jump                           |  0D9D :                    loc_D9D:                                
PF19:       LDA         P1          ; Load King or Queen             |  0D9D : A0 D0 09                           mov     al, ds:9D0h
            ANI         7           ; Clear flags                    |  0DA0 : 24 07                              and     al, 7
            CPI         QUEEN       ; Queen ?                        |  0DA2 : 3C 05                              cmp     al, 5
            JRNZ        PF20        ; No - jump                      |  0DA4 : 75 2C                              jnz     short loc_DD2
            PUSH        B           ; Save regs.                     |  0DA6 : 51                                 push    cx
            PUSH        D                                            |  0DA7 : 57                                 push    di
            PUSH        Y                                            |  0DA8 : B0 00                              mov     al, 0
            XRA         A           ; Zero out attack list           |  0DAA : B9 0E 00                           mov     cx, 0Eh
            MVI         B,14                                         |  0DAD : 8D 3E 49 01                        lea     di, loc_1138+1 - (loc_FED+3)
            LXI         H,ATKLST                                     |  0DB1 : FC                                 cld
            MOV         M,A                                          |  0DB2 : F3 AB                              rep stosw
            INX         H                                            |  0DB4 : C6 06 BA 09 07                     mov     byte ptr ds:9BAh, 7
            DJNZ        .-2                                          |  0DB9 : E8 3C F5                           call    near ptr byte_1+2F7h
            MVI         A,7         ; Set attack flag                |  0DBC : 5F                                 pop     di
            STA         T1                                           |  0DBD : 59                                 pop     cx
            CALL        ATTACK      ; Find attackers/defenders       |  0DBE : A0 49 01                           mov     al, ds:149h
            LXI         H,WACT      ; White queen attackers          |  0DC1 : 2A 06 57 01                        sub     al, ds:157h
            LXI         D,BACT      ; Black queen attackers          |  0DC5 : F6 06 D0 09 80                     test    byte ptr ds:9D0h, 80h
            LDA         P1          ; Get queen                      |  0DCA : 74 02                              jz      short loc_DCE
            BIT         7,A         ; Is she white ?                 |  0DCC : F6 D8                              neg     al
            JRZ         .+3         ; Yes - skip                     |  0DCE :                    loc_DCE:                                
            XCHG                    ; Reverse for black              |  0DCE : FE C8                              dec     al
            MOV         A,M         ; Number of defenders            |  0DD0 : 79 14                              jns     short loc_DE6
            XCHG                    ; Reverse for attackers          |  0DD2 :                    loc_DD2:                                
            SUB         M           ; Defenders minus attackers      |  0DD2 : 8B 1E C0 09                        mov     bx, ds:9C0h
            DCR         A           ; Less 1                         |  0DD6 : 43                                 inc     bx
            POP         Y           ; Restore regs.                  |  0DD7 : 89 1E C0 09                        mov     ds:9C0h, bx
            POP         D                                            |  0DDB : 88 8F 6F 01                        mov     [bx+16Fh], cl
            POP         B                                            |  0DDF : A0 B8 09                           mov     al, ds:9B8h
            JP          PF25        ; Jump if pin not valid          |  0DE2 : 88 87 65 01                        mov     [bx+165h], al
PF20:       LXI         H,NPINS     ; Address of pinned piece count  |  0DE6 :                    loc_DE6:                                
            INR         M           ; Increment                      |  0DE6 : 47                                 inc     di
            LIXD        NPINS       ; Load pin list index            |  0DE7 : FE CD                              dec     ch
            MOV         PLISTD(X),C ; Save direction of pin          |  0DE9 : 74 03                              jz      short loc_DEE
;X p46                                                               |  0DEB : E9 63 FF                           jmp     loc_D51
            LDA         M4          ; Position of pinned piece       |  0DEE :                    loc_DEE:                                
            MOV         PLIST(X),A  ; Save in list                   |  0DEE : 46                                 inc     si
PF25:       INX         Y           ; Increment direction index      |  0DEF : E9 3B FF                           jmp     loc_D2D
            DJNZ        PF27        ; Done ? No - Jump               |  0DEF :                    sub_D24         endp
PF26:       INX         D           ; Incr King/Queen pos index
            JMP         PF1         ; Jump
PF27:       JMP         PF2         ; Jump






















Cordially.
mychess
Member
Posts: 96
Joined: Tue Jul 31, 2007 8:55 pm

Post by mychess »

Hello,

I checked the POINTS routine for Chess88 (evaluation function).
As you can see, it is exactly the same at that of Sargon I.

Code: Select all

;****************************************************************
; POINT EVALUATION ROUTINE
;****************************************************************
; FUNCTION: --      To perform a static board evaluation and
;                   derive a score for a given board position
;
; CALLED BY: --     FNDMOV
;                   EVAL
;
; CALLS: --         ATTACK
;                   XCHNG
;                   LIMIT
;
; ARGUMENTS: --     None
;****************************************************************
POINTS: XRA     A       ; Zero out variables                                 |         0EA8                       proc            sub_EA8 near
        STA     MTRL                                                         |         0EA8 B0 00                                 mov     al, 0
        STA     BRDC                                                         |         0EAA A2 DE 09                              mov     [ds:byte_9DE], al
        STA     PTSL                                                         |         0EAD A2 DA 09                              mov     [ds:byte_9DA], al
        STA     PTSWI                                                        |         0EB0 A2 DB 09                              mov     [ds:byte_9DB], al
        STA     PTSW2                                                        |         0EB3 A2 DC 09                              mov     [ds:byte_9DC], al
        STA     PTSCK                                                        |         0EB6 A2 DD 09                              mov     [ds:byte_9DD], al
        LXI     H,T1    ; Set attacker flag                                  |         0EB9 A2 E1 09                              mov     [ds:byte_9E1], al
        MVI     M,7                                                          |         0EBC C6 06 BA 09 07                        mov     [byte ptr ds:loc_9BA], 7
        MVI     A,21    ; Init to first square on board                      |         0EC1 BB 15 00                              mov     bx, 15h
PT5:    STA     M3      ; Save as board index                                |         0EC4                       loc_EC4:
        LIXD    M3      ; Load board index                                   |         0EC4 89 1E B6 09                           mov     [word ptr ds:loc_9B6], bx
        LDA     A,BOARD(X)      ; Get piece from board                       |         0EC8 8A 87 D1 00                           mov     al, [bx+0D1h]
        CPI     -1      ,Off board edge ?                                    |         0ECC 3C FF                                 cmp     al, 0FFh
        JZ      PT25    ; Yes - jump                                         |         0ECE 75 03                                 jnz     short loc_ED3
        LXI     H,P1    ; Save piece, if any                                 |         0ED0 E9 BD 00                              jmp     loc_F90
        LDA     M,A                                                          |         0ED3                       loc_ED3:
        ANI     7       ; Save piece type, if any                            |         0ED3 8A C8                                 mov     cl, al
        STA     T3                                                           |         0ED5 A2 D0 09                              mov     [ds:byte_9D0], al
        CPI     KNIGHT  ; Less than a Knight (Pawn) ?                        |         0ED8 24 07                                 and     al, 7
        JRC     PT6X    ; Yes - Jump                                         |         0EDA A2 BE 09                              mov     [byte ptr ds:loc_9BE], al
        CPI     ROOK    ; Rook, Queen or King ?                              |         0EDD 3C 01                                 cmp     al, 1                      ; KNIGHT
        JRC     PT6.B   ; No - jump                                          |         0EDF 76 3B                                 jbe     short loc_F1C
        CPI     KING    ; Is it a King ?                                     |         0EE1 3C 04                                 cmp     al, 4                      ; ROOK
        JRZ     PT6AA   ; Yes - jump                                         |         0EE3 72 25                                 jb      short loc_F0A
        LDA     MOVENO  ; Get move number                                    |         0EE5 3C 06                                 cmp     al, 6                      ; KING
        CPI     7       ; Less than 7 ?                                      |         0EE7 74 09                                 jz      short loc_EF2
        JRC     PT6A    ; Yes - Jump                                         |         0EE9 80 3E D4 09 07                        cmp     [ds:byte_9D4], 7
        JMP     PT6X    ; Jump                                               |         0EEE 72 13                                 jb      short loc_F03
PT6AA:  BIT     4,M     ; Castled yet ?                                      |         0EF0 73 11                                 jnb     short loc_F03
        JRZ     PT6A    ; No - jump                                          |         0EF2                       loc_EF2:
        MVI     A,+6    ; Bonus for castling                                 |         0EF2 F6 C1 10                              test    cl, 10h                     ; Castled yet ?
        BIT     7,M     ; Check piece color                                  |         0EF5 74 0C                                 jz      short loc_F03
        JRZ     PT6D    ; Jump if white                                      |         0EF7 B0 06                                 mov     al, 6                       ; Bonus for castling
        MVI     A,-6    ; Bonus for black castling                           |         0EF9 F6 C1 80                              test    cl, 80h
        JMP     PT6D    ; Jump                                               |         0EFC 74 1A                                 jz      short loc_F18
PT6A:   BIT     3,M     ; Has piece moved yet ?                              |         0EFE F6 D8                                 neg     al
        JRZ     PT6X    ; No - jump                                          |         0F00 EB 16                                 jmp     short loc_F18
        JMP     PT6C    ; Jump                                               |         0F02 90                                    db  90h
PT6B:   BIT     3,M     ; Has piece moved yet ?                              |         0F03                       loc_F03:
        JRNZ    PT6X    ; Yes - jump                                         |         0F03 F6 C1 08                              test    cl, 8
PT6C:   MVI     A,-2    ; Two point penalty for white                        |         0F06 74 14                                 jz      short loc_F1C
        BIT     7,M     ; Check piece color                                  |         0F08 75 05                                 jnz     short loc_F0F
        JRZ     .+4     ; Jump if white                                      |         0F0A                       loc_F0A:
        MVI     A,+2    ; Two point penalty for black                        |         0F0A F6 C1 08                              test    cl, 8
PT6D:   LXI     H,BRDC  ; Get address of board control                       |         0F0D 75 0D                                 jnz     short loc_F1C
        ADD     M       ; Add on penalty/bonus points                        |         0F0F                       loc_F0F:
        LDA     M,A     ; Save                                               |         0F0F B0 02                                 mov     al, 2                       ; Two point penalty for white
PT6X:   XRA     A       ; Zero out attack list                               |         0F11 F6 C1 80                              test    cl, 80h                     ; Check piece color
        MVI     B,14                                                         |         0F14 75 02                                 jnz     short loc_F18               ; Jump if white
        LXI     H,ATKLST                                                     |         0F16 F6 D8                                 neg     al                          ; Two point penalty for black
        LDA     M,A                                                          |         0F18                       loc_F18:
        INX     H                                                            |         0F18 00 06 DA 09                           add     [ds:byte_9DA], al
        DJNZ    .-2                                                          |         0F1C                       loc_F1C:
        CALL    ATTACK  ; Build attack list for square                       |         0F1C B0 00                                 mov     al, 0
        LXI     H,BACT  ; Get black attacker count addr                      |         0F1E B9 0E 00                              mov     cx, 0Eh
        LDA     WACT    ; Get white attacker count                           |         0F21 8D 3E 49 01                           lea     di, [byte_149]
        SUB     M       ; Compute count difference                           |         0F25 FC                                    cld
        LXI     H,BRDC  ; Address of board control                           |         0F26 F3 AB                                 rep stosw
        ADD     M       ; Accum board control score                          |         0F28 E8 CD F3                              call    sub_2F8
        LDA     M,A     ; Save                                               |         0F2B A0 49 01                              mov     al, [ds:byte_149]
        LDA     P1      ; Get piece on current square                        |         0F2E 2A 06 57 01                           sub     al, [ds:byte_157]
        ANA     A       ; Is it empty ?                                      |         0F32 00 06 DA 09                           add     [ds:byte_9DA], al
        JZ      PT25    ; Yes - jump                                         |         0F36 80 3E D0 09 00                        cmp     [ds:byte_9D0], 0
        CALL    XCHNG   ; Evaluate exchange, if any                          |         0F3B 74 53                                 jz      short loc_F90
        XRA     A       ; Check for a loss                                   |         0F3D E8 5E 02                              call    sub_119E
        CMP     E       ; Points lost ?                                      |         0F40 80 FA 00                              cmp     dl, 0
        JRZ     PT23    ; No - Jump                                          |         0F43 74 3C                                 jz      short loc_F81
        DCR     D       ; Deduct half a Pawn value                           |         0F45 FE CE                                 dec     dh
        LDA     P1      ; Get piece under attack                             |         0F47 A0 D0 09                              mov     al, [ds:byte_9D0]
        LXI     H,COLOR ; Color of side just moved                           |         0F4A 32 06 CF 09                           xor     al, [ds:byte_9CF]
        XRA     M       ; Compare with piece                                 |         0F4E 78 1C                                 js      short loc_F6C
        BIT     7,A     ; Do colors match ?                                  |         0F50 3A 16 DB 09                           cmp     dl, [ds:byte_9DB]
        LDA     A,E     ; Points lost                                        |         0F54 72 2B                                 jb      short loc_F81
        JRNZ    PT20    ; Jump if no match                                   |         0F56 88 16 DB 09                           mov     [ds:byte_9DB], dl
        LXI     H,PTSL  ; Previous max points lost                           |         0F5A 8B 1E C4 09                           mov     bx, [ds:word_9C4]
        CMP     M       ; Compare to current value                           |         0F5E A0 B6 09                              mov     al, [byte ptr ds:loc_9B6]
        JRC     PT23    ; Jump if greater than                               |         0F61 3A 47 03                              cmp     al, [bx+3]
        LDA     M,E     ; Store new value as max lost                        |         0F64 75 1B                                 jnz     short loc_F81
        LIXD    MLPTRJ  ; Load pointer to this move                          |         0F66 A2 E1 09                              mov     [ds:byte_9E1], al
        LDA     M3      ; Get position of lost piece                         |         0F69 EB 16                                 jmp     short loc_F81
        CMP     MLTOP(X)        ; Is it the one moving ?                     |         0F6B 90                                    db  90h
        JRNZ    PT23    ; No - jump                                          |         0F6C                       loc_F6C:
        STA     PTSCK   ; Save position as a flag                            |         0F6C 8A C2                                 mov     al, dl
        JMP     PT23    ; Jump                                               |         0F6E 3A 06 DC 09                           cmp     al, [ds:byte_9DC]
PT20:   LXI     H,PTSW1 ;       Previous maximum points won                  |         0F72 72 04                                 jb      short loc_F78
        CMP     M ;     Compare to current value                             |         0F74 86 06 DC 09                           xchg    al, [ds:byte_9DC]
        JRC     .+4 ;   Jump if greater than                                 |         0F78                       loc_F78:
        LDA     A,M ;   Load previous max value                              |         0F78 3A 06 DD 09                           cmp     al, [ds:byte_9DD]
        LDA     M,E ;   Store new value as max won                           |         0F7C 72 03                                 jb      short loc_F81
        LXI     H,PTSW2 ;       Previous 2nd max points won                  |         0F7E A2 DD 09                              mov     [ds:byte_9DD], al
        CMP     M ;     Compare to current value                             |         0F81                       loc_F81:
        JRC     PT23 ;  Jump if greater than                                 |         0F81 8A C6                                 mov     al, dh
        LDA     M,A ;   Store as new 2nd max lost                            |         0F83 F6 06 D0 09 80                        test    [ds:byte_9D0], 80h
PT23:   LXI     H,Pl ;  Get piece                                            |         0F88 74 02                                 jz      short loc_F8C
        BIT     7,M ;   Test color                                           |         0F8A F6 D8                                 neg     al
        LDA     A,D ;   Value of piece                                       |         0F8C                       loc_F8C:
        JRZ     .+4 ;   Jump if white                                        |         0F8C 00 06 DE 09                           add     [ds:byte_9DE], al
        NEG ;           Negate for black                                     |         0F90                       loc_F90:
        LXI     H,MTRL ;        Get addrs of material total                  |         0F90 8B 1E B6 09                           mov     bx, [word ptr ds:loc_9B6]
        ADD     M ;     Add new value                                        |         0F94 43                                    inc     bx
        LDA     M,A ;   Store                                                |         0F95 83 FB 63                              cmp     bx, 63h ;           ; At end of board ?
PT25:   LDA     M3 ;    Get current board position                           |         0F98 73 03                                 jnb     short loc_F9D
        INR     A ;     Increment                                            |         0F9A E9 27 FF                              jmp     loc_EC4
        CPI     99 ;    At end of board ?                                    |         0F9D                       loc_F9D:
        JNZ     PT5 ;   No - jump                                            |         0F9D 80 3E E1 09 00                        cmp     [ds:byte_9E1], 0
        LDA     PTSCK ; Moving piece lost flag                               |         0FA2 74 0B                                 jz      short loc_FAF
        ANA     A ;     Was it lost ?                                        |         0FA4 A0 DD 09                              mov     al, [ds:byte_9DD]
        JRZ     PT25A ; No - jump                                            |         0FA7 A2 DC 09                              mov     [ds:byte_9DC], al
        LDA     PTSW2 ; 2nd max points won                                   |         0FAA C6 06 DD 09 00                        mov     [ds:byte_9DD], 0
        STA     PTSW1 ; Store as max points won                              |         0FAF                       loc_FAF:
        XRA     A ;     Zero out 2nd max points won                          |         0FAF A0 DB 09                              mov     al, [ds:byte_9DB]
        STA     PTSW2                                                        |         0FB2 3C 00                                 cmp     al, 0
PT25A:  LDA     PTSL ;  Get max points lost                                  |         0FB4 74 02                                 jz      short loc_FB8
        ANA     A ;     Is it zero ?                                         |         0FB6 FE C8                                 dec     al
        JRZ     .+3 ;   Yes - jump                                           |         0FB8                       loc_FB8:
        DCR     A ;     Decrement it                                         |         0FB8 8A E8                                 mov     ch, al
        LDA     B,A ;   Save it                                              |         0FBA A0 DC 09                              mov     al, [ds:byte_9DC]
        LDA     PTSW1 ; Max,points won                                       |         0FBD 3C 00                                 cmp     al, 0
        ANA     A ;     Is it zero ?                                         |         0FBF 74 0B                                 jz      short loc_FCC
        JRZ     .+11. ; Yes - jump                                           |         0FC1 A0 DD 09                              mov     al, [ds:byte_9DD]
        LDA     PTSW2 ; 2nd max points won                                   |         0FC4 3C 00                                 cmp     al, 0
        ANA     A ;     Is it zero ?                                         |         0FC6 74 04                                 jz      short loc_FCC
        JRZ     .+5 ;   Yes - jump                                           |         0FC8 FE C8                                 dec     al
        DCR     A ;     Decrement it                                         |         0FCA D0 E8                                 shr     al, 1
        SRLR    A ;     Divide it by 2                                       |         0FCC                       loc_FCC:
        SUB     B ;     Subtract points lost                                 |         0FCC 2A C5                                 sub     al, ch
        LXT     9,COLOR ;       Color of side just moved                     |         0FCE F6 06 CF 09 80                        test    [ds:byte_9CF], 80h   ; Is it white ?
        BIT     7,M ;   Is it white ?                                        |         0FD3 74 02                                 jz      short loc_FD7
        JRZ     .+4 ;   Yes - jump                                           |         0FD5 F6 D8                                 neg     al
        NEG ;           Negate for black                                     |         0FD7                       loc_FD7:
        LXI     H,MTRL ;        Net material on board                        |         0FD7 02 06 DE 09                           add     al, [ds:byte_9DE]
        ADD     M ;     Add exchange adjustments                             |         0FDB 2A 06 E0 09                           sub     al, [ds:byte_9E0]
        SUB     M ;     Subtract from current                                |         0FDF B5 1E                                 mov     ch, 1Eh              ; Load material limit
        LDA     B,A ;   Save                                                 |         0FE1 E8 BC FB                              call    near ptr loc_B9F+1   ; Limit to plus or minus value
        MVI     A,30 ;  Load material limit                                  |         0FE4 8A D0                                 mov     dl, al
        CALL    LIMIT ; Limit to plus or minus value                         |         0FE6 A0 DA 09                              mov     al, [ds:byte_9DA]
        LDA     E,A ;   Save limited value                                   |         0FE9 2A 06 DF 09                           sub     al, [ds:byte_9DF]
        LDA     BRDC ;  Get board control points                             |         0FED                       loc_FED:
        LXI     H,BCO ; Board control at ply zero                            |         0FED 80 3E E1 09 00                        cmp     [ds:byte_9E1], 0
        SUB     M ;     Get difference                                       |         0FF2 74 02                                 jz      short loc_FF6
        LDA     B,A ;   Save                                                 |         0FF4 B0 00                                 mov     al, 0
        LDA     PTSCK ; Moving piece lost flag                               |         0FF6                       loc_FF6:
        ANA     A ;     Is it zero ?                                         |         0FF6 B5 06                                 mov     ch, 6                 ; Load board control limit
        JRZ     .+4 ;   Yes - jump                                           |         0FF8 E8 A5 FB                              call    near ptr loc_B9F+1    ; Limit to plus or minus value
        MVI     B,0 ;   Zero board control points                            |         0FFB D0 E2                                 shl     dl, 1
        MVI     A,6 ;   Load board control limit                             |         0FFD D0 E2                                 shl     dl, 1                 ; Multiply by 4
        CALL    LIMIT ; Limit to plus or minus value                         |         0FFF 02 C2                                 add     al, dl
        LDA     D,A ;   Save limited value                                   |         1001 F6 06 CF 09 80                        test    [ds:byte_9CF], 80h    ; Is it white ?
        LDA     A,E ;   Get material points                                  |         1006 75 02                                 jnz     short loc_100A        ; No - jump
        ADD     A ;     Multiply by 4                                        |         1008 F6 D8                                 neg     al                    ; Negate for white
        ADD     A                                                            |         100A                       loc_100A:
        ADD     D ;     Add board control                                    |         100A 04 80                                 add     al, 80h               ; Rescale score (neutral = 80H
        LXI     H,COLOR ;       Color of side just moved                     |         100C A2 D9 09                              mov     [ds:byte_9D9], al
        BIT     7,M ;   Is it white ?                                        |         100F 8B 1E C4 09                           mov     bx, [ds:word_9C4]
        JRNZ    .+4 ;   No - jump                                            |         1013 88 47 05                              mov     [bx+5], al
        NEG ;           Negate for white                                     |         1016 C3                                    retn
        ADI     80H ;   Rescale score (neutral = 80H                         |         1016                       endp            sub_EA8
        STA     VALM ;  Save score
        LIXD    MLPTRJ ;        Load move list pointer
        LDA     MLVAL(X),A ;    Save score in move list
        RET ;           Return










                                           
Cordially.
genfry
Posts: 1
Joined: Tue Mar 14, 2023 10:33 pm

Re:

Post by genfry »

mychess wrote: Tue Apr 21, 2020 7:24 am Hello,

I checked the POINTS routine for Chess88 (evaluation function).
As you can see, it is exactly the same at that of Sargon I.

Code: Select all

;****************************************************************
; POINT EVALUATION ROUTINE
;****************************************************************
; FUNCTION: --      To perform a static board evaluation and
;                   derive a score for a given board position
;
; CALLED BY: --     FNDMOV
;                   EVAL
;
; CALLS: --         ATTACK
;                   XCHNG
;                   LIMIT
;
; ARGUMENTS: --     None
;****************************************************************
POINTS: XRA     A       ; Zero out variables                                 |         0EA8                       proc            sub_EA8 near
        STA     MTRL                                                         |         0EA8 B0 00                                 mov     al, 0
        STA     BRDC                                                         |         0EAA A2 DE 09                              mov     [ds:byte_9DE], al
        STA     PTSL                                                         |         0EAD A2 DA 09                              mov     [ds:byte_9DA], al
        STA     PTSWI                                                        |         0EB0 A2 DB 09                              mov     [ds:byte_9DB], al
        STA     PTSW2                                                        |         0EB3 A2 DC 09                              mov     [ds:byte_9DC], al
        STA     PTSCK                                                        |         0EB6 A2 DD 09                              mov     [ds:byte_9DD], al
        LXI     H,T1    ; Set attacker flag                                  |         0EB9 A2 E1 09                              mov     [ds:byte_9E1], al
        MVI     M,7                                                          |         0EBC C6 06 BA 09 07                        mov     [byte ptr ds:loc_9BA], 7
        MVI     A,21    ; Init to first square on board                      |         0EC1 BB 15 00                              mov     bx, 15h
PT5:    STA     M3      ; Save as board index                                |         0EC4                       loc_EC4:
        LIXD    M3      ; Load board index                                   |         0EC4 89 1E B6 09                           mov     [word ptr ds:loc_9B6], bx
        LDA     A,BOARD(X)      ; Get piece from board                       |         0EC8 8A 87 D1 00                           mov     al, [bx+0D1h]
        CPI     -1      ,Off board edge ?                                    |         0ECC 3C FF                                 cmp     al, 0FFh
        JZ      PT25    ; Yes - jump                                         |         0ECE 75 03                                 jnz     short loc_ED3
        LXI     H,P1    ; Save piece, if any                                 |         0ED0 E9 BD 00                              jmp     loc_F90
        LDA     M,A                                                          |         0ED3                       loc_ED3:
        ANI     7       ; Save piece type, if any                            |         0ED3 8A C8                                 mov     cl, al
        STA     T3                                                           |         0ED5 A2 D0 09                              mov     [ds:byte_9D0], al
        CPI     KNIGHT  ; Less than a Knight (Pawn) ?                        |         0ED8 24 07                                 and     al, 7
        JRC     PT6X    ; Yes - Jump                                         |         0EDA A2 BE 09                              mov     [byte ptr ds:loc_9BE], al
        CPI     ROOK    ; Rook, Queen or King ?                              |         0EDD 3C 01                                 cmp     al, 1                      ; KNIGHT
        JRC     PT6.B   ; No - jump                                          |         0EDF 76 3B                                 jbe     short loc_F1C
        CPI     KING    ; Is it a King ?                                     |         0EE1 3C 04                                 cmp     al, 4                      ; ROOK
        JRZ     PT6AA   ; Yes - jump                                         |         0EE3 72 25                                 jb      short loc_F0A
        LDA     MOVENO  ; Get move number                                    |         0EE5 3C 06                                 cmp     al, 6                      ; KING
        CPI     7       ; Less than 7 ?                                      |         0EE7 74 09                                 jz      short loc_EF2
        JRC     PT6A    ; Yes - Jump                                         |         0EE9 80 3E D4 09 07                        cmp     [ds:byte_9D4], 7
        JMP     PT6X    ; Jump                                               |         0EEE 72 13                                 jb      short loc_F03
PT6AA:  BIT     4,M     ; Castled yet ?                                      |         0EF0 73 11                                 jnb     short loc_F03
        JRZ     PT6A    ; No - jump                                          |         0EF2                       loc_EF2:
        MVI     A,+6    ; Bonus for castling                                 |         0EF2 F6 C1 10                              test    cl, 10h                     ; Castled yet ?
        BIT     7,M     ; Check piece color                                  |         0EF5 74 0C                                 jz      short loc_F03
        JRZ     PT6D    ; Jump if white                                      |         0EF7 B0 06                                 mov     al, 6                       ; Bonus for castling
        MVI     A,-6    ; Bonus for black castling                           |         0EF9 F6 C1 80                              test    cl, 80h
        JMP     PT6D    ; Jump                                               |         0EFC 74 1A                                 jz      short loc_F18
PT6A:   BIT     3,M     ; Has piece moved yet ?                              |         0EFE F6 D8                                 neg     al
        JRZ     PT6X    ; No - jump                                          |         0F00 EB 16                                 jmp     short loc_F18
        JMP     PT6C    ; Jump                                               |         0F02 90                                    db  90h
PT6B:   BIT     3,M     ; Has piece moved yet ?                              |         0F03                       loc_F03:
        JRNZ    PT6X    ; Yes - jump                                         |         0F03 F6 C1 08                              test    cl, 8
PT6C:   MVI     A,-2    ; Two point penalty for white                        |         0F06 74 14                                 jz      short loc_F1C
        BIT     7,M     ; Check piece color                                  |         0F08 75 05                                 jnz     short loc_F0F
        JRZ     .+4     ; Jump if white                                      |         0F0A                       loc_F0A:
        MVI     A,+2    ; Two point penalty for black                        |         0F0A F6 C1 08                              test    cl, 8
PT6D:   LXI     H,BRDC  ; Get address of board control                       |         0F0D 75 0D                                 jnz     short loc_F1C
        ADD     M       ; Add on penalty/bonus points                        |         0F0F                       loc_F0F:
        LDA     M,A     ; Save                                               |         0F0F B0 02                                 mov     al, 2                       ; Two point penalty for white
PT6X:   XRA     A       ; Zero out attack list                               |         0F11 F6 C1 80                              test    cl, 80h                     ; Check piece color
        MVI     B,14                                                         |         0F14 75 02                                 jnz     short loc_F18               ; Jump if white
        LXI     H,ATKLST                                                     |         0F16 F6 D8                                 neg     al                          ; Two point penalty for black
        LDA     M,A                                                          |         0F18                       loc_F18:
        INX     H                                                            |         0F18 00 06 DA 09                           add     [ds:byte_9DA], al
        DJNZ    .-2                                                          |         0F1C                       loc_F1C:
        CALL    ATTACK  ; Build attack list for square                       |         0F1C B0 00                                 mov     al, 0
        LXI     H,BACT  ; Get black attacker count addr                      |         0F1E B9 0E 00                              mov     cx, 0Eh
        LDA     WACT    ; Get white attacker count                           |         0F21 8D 3E 49 01                           lea     di, [byte_149]
        SUB     M       ; Compute count difference                           |         0F25 FC                                    cld
        LXI     H,BRDC  ; Address of board control                           |         0F26 F3 AB                                 rep stosw
        ADD     M       ; Accum board control score                          |         0F28 E8 CD F3                              call    sub_2F8
        LDA     M,A     ; Save                                               |         0F2B A0 49 01                              mov     al, [ds:byte_149]
        LDA     P1      ; Get piece on current square                        |         0F2E 2A 06 57 01                           sub     al, [ds:byte_157]
        ANA     A       ; Is it empty ?                                      |         0F32 00 06 DA 09                           add     [ds:byte_9DA], al
        JZ      PT25    ; Yes - jump                                         |         0F36 80 3E D0 09 00                        cmp     [ds:byte_9D0], 0
        CALL    XCHNG   ; Evaluate exchange, if any                          |         0F3B 74 53                                 jz      short loc_F90
        XRA     A       ; Check for a loss                                   |         0F3D E8 5E 02                              call    sub_119E
        CMP     E       ; Points lost ?                                      |         0F40 80 FA 00                              cmp     dl, 0
        JRZ     PT23    ; No - Jump                                          |         0F43 74 3C                                 jz      short loc_F81
        DCR     D       ; Deduct half a Pawn value                           |         0F45 FE CE                                 dec     dh
        LDA     P1      ; Get piece under attack                             |         0F47 A0 D0 09                              mov     al, [ds:byte_9D0]
        LXI     H,COLOR ; Color of side just moved                           |         0F4A 32 06 CF 09                           xor     al, [ds:byte_9CF]
        XRA     M       ; Compare with piece                                 |         0F4E 78 1C                                 js      short loc_F6C
        BIT     7,A     ; Do colors match ?                                  |         0F50 3A 16 DB 09                           cmp     dl, [ds:byte_9DB]
        LDA     A,E     ; Points lost                                        |         0F54 72 2B                                 jb      short loc_F81
        JRNZ    PT20    ; Jump if no match                                   |         0F56 88 16 DB 09                           mov     [ds:byte_9DB], dl
        LXI     H,PTSL  ; Previous max points lost                           |         0F5A 8B 1E C4 09                           mov     bx, [ds:word_9C4]
        CMP     M       ; Compare to current value                           |         0F5E A0 B6 09                              mov     al, [byte ptr ds:loc_9B6]
        JRC     PT23    ; Jump if greater than                               |         0F61 3A 47 03                              cmp     al, [bx+3]
        LDA     M,E     ; Store new value as max lost                        |         0F64 75 1B                                 jnz     short loc_F81
        LIXD    MLPTRJ  ; Load pointer to this move                          |         0F66 A2 E1 09                              mov     [ds:byte_9E1], al
        LDA     M3      ; Get position of lost piece                         |         0F69 EB 16                                 jmp     short loc_F81
        CMP     MLTOP(X)        ; Is it the one moving ?                     |         0F6B 90                                    db  90h
        JRNZ    PT23    ; No - jump                                          |         0F6C                       loc_F6C:
        STA     PTSCK   ; Save position as a flag                            |         0F6C 8A C2                                 mov     al, dl
        JMP     PT23    ; Jump                                               |         0F6E 3A 06 DC 09                           cmp     al, [ds:byte_9DC]
PT20:   LXI     H,PTSW1 ;       Previous maximum points won                  |         0F72 72 04                                 jb      short loc_F78
        CMP     M ;     Compare to current value                             |         0F74 86 06 DC 09                           xchg    al, [ds:byte_9DC]
        JRC     .+4 ;   Jump if greater than                                 |         0F78                       loc_F78:
        LDA     A,M ;   Load previous max value                              |         0F78 3A 06 DD 09                           cmp     al, [ds:byte_9DD]
        LDA     M,E ;   Store new value as max won                           |         0F7C 72 03                                 jb      short loc_F81
        LXI     H,PTSW2 ;       Previous 2nd max points won                  |         0F7E A2 DD 09                              mov     [ds:byte_9DD], al
        CMP     M ;     Compare to current value                             |         0F81                       loc_F81:
        JRC     PT23 ;  Jump if greater than                                 |         0F81 8A C6                                 mov     al, dh
        LDA     M,A ;   Store as new 2nd max lost                            |         0F83 F6 06 D0 09 80                        test    [ds:byte_9D0], 80h
PT23:   LXI     H,Pl ;  Get piece                                            |         0F88 74 02                                 jz      short loc_F8C
        BIT     7,M ;   Test color                                           |         0F8A F6 D8                                 neg     al
        LDA     A,D ;   Value of piece                                       |         0F8C                       loc_F8C:
        JRZ     .+4 ;   Jump if white                                        |         0F8C 00 06 DE 09                           add     [ds:byte_9DE], al
        NEG ;           Negate for black                                     |         0F90                       loc_F90:
        LXI     H,MTRL ;        Get addrs of material total                  |         0F90 8B 1E B6 09                           mov     bx, [word ptr ds:loc_9B6]
        ADD     M ;     Add new value                                        |         0F94 43                                    inc     bx
        LDA     M,A ;   Store                                                |         0F95 83 FB 63                              cmp     bx, 63h ;           ; At end of board ?
PT25:   LDA     M3 ;    Get current board position                           |         0F98 73 03                                 jnb     short loc_F9D
        INR     A ;     Increment                                            |         0F9A E9 27 FF                              jmp     loc_EC4
        CPI     99 ;    At end of board ?                                    |         0F9D                       loc_F9D:
        JNZ     PT5 ;   No - jump                                            |         0F9D 80 3E E1 09 00                        cmp     [ds:byte_9E1], 0
        LDA     PTSCK ; Moving piece lost flag                               |         0FA2 74 0B                                 jz      short loc_FAF
        ANA     A ;     Was it lost ?                                        |         0FA4 A0 DD 09                              mov     al, [ds:byte_9DD]
        JRZ     PT25A ; No - jump                                            |         0FA7 A2 DC 09                              mov     [ds:byte_9DC], al
        LDA     PTSW2 ; 2nd max points won                                   |         0FAA C6 06 DD 09 00                        mov     [ds:byte_9DD], 0
        STA     PTSW1 ; Store as max points won                              |         0FAF                       loc_FAF:
        XRA     A ;     Zero out 2nd max points won                          |         0FAF A0 DB 09                              mov     al, [ds:byte_9DB]
        STA     PTSW2                                                        |         0FB2 3C 00                                 cmp     al, 0
PT25A:  LDA     PTSL ;  Get max points lost                                  |         0FB4 74 02                                 jz      short loc_FB8
        ANA     A ;     Is it zero ?                                         |         0FB6 FE C8                                 dec     al
        JRZ     .+3 ;   Yes - jump                                           |         0FB8                       loc_FB8:
        DCR     A ;     Decrement it                                         |         0FB8 8A E8                                 mov     ch, al
        LDA     B,A ;   Save it                                              |         0FBA A0 DC 09                              mov     al, [ds:byte_9DC]
        LDA     PTSW1 ; Max,points won                                       |         0FBD 3C 00                                 cmp     al, 0
        ANA     A ;     Is it zero ?                                         |         0FBF 74 0B                                 jz      short loc_FCC
        JRZ     .+11. ; Yes - jump                                           |         0FC1 A0 DD 09                              mov     al, [ds:byte_9DD]
        LDA     PTSW2 ; 2nd max points won                                   |         0FC4 3C 00                                 cmp     al, 0
        ANA     A ;     Is it zero ?                                         |         0FC6 74 04                                 jz      short loc_FCC
        JRZ     .+5 ;   Yes - jump                                           |         0FC8 FE C8                                 dec     al
        DCR     A ;     Decrement it                                         |         0FCA D0 E8                                 shr     al, 1
        SRLR    A ;     Divide it by 2                                       |         0FCC                       loc_FCC:
        SUB     B ;     Subtract points lost                                 |         0FCC 2A C5                                 sub     al, ch
        LXT     9,COLOR ;       Color of side just moved                     |         0FCE F6 06 CF 09 80                        test    [ds:byte_9CF], 80h   ; Is it white ?
        BIT     7,M ;   Is it white ?                                        |         0FD3 74 02                                 jz      short loc_FD7
        JRZ     .+4 ;   Yes - jump                                           |         0FD5 F6 D8                                 neg     al
        NEG ;           Negate for black                                     |         0FD7                       loc_FD7:
        LXI     H,MTRL ;        Net material on board                        |         0FD7 02 06 DE 09                           add     al, [ds:byte_9DE]
        ADD     M ;     Add exchange adjustments                             |         0FDB 2A 06 E0 09                           sub     al, [ds:byte_9E0]
        SUB     M ;     Subtract from current                                |         0FDF B5 1E                                 mov     ch, 1Eh              ; Load material limit
        LDA     B,A ;   Save                                                 |         0FE1 E8 BC FB                              call    near ptr loc_B9F+1   ; Limit to plus or minus value
        MVI     A,30 ;  Load material limit                                  |         0FE4 8A D0                                 mov     dl, al
        CALL    LIMIT ; Limit to plus or minus value                         |         0FE6 A0 DA 09                              mov     al, [ds:byte_9DA]
        LDA     E,A ;   Save limited value                                   |         0FE9 2A 06 DF 09                           sub     al, [ds:byte_9DF]
        LDA     BRDC ;  Get board control points                             |         0FED                       loc_FED:
        LXI     H,BCO ; Board control at ply zero                            |         0FED 80 3E E1 09 00                        cmp     [ds:byte_9E1], 0
        SUB     M ;     Get difference                                       |         0FF2 74 02                                 jz      short loc_FF6
        LDA     B,A ;   Save                                                 |         0FF4 B0 00                                 mov     al, 0
        LDA     PTSCK ; Moving piece lost flag                               |         0FF6                       loc_FF6:
        ANA     A ;     Is it zero ?                                         |         0FF6 B5 06                                 mov     ch, 6                 ; Load board control limit
        JRZ     .+4 ;   Yes - jump                                           |         0FF8 E8 A5 FB                              call    near ptr loc_B9F+1    ; Limit to plus or minus value
        MVI     B,0 ;   Zero board control points                            |         0FFB D0 E2                                 shl     dl, 1
        MVI     A,6 ;   Load board control limit                             |         0FFD D0 E2                                 shl     dl, 1                 ; Multiply by 4
        CALL    LIMIT ; Limit to plus or minus value                         |         0FFF 02 C2                                 add     al, dl
        LDA     D,A ;   Save limited value                                   |         1001 F6 06 CF 09 80                        test    [ds:byte_9CF], 80h    ; Is it white ?
        LDA     A,E ;   Get material points                                  |         1006 75 02                                 jnz     short loc_100A        ; No - jump
        ADD     A ;     Multiply by 4                                        |         1008 F6 D8                                 neg     al                    ; Negate for white
        ADD     A                                                            |         100A                       loc_100A:
        ADD     D ;     Add board control                                    |         100A 04 80                                 add     al, 80h               ; Rescale score (neutral = 80H
        LXI     H,COLOR ;       Color of side just moved                     |         100C A2 D9 09                              mov     [ds:byte_9D9], al
        BIT     7,M ;   Is it white ?                                        |         100F 8B 1E C4 09                           mov     bx, [ds:word_9C4]
        JRNZ    .+4 ;   No - jump                                            |         1013 88 47 05                              mov     [bx+5], al
        NEG ;           Negate for white                                     |         1016 C3                                    retn
        ADI     80H ;   Rescale score (neutral = 80H                         |         1016                       endp            sub_EA8
        STA     VALM ;  Save score
        LIXD    MLPTRJ ;        Load move list pointer
        LDA     MLVAL(X),A ;    Save score in move list
        RET ;           Return










                                           
Cordially.
Hello mychess, do you have a disassembled and commented version of Chess88 and Sargon I for comparison ?
thanks
GB
mychess
Member
Posts: 96
Joined: Tue Jul 31, 2007 8:55 pm

Re: Compilation of XT chess programs

Post by mychess »

Hello genfry,

I don't have the listing of chess88.
For Sargon (ie Sargon 1), a very old listing : https://web.archive.org/web/20070614114 ... argon.html

Cordially.

ps :late answer, I was on a pleasure trip (25000 Km).
User avatar
mclane
Senior Member
Posts: 1600
Joined: Sun Jul 29, 2007 9:04 am
Location: Luenen, germany, US of europe
Contact:

Re: Compilation of XT chess programs

Post by mclane »

What about Mike Chess by Mike Johnson:

https://www.chessprogramming.org/Mike_Johnson

or the later Advance xyz:

https://www.chessprogramming.org/Advance

E.g. Advance 68K that participated in cologne 1986.

Then the tracks of mike Johnson disappeared.

What a pity.

I have so many questions to Mike Johnson.

He did chess champion MK3 and MK4.
And participated championships UNTIL 1986.

A very long time, or ??

How can we contact Mike Johnson, although his name is like a camouflage, before he dies ?!
What seems like a fairy tale today may be reality tomorrow.
Here we have a fairy tale of the day after tomorrow....
Post Reply