zxGammon

ram.asm

The engine's work area. Download · All the source

; ------------------------------------------------------------------ RAM; The work area: $1900 bytes from WORK, which the includer sets (a page; boundary). WORK+$400 to +$7ff is free for the caller.W       equ WORK+$0000       ; the move generator's boardROOT    equ WORK+$0040       ; the position to play fromROOT2   equ WORK+$0080       ; the opponent's position, replyingCAND    equ WORK+$00c0       ; a candidate play's positionPA      equ WORK+$0100       ; a position being scored: PA on rollPB      equ WORK+$0120RESULT  equ WORK+$0140       ; the chosen play's positionSTEPS   equ WORK+$0200       ; per step of the play being generated: point, hitGDIE    equ WORK+$0210       ; the die of each stepKEY     equ WORK+$0220       ; a play's hashNEWKEY  equ WORK+$0230       ; a play for a list: key (5), steps (8)NEWSTEPS equ NEWKEY+5WINSTEPS equ WORK+$0240      ; a play bearing off the last checkerVARS    equ WORK+$0280       ; single variables (below)HSTAMP  equ WORK+$1800       ; plays of a non-double generated: a stamp, then                        ; their hash's 4 bytes a page eachRTAB    equ WORK+$0800       ; hash values: 51 of 4 bytesNST     equ WORK+$0340       ; PA/PB's inputs beyond the points (as a base's)FEAT    equ WORK+$0350       ; PA/PB's gnubg features (at a base's offset)ECACHE  equ WORK+$03a0       ; each half's points held, and escapes from themSUMS    equ WORK+$0900       ; a net's first-layer sums (lo, hi)RB_FILTER equ WORK+$0a00     ; the nets' bases, a page eachRB_RACE equ WORK+$0b00RB_REPLY equ WORK+$0c00RB_CONTACT equ WORK+$0d00SIDEX   equ WORK+$1210       ; features: the side, with zeros aroundSIDEY   equ WORK+$1250       ; and its opponentBX      equ WORK+$1290       ; their points held (two or more), 0 or 1BY      equ WORK+$12d0SHOTP   equ WORK+$1300       ; shots: page ofTB      equ WORK+$1300       ; blots to hit, by the hitter's indexEL      equ WORK+$1340       ; points that may hitYB      equ WORK+$1380       ; opponent's points held, by the hitter's indexDK      equ WORK+$13c0       ; direct shot per die: the highest hitterDM      equ WORK+$13c8       ; and how many hit (1, 2)TOP12   equ WORK+$1400       ; lists of plays: count, capacity, then 16 eachTOP2    equ WORK+$1500TOP5    equ WORK+$1600TOP1    equ WORK+$1700WORKEND equ WORK+$1900       ; the end of what init clearsWORKTOP equ WORK+$1d00       ; the end of all the engine uses (HSTAMP's pages); Variables.GROOT   equ VARS+0      ; the board being generated from (2)GCOUNT  equ VARS+2      ; plays generated (2)GSP     equ VARS+4      ; the stack to leave the search with (2)LEAFFN  equ VARS+6      ; the move generator's handler of a play (2)USERFN  equ VARS+8      ; the caller's (2)GTARGET equ VARS+10GMAX    equ VARS+11GEMIT   equ VARS+12GDOUBLE equ VARS+13GMAXA   equ VARS+14GENID   equ VARS+15     ; the move generator's search numberDHI     equ VARS+16     ; the dice, larger firstDLO     equ VARS+17WIN     equ VARS+18     ; a play bearing off the last checker was seenCURLIST equ VARS+19     ; the list plays go into (2)CURIDX  equ VARS+21     ; a play's place in generation order (2)RES     equ VARS+23     ; a net's score (3)NETK    equ VARS+26     ; rows added to the sums, net (2)NETD    equ VARS+28W2P     equ VARS+29     ; (2)TOTAL   equ VARS+31     ; a candidate's sum over the rolls (4)BEST    equ VARS+35     ; (4)BESTI   equ VARS+39RA      equ VARS+40RB      equ VARS+41CANDI   equ VARS+42T1      equ VARS+44     ; features' scratch (2 each)T2      equ VARS+46T3      equ VARS+48T7      equ VARS+50T4      equ VARS+52T5      equ VARS+53TM      equ VARS+54TA      equ VARS+55TP      equ VARS+56TI      equ VARS+57TX      equ VARS+58HYI     equ VARS+59NOB     equ VARS+60MINA    equ VARS+61MINC    equ VARS+62SNP     equ VARS+63     ; shots: pips (2)SN1     equ VARS+65SN2     equ VARS+66SSTART  equ VARS+67RNCH    equ VARS+68RNP     equ VARS+69RNEED   equ VARS+70RD      equ VARS+71RD1     equ VARS+72RK0     equ VARS+73OFFN    equ VARS+74OFFANY  equ VARS+75OFFS    equ VARS+76     ; (3)ESCA    equ VARS+79PHAND   equ VARS+80     ; (2)DHAND   equ VARS+82     ; (2)SCORER  equ VARS+84     ; a list's second stage (2)LISTP   equ VARS+86     ; (2)RPAGE   equ VARS+88     ; the page of the net's baseSIDE    equ VARS+89PTOLD   equ VARS+90PTNEW   equ VARS+91FSCORE  equ VARS+92     ; the filter's score of W turned (2)FHIT    equ VARS+94FDIE    equ VARS+95ROWB    equ VARS+96     ; a point's first row (2)UD      equ VARS+98     ; a point's inputs' changes (4)WINPOSS equ VARS+102    ; a play may bear off the last checkerBARM    equ VARS+103    ; shots: not two or more on the barSPSAVE  equ VARS+104    ; (2)GKEYED  equ VARS+106    ; plays hashedGPRUNE  equ VARS+107    ; second-order plays repeating the first skippedPLYBY   equ VARS+108    ; the lookahead's replies chosen by the contact netBLIST   equ SHOTP+$d0   ; blots to hit, highest first, then $ffOPPOFF  equ 32