-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathSHADOW_PLY.asm
61 lines (45 loc) · 2.32 KB
/
SHADOW_PLY.asm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
; Chess
; Copyright (c) 2019-2020 Andrew Davie
;---------------------------------------------------------------------------------------------------
; Define the RAM banks
; A "PLY" bank represents all the data required on any single ply of the search tree.
; The banks are organised sequentially, PLY_BANKS of them starting at RAMBANK_PLY
; The startup code copies the ROM shadow into each of these PLY banks, and from then on
; they act as independant switchable banks usable for data on each ply during the search.
; A ply will hold the move list for that position
SLOT 3
NEWRAMBANK PLY ; RAM bank for holding the following ROM shadow
REPEAT PLY_BANKS-1
NEWRAMBANK .DUMMY_PLY
REPEND
; and now the ROM shadow - this is copied to ALL of the RAM ply banks
SLOT 3
NEWBANK SHADOW_PLY
;---------------------------------------------------------------------------------------------------
MAX_MOVES =150 ; big is good
VARIABLE MoveFrom, MAX_MOVES
VARIABLE MoveTo, MAX_MOVES
VARIABLE MovePiece, MAX_MOVES
VARIABLE MoveCapture, MAX_MOVES
;---------------------------------------------------------------------------------------------------
; The X12 square at which a pawn CAN be taken en-passant. Normally 0.
; This is set/cleared whenever a move is made. The flag is indicated in the move description.
VARIABLE savedEvaluation, 2 ; THIS node's evaluation - used for reverting moves!
VARIABLE enPassantSquare, 1
VARIABLE capturedPiece, 1
VARIABLE originalPiece, 1
VARIABLE secondaryPiece, 1 ; original piece on secondary (castle, enpassant)
VARIABLE secondarySquare, 1 ; original square of secondary piece
VARIABLE secondaryBlank, 1 ; square to blank on secondary
VARIABLE moveIndex, 1 ; points to first available 'slot' for move storage
VARIABLE movePtr, 1
VARIABLE bestMove, 1
VARIABLE alpha, 2
VARIABLE beta, 2
VARIABLE value, 2
VARIABLE depthLeft, 1
VARIABLE restorePiece, 1
VARIABLE kingSquare, 3 ; traversing squares for castle/check
;---------------------------------------------------------------------------------------------------
; EOF