1: .globl _wmove, _wremove 2: .globl _board, _pval, _amp, _flag, _eppos, _value, _wkpos 3: .globl _game 4: 5: _wmove: 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: bge error 28: jmp *0f(r0) / type of man 29: kmove 30: qmove 31: rmove 32: bmove 33: nmove 34: pmove 35: 0: 36: error: 37: 3 38: 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-16.(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: sub $8,r2 57: mov r2,_eppos 58: br move 59: 1: 60: cmp r3,$24.*2 61: bge move 62: sub $25.,_value 63: cmp r3,$16.*2 64: bge move 65: sub $50.,_value 66: cmp r3,$8.*2 / queen promotion 67: bge move 68: sub $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*63. 76: bne 1f 77: bic $1,_flag 78: br move 79: 1: 80: cmp r2,$2*56. 81: bne move 82: bic $2,_flag 83: br move 84: 85: kmove: 86: asr r3 87: mov r3,_wkpos 88: bic $3,_flag 89: cmp r2,$2*60. 90: bne 2f 91: cmp r3,$62. / kingside castle 92: bne 1f 93: dec _value 94: mov $-4,_board+[2*61.] 95: clr _board+[2*63.] 96: mov $2,(r4)+ 97: mov r4,_amp 98: rts pc 99: 1: 100: cmp r3,$58. / queenside castle 101: bne 2f 102: dec _value 103: mov $-4,_board+[2*59.] 104: clr _board+[2*56.] 105: mov $3,(r4)+ 106: mov r4,_amp 107: rts pc 108: 2: / king move 109: tst _game 110: bne 1f 111: add $2,_value 112: 1: 113: clr (r4)+ 114: mov r4,_amp 115: rts pc 116: 117: qmove: 118: tst _game 119: bne move 120: inc _value 121: br move 122: 123: nmove: 124: bmove: 125: move: 126: mov $1,(r4)+ 127: mov r4,_amp 128: rts pc 129: 130: _wremove: 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,_wkpos 157: 158: movex: 159: rts pc 160: 161: moveo: 162: mov $-4,_board+[2*63.] 163: clr _board+[2*61.] 164: mov $60.,_wkpos 165: rts pc 166: 167: moveoo: 168: mov $-4,_board+[2*56.] 169: clr _board+[2*59.] 170: mov $60.,_wkpos; 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