-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathh.txt
250 lines (249 loc) · 4.32 KB
/
h.txt
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
checkKing1Message db "Check White King!$"
checkKing2Message db "Check Black King!$"
mov ax, code
cmp ax, 1
jne checkWRook
mov ah, toRow
mov al, toColumn
mov row, ah
mov col, al
mov PNO, 1
call HighlightAvailableForWPawnToEat
mov bx, 0
lpavailWPawn:
mov al, availMoves[bx]
cmp al, 16
je checkKing2
inc bx
cmp bx, 64
jl lpavailWPawn
resetavailmoves
jmp noMove
checkWRook:
cmp ax, 2
jne checkWKnight
mov ah, toRow
mov al, toColumn
mov row, ah
mov col, al
mov PNO, 1
call rookMoves
mov bx, 0
lpavailWRook:
mov al, availMoves[bx]
cmp al, 16
je checkKing2
inc bx
cmp bx, 64
jl lpavailWRook
resetavailmoves
jmp noMove
checkWKnight:
cmp ax, 3
jne checkWBishop
mov ah, toRow
mov al, toColumn
mov row, ah
mov col, al
mov PNO, 1
call HighlightAvailableForWKnight
mov bx, 0
lpavailWKnight:
mov al, availMoves[bx]
cmp al, 16
je checkKing2
inc bx
cmp bx, 64
jl lpavailWKnight
resetavailmoves
jmp noMove
checkWBishop:
cmp ax, 4
jne checkWQueen
mov ah, toRow
mov al, toColumn
mov row, ah
mov col, al
mov PNO, 1
call bishopMoves
mov bx, 0
lpavailWBishop:
mov al, availMoves[bx]
cmp al, 16
je checkKing2
inc bx
cmp bx, 64
jl lpavailWBishop
resetavailmoves
jmp noMove
checkWQueen:
cmp ax, 5
jne checkWKing
mov ah, toRow
mov al, toColumn
mov row, ah
mov col, al
mov PNO, 1
call queenMoves
mov bx, 0
lpavailWQueen:
mov al, availMoves[bx]
cmp al, 16
je checkKing2
inc bx
cmp bx, 64
jl lpavailWQueen
resetavailmoves
jmp noMove
checkWKing:
cmp ax, 6
jne checkBPawn
mov ah, toRow
mov al, toColumn
mov row, ah
mov col, al
mov PNO, 1
call HighlightAvailableForWKing
mov bx, 0
lpavailWKing:
mov al, availMoves[bx]
cmp al, 16
je checkKing2
inc bx
cmp bx, 64
jl lpavailWKing
resetavailmoves
jmp noMove
checkBPawn:
cmp ax, 11
jne checkBRook
mov ah, toRow
mov al, toColumn
mov row, ah
mov col, al
mov PNO, 0
call HighlightAvailableForBPawnToEat
mov bx, 0
lpavailBPawn:
mov al, availMoves2[bx]
cmp al, 6
je checkKing1
inc bx
cmp bx, 64
jl lpavailBPawn
resetavailmoves2
jmp noMove
checkBRook:
cmp ax, 12
jne checkBKnight
mov ah, toRow
mov al, toColumn
mov row, ah
mov col, al
mov PNO, 0
call rookMoves
mov bx, 0
lpavailBRook:
mov al, availMoves2[bx]
cmp al, 6
je checkKing1
inc bx
cmp bx, 64
jl lpavailBRook
resetavailmoves2
jmp noMove
checkBKnight:
cmp ax, 13
jne checkBBishop
mov ah, toRow
mov al, toColumn
mov row, ah
mov col, al
mov PNO, 0
call HighlightAvailableForBKnight
mov bx, 0
lpavailBKnight:
mov al, availMoves2[bx]
cmp al, 6
je checkKing1
inc bx
cmp bx, 64
jl lpavailBKnight
resetavailmoves2
jmp noMove
checkBBishop:
cmp ax, 14
jne checkBQueen
mov ah, toRow
mov al, toColumn
mov row, ah
mov col, al
mov PNO, 0
call bishopMoves
mov bx, 0
lpavailBBishop:
mov al, availMoves2[bx]
cmp al, 6
je checkKing1
inc bx
cmp bx, 64
jl lpavailBBishop
resetavailmoves2
jmp noMove
checkBQueen:
cmp ax, 15
jne checkBKing
mov ah, toRow
mov al, toColumn
mov row, ah
mov col, al
mov PNO, 0
call queenMoves
mov bx, 0
lpavailBQueen:
mov al, availMoves2[bx]
cmp al, 6
je checkKing1
inc bx
cmp bx, 64
jl lpavailBQueen
resetavailmoves2
jmp noMove
checkBKing:
cmp ax, 16
jne noMove
mov ah, toRow
mov al, toColumn
mov row, ah
mov col, al
mov PNO, 0
call HighlightAvailableForBKing
mov bx, 0
lpavailBKing:
mov al, availMoves2[bx]
cmp al, 6
je checkKing1
inc bx
cmp bx, 64
jl lpavailBKing
resetavailmoves2
jmp noMove
checkKing1:
mov dx, offset checkKing1Message
mov ah, 9
int 21h
mov cx, 0fh
mov dx, 4240h
mov ah, 86h
int 15h
jmp noMove
checkKing2:
resetavailmoves
mov dx, offset checkKing2Message
mov ah, 9
int 21h
mov cx, 0fh
mov dx, 4240h
mov ah, 86h
int 15h
jmp noMove