1: .globl _bmove, _bremove 2: .globl _board, _pval, _amp, _flag, _eppos, _value, _bkpos 3: .globl _game 4: 5: _bmove: 6: mov _amp,r4 7: movb 2(sp),r3 / to 8: movb 3(sp),r2 / from 9: mov _value,(r4)+ 10: mov _flag,(r4)+ 11: mov _eppos,(r4)+ 12: mov r2,(r4)+ 13: mov r3,(r4)+ 14: asl r2 / from as a word index 15: asl r3 / to as word index 16: mov _board(r3),r0 17: mov r0,(r4)+ 18: beq 1f 19: asl r0 20: sub _pval+12.(r0),_value 21: 1: 22: mov _board(r2),r0 23: mov r0,_board(r3) 24: clr _board(r2) 25: mov $-1,_eppos 26: asl r0 27: ble error 28: jmp *0f-2(r0) / type of man 29: 0: 30: pmove 31: nmove 32: bmove 33: rmove 34: qmove 35: kmove 36: 37: error: 38: 3 39: 40: pmove: 41: sub r3,r2 42: bge 1f 43: neg r2 44: 1: 45: cmp r2,$2*1 / ep capture 46: bne 1f 47: clr _board(r3) 48: mov $1,_board+[2*8.](r3) 49: mov $4,(r4)+ 50: mov r4,_amp 51: rts pc 52: 1: 53: cmp r2,$2*16. / double move 54: bne 1f 55: movb 3(sp),r2 56: add $8,r2 57: mov r2,_eppos 58: br move 59: 1: 60: cmp r3,$40.*2 61: blt move 62: add $25.,_value 63: cmp r3,$48.*2 64: blt move 65: add $50.,_value 66: cmp r3,$56.*2 / queen promotion 67: blt move 68: add $625.,_value 69: mov $5,_board(r3) 70: mov $5,(r4)+ 71: mov r4,_amp 72: rts pc 73: 74: rmove: 75: cmp r2,$2*7. 76: bne 1f 77: bic $10,_flag 78: br move 79: 1: 80: tst r2 81: bne move 82: bic $20,_flag 83: br move 84: 85: kmove: 86: asr r3 87: mov r3,_bkpos 88: bic $30,_flag 89: cmp r2,$2*4. 90: bne 2f 91: cmp r3,$6 / kingside castle 92: bne 1f 93: inc _value 94: mov $4,_board+[2*5.] 95: clr _board+[2*7.] 96: mov $2,(r4)+ 97: mov r4,_amp 98: rts pc 99: 1: 100: cmp r3,$2 / queenside castle 101: bne 2f 102: inc _value 103: mov $4,_board+[2*3.] 104: clr _board+[2*0.] 105: mov $3,(r4)+ 106: mov r4,_amp 107: rts pc 108: 2: / king move 109: tst _game 110: bne 1f 111: sub $2,_value 112: 1: 113: clr (r4)+ 114: mov r4,_amp 115: rts pc 116: 117: qmove: 118: tst _game 119: bne move 120: dec _value 121: br move 122: 123: nmove: 124: bmove: 125: move: 126: mov $1,(r4)+ 127: mov r4,_amp 128: rts pc 129: 130: _bremove: 131: mov _amp,r4 132: mov -(r4),r0 133: mov -(r4),r1 134: mov -(r4),r3 135: mov -(r4),r2 136: mov -(r4),_eppos 137: mov -(r4),_flag 138: mov -(r4),_value 139: mov r4,_amp 140: asl r2 141: asl r3 142: mov _board(r3),_board(r2) 143: mov r1,_board(r3) 144: asl r0 145: jmp *0f(r0) 146: 0: 147: movek 148: movex 149: moveo 150: moveoo 151: movep 152: moveq 153: 154: movek: 155: asr r2 156: mov r2,_bkpos 157: 158: movex: 159: rts pc 160: 161: moveo: 162: mov $4,_board+[2*7.] 163: clr _board+[2*5] 164: mov $4,_bkpos 165: rts pc 166: 167: moveoo: 168: mov $4,_board+[2*0] 169: clr _board+[2*3] 170: mov $4,_bkpos; 171: rts pc 172: 173: movep: 174: mov $1,_board(r2) 175: clr _board+[2*8.](r3) 176: rts pc 177: 178: moveq: 179: mov $1,_board(r2) 180: rts pc