-
Notifications
You must be signed in to change notification settings - Fork 1
/
phase2.asm
5731 lines (4800 loc) · 115 KB
/
phase2.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
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
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
.286
.MODEL SMALL
.STACK 64
.DATA
rec_msg db ?
exitChat db '- To end chatting press F3$'
invitePlay db 'waiting for player 2 to be Ready to play$'
inviteChat db 'waiting for player 2 to be Ready to chat$'
lastStage db ?
;; bool to exit the chat
exitChat_bool db 0
last1 db ?
last2 db ?
nowPlayer_Chat db ?
player2 db 'player 2','$'
exit db '- To end chatting press F3$'
;Data defing for the UI screen Stage 2
chatMSG db 'To start chatting press F1','$'
startMSG db 'To start the game press F2$'
endMSG db 'To end the program press ESC$'
stage db 0 ;an indication in the UI mode to indicates the user option then switch to it
;0: back to UI window
;1: chat mode
;2: play mode
;3: exit
;Notifications Data;
rr db 80 dup('-'),'$'
;Data defined the mainscreen ;
cur db ?,?
msg db 'Please enter your name:','$'
notValidName db 'Your name must start with character','$'
validName db 'Press Enter Key to continue','$'
wonText db 'Won!!!','$'
user2 db 'ENEMY', '$'
iwon db 'YOU$'
username1 LABEL BYTE
mx_sz db 17
ac_sz db ?
user1 db 15 dup('$')
msg1 db " hello, world! "
pos dw ?
;; row and col are an indiction to thefirst player movement
row db ?
col db ?
rec dw ?
color db ?
base_color db ?
;Size: 20 x 20
arrow_right db 0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,36h,36h,36h,36h,36h,36h,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,36h,36h,36h,36h,36h,36h,36h,36h,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,36h,36h,36h,36h,36h,36h,36h,36h,36h,36h,36h,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,36h,36h,36h,36h,0ffh,0ffh,36h,36h,36h,36h,36h,36h,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,36h,36h,36h,0ffh,0ffh,0ffh,0ffh,36h,36h,36h,36h,36h,36h,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,36h,36h,36h,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,36h,36h,36h,36h,36h,0ffh,0ffh,0ffh
db 0ffh,0ffh,0ffh,36h,36h,36h,36h,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,36h,36h,36h,36h,36h,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,36h,36h,36h,36h,36h,36h,36h,36h,36h,36h,36h,36h,36h,36h,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,36h,36h,36h,36h,36h,36h,36h,36h,36h,36h,36h,36h,36h,36h,0ffh,0ffh,0ffh,0ffh,0ffh,36h,36h,36h,36h,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,36h,36h,36h,36h,36h,0ffh,0ffh,0ffh,0ffh,0ffh,36h,36h,36h,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,36h,36h,36h,36h,36h,36h,0ffh,0ffh,0ffh,0ffh,0ffh,36h,36h,36h,0ffh,0ffh,0ffh,0ffh,36h,36h,36h,36h,36h,36h,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,36h,36h,36h,36h,0ffh,0ffh,36h,36h,36h,36h,36h,36h,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,36h,36h,36h,0ffh,36h,36h,36h,36h,36h,36h,36h,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh
db 0ffh,0ffh,0ffh,36h,36h,36h,36h,36h,36h,36h,36h,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,36h,36h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12h,12h,12h,12h,12h,12h,12h,12h,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,12h,12h,0ffh,12h,12h,12h,12h,12h,12h,0ffh,12h,12h,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,12h,12h,12h,0ffh,0ffh,12h,12h,0ffh,0ffh,12h,12h,12h,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,12h,12h,0ffh,0ffh,12h,12h,0ffh,0ffh,12h,12h,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,12h,12h,12h,12h,12h,12h,12h,12h,12h,12h,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,12h,12h,12h,12h,12h,12h,12h,12h,12h,12h,12h,12h,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,12h,12h,12h,12h,12h,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,12h,12h,12h,12h,12h,0ffh,0ffh,0ffh,0ffh,12h,12h,12h,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,12h,12h,12h,0ffh,0ffh
db 0ffh,12h,12h,12h,12h,12h,12h,12h,12h,12h,12h,12h,12h,12h,12h,12h,12h,12h,12h,0ffh,12h,12h,12h,12h,12h,12h,12h,12h,12h,12h,12h,12h,12h,12h,12h,12h,12h,12h,12h,12h,12h,12h,12h,12h,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,12h,12h,12h,12h,12h,12h,12h,12h,12h,12h,12h,12h,12h,12h,12h,12h,12h,12h,12h,12h,12h,12h,12h,12h
;Size: 20 x 20
black_king db 0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,12h,12h,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0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h,0ffh,0ffh,0ffh,0ffh,12h,12h,12h,12h,12h,12h,12h,12h,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,12h,12h,12h,12h,12h,12h,12h,12h,12h,12h,12h,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,12h,12h,12h,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,12h,12h,12h,0ffh,0ffh,0ffh,0ffh
db 0ffh,0ffh,0ffh,12h,12h,12h,12h,12h,12h,12h,12h,12h,12h,12h,12h,12h,12h,0ffh,0ffh,0ffh,0ffh,0ffh,12h,12h,12h,12h,12h,12h,12h,12h,12h,12h,12h,12h,12h,12h,12h,12h,0ffh,0ffh,0ffh,0ffh,12h,12h,12h,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,12h,12h,12h,0ffh,0ffh,0ffh,0ffh,12h,12h,12h,12h,12h,12h,12h,12h,12h,12h,12h,12h,12h,12h,12h,12h,0ffh,0ffh
;Size: 20 x 20
black_knight db 0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,12h,12h,12h,12h,12h,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,12h,12h,12h,12h,12h,12h,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,12h,12h,12h,12h,0ffh,0ffh,12h,12h,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,12h,12h,12h,0ffh,0ffh,0ffh,12h,12h,12h,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,12h,12h,12h,12h,0ffh,0ffh,0ffh,0ffh,12h,12h,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,12h,12h,12h,12h,12h,0ffh,0ffh,0ffh,0ffh,12h,12h,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,12h,12h,12h,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,12h,12h,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,12h,12h,12h,0ffh,12h,12h,12h,12h,0ffh,0ffh,0ffh,12h,12h,0ffh,0ffh,0ffh,0ffh
db 0ffh,0ffh,0ffh,0ffh,12h,12h,12h,12h,12h,12h,12h,0ffh,0ffh,0ffh,12h,12h,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,12h,12h,12h,12h,12h,12h,12h,0ffh,0ffh,0ffh,12h,12h,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,12h,12h,12h,0ffh,0ffh,0ffh,0ffh,12h,12h,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,12h,12h,12h,0ffh,0ffh,0ffh,0ffh,12h,12h,12h,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,12h,12h,0ffh,0ffh,0ffh,0ffh,0ffh,12h,12h,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,12h,12h,12h,12h,12h,12h,12h,12h,12h,12h,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,12h,12h,12h,12h,12h,12h,12h,12h,12h,12h,12h,12h,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,12h,12h,12h,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,12h,12h,12h,0ffh,0ffh,0ffh,0ffh
db 0ffh,0ffh,0ffh,12h,12h,12h,12h,12h,12h,12h,12h,12h,12h,12h,12h,12h,12h,0ffh,0ffh,0ffh,0ffh,0ffh,12h,12h,12h,12h,12h,12h,12h,12h,12h,12h,12h,12h,12h,12h,12h,12h,0ffh,0ffh,0ffh,0ffh,12h,12h,12h,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,12h,12h,12h,0ffh,0ffh,0ffh,0ffh,12h,12h,12h,12h,12h,12h,12h,12h,12h,12h,12h,12h,12h,12h,12h,12h,0ffh,0ffh
;Size: 20 x 20
black_pawn db 0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,12h,12h,12h,12h,12h,12h,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,12h,12h,12h,12h,12h,12h,12h,12h,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,12h,12h,0ffh,0ffh,0ffh,0ffh,12h,12h,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,12h,12h,0ffh,0ffh,0ffh,0ffh,12h,12h,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,12h,12h,0ffh,0ffh,0ffh,0ffh,12h,12h,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,12h,12h,12h,0ffh,0ffh,12h,12h,12h,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,12h,12h,12h,12h,12h,12h,12h,12h,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,12h,12h,12h,12h,12h,12h,12h,12h,12h,12h,0ffh,0ffh,0ffh,0ffh,0ffh
db 0ffh,0ffh,0ffh,0ffh,0ffh,12h,12h,12h,12h,12h,12h,12h,12h,12h,12h,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,12h,12h,12h,12h,12h,12h,12h,12h,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,12h,12h,0ffh,0ffh,0ffh,0ffh,12h,12h,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,12h,12h,0ffh,0ffh,0ffh,0ffh,12h,12h,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,12h,12h,12h,12h,12h,12h,12h,12h,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,12h,12h,12h,12h,12h,12h,12h,12h,12h,12h,12h,12h,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,12h,12h,12h,12h,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,12h,12h,12h,12h,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,12h,12h,12h,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,12h,12h,12h,0ffh,0ffh,0ffh
db 0ffh,0ffh,12h,12h,12h,12h,12h,12h,12h,12h,12h,12h,12h,12h,12h,12h,12h,12h,0ffh,0ffh,0ffh,12h,12h,12h,12h,12h,12h,12h,12h,12h,12h,12h,12h,12h,12h,12h,12h,12h,12h,0ffh,0ffh,12h,12h,12h,12h,12h,12h,12h,12h,12h,12h,12h,12h,12h,12h,12h,12h,12h,12h,0ffh,0ffh,12h,12h,12h,12h,12h,12h,12h,12h,12h,12h,12h,12h,12h,12h,12h,12h,12h,12h,0ffh
;Size: 20 x 20
black_queen db 0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,12h,12h,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,12h,12h,12h,12h,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh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,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,12h,12h,12h,12h,12h,12h,12h,12h,12h,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,12h,12h,12h,0ffh,0ffh,0ffh,0ffh,12h,12h,12h,0ffh,0ffh,0ffh,0ffh,0ffh
db 0ffh,0ffh,0ffh,0ffh,12h,12h,12h,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,12h,12h,12h,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,12h,12h,12h,12h,12h,12h,12h,12h,12h,12h,12h,12h,12h,12h,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,12h,12h,12h,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,12h,12h,12h,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,12h,12h,12h,12h,12h,12h,12h,12h,12h,12h,12h,12h,12h,12h,0ffh,0ffh,0ffh
;Size: 20 x 20
black_rock db 0ffh,0ffh,0ffh,0ffh,12h,12h,12h,12h,12h,12h,12h,12h,12h,12h,12h,12h,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,12h,12h,12h,12h,12h,12h,12h,12h,12h,12h,12h,12h,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,12h,12h,12h,12h,12h,12h,12h,12h,12h,12h,12h,12h,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,12h,12h,12h,12h,12h,12h,12h,12h,12h,12h,12h,12h,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,12h,12h,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,12h,12h,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,12h,12h,12h,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,12h,12h,12h,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,12h,12h,12h,12h,12h,12h,12h,12h,12h,12h,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,12h,12h,12h,12h,12h,12h,12h,12h,12h,12h,0ffh,0ffh,0ffh,0ffh,0ffh
db 0ffh,0ffh,0ffh,0ffh,0ffh,12h,12h,12h,12h,12h,12h,12h,12h,12h,12h,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,12h,12h,12h,12h,12h,12h,12h,12h,12h,12h,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,12h,12h,0ffh,0ffh,0ffh,0ffh,12h,12h,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,12h,12h,0ffh,0ffh,0ffh,0ffh,12h,12h,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,12h,12h,12h,12h,12h,12h,12h,12h,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,12h,12h,12h,12h,12h,12h,12h,12h,12h,12h,12h,12h,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,12h,12h,12h,12h,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,12h,12h,12h,12h,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,12h,12h,12h,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,0ffh,12h,12h,12h,0ffh,0ffh,0ffh
db 0ffh,0ffh,12h,12h,12h,12h,12h,12h,12h,12h,12h,12h,12h,12h,12h,12h,12h,12h,0ffh,0ffh,0ffh,12h,12h,12h,12h,12h,12h,12h,12h,12h,12h,12h,12h,12h,12h,12h,12h,12h,12h,0ffh,0ffh,12h,12h,12h,12h,12h,12h,12h,12h,12h,12h,12h,12h,12h,12h,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//12->> soldier
chess_board db 1, 2, 3, 5, 4, 3, 2, 1
db 6, 6, 6, 6, 6, 6, 6, 6
db 0, 0, 0, 0, 0, 0, 0, 0
db 0, 0, 0, 0, 0, 0, 0, 0
db 0, 0, 0, 0, 0, 0, 0, 0
db 0, 0, 0, 0, 0, 0, 0, 0
db 12, 12, 12, 12, 12, 12, 12, 12
db 7, 8, 9, 11, 10, 9, 8, 7
chess_board_original db 1, 2, 3, 5, 4, 3, 2, 1
db 6, 6, 6, 6, 6, 6, 6, 6
db 0, 0, 0, 0, 0, 0, 0, 0
db 0, 0, 0, 0, 0, 0, 0, 0
db 0, 0, 0, 0, 0, 0, 0, 0
db 0, 0, 0, 0, 0, 0, 0, 0
db 12, 12, 12, 12, 12, 12, 12, 12
db 7, 8, 9, 11, 10, 9, 8, 7
;; aboTaha game defined data for highlighting
highlighting_color1 db 50h ; player 1: the color of the highlighted cell (to be able to move to).
highlighting_color2 db 60h ; player 2: the color of the highlighted cell (to be able to move to).
highlighting_colorBoth db 40h ;; if a cell is valid for both players it will be highlighted with this color
piece_id db ? ; the clicked piece id
like_me_flag db ? ; used in proc is_it_same
DelX db 1, -1, 0, 0, 1, -1, 1, -1
DelY db 0, 0, 1, -1, 1, 1, -1, -1
; for the knight as it is a special case
DelX2 db -2, -2, 2, 2, 1, 1, -1, -1
DelY2 db -1, 1, -1, 1, -2, 2, -2, 2
IsValid db ? ; 1 if the cell I'm trying to reach is valid and 0 otherwise. used(in proc check_validity)
;; game defined data definition
;; user will first click on one cell
click_flag db 0;; 0 means user didnt click on a cell and
;1 is the first click
; nowRow db ?
; nowCol db ?
nowClick db ?
valid_cells1 db 64 dup (0) ; player 1. 1 if the user can move to this cell, 0 otherwise
valid_cells2 db 64 dup (0) ; player 2. 1 if the user can move to this cell, 0 otherwise
;; selected cell right now
selectedCell_row db ?
selectedCell_col db ?
nowObject db ?
goCell db ?
isLighted_flag db ? ;; this is a flag that solves the bug of inverse_highlight proc that appears when the player tries to move on a highlighteed valid cell
;; refer to inverse_highlight proc for more info
;; 0 not highlighted ,1 is highlighted by player 1 ,2 is lighted by player 2 , 3 is lighted by both players
;; an indication to the second player movement
cursorColor1 db 7
cursorColor2 db 4
click_flag1 db ?
selectedCell_row1 db ?
selectedCell_col1 db ?
nowPlayer db ? ;; indicates the player that is taking a move in this exact time of the processing
;; time handling data
nowSecond db ?
nowMin db ?
;; a timer of every cell in our grid
cellsTimer dw 64 dup (0);;assuming initial state is always zero
nowIndex db ?
canMove_flag db ?
;; Status defined Data
Status_row db 0;; initialy are zeroes as we start drawing from zeroes
Status_col db 8 ;; initial state
Status_gridColor db 6
nowKilled db 0
winner_flag db 0
; flags of checks
whiteking_in_check db 0
blackking_in_check db 0
whiteking_in_checkmate db 0
blackking_in_checkmate db 0
king1Pos dw ?
king2Pos dw ?
;; colors of check and checkmate
check_color db 0Eh
checkMate_color db 4
King1_row db ?
King1_col db ?
King2_row db ?
King2_col db ?
;;UART Defined DATA
rec_bool db ?;; bool that indicates whether i recieved at this moment or not
tra_bool db ?;; bool that indicates if
VALUE db ?;; buffer
;; recieved bytess from second player
row1 db ?
col1 db ?
;; an indication to the action i took and we need to transmit it
TRA_action db ?
REC_action db ?
;; the recieved action from the user
;;inGameChat Data
;; used for dividing the screen
rr1 db 8 dup('-'),'$'
str1 db 'YOU:$'
str2 db 'ME:$'
last1_row db ?
last2_row db ?;;x
last1_col db ?
last2_col db ?;;y
shift db ?
player1_start db 1
player2_start db 13
player1_end db 10
player2_end db 22
last1_back db 1
last2_back db 13
nowChat db -1
inChat_flag db ?
game_flag db ?
go_main db ?
.code
get_username proc
pusha
mov ah,0Ah
mov dx, offset username1
int 21h
popa
ret
get_username endp
CURSOR_getPosition proc
pusha
;; get cursor curition
mov ah,3h
mov bh,0h
int 10h
;; store the current line in cur+1 and the current colummn in cur
mov cur,dl
mov cur+1,dh
popa
ret
CURSOR_getPosition endp
SET_CURSOR PROC
pusha
mov dh,cur+1
mov dl,cur
mov bh,0
mov ah,2
int 10h
popa
ret
SET_CURSOR endp
print_char macro c
pusha
mov ah,2
mov dl,c
int 21h
popa
endm
print macro message
pusha
mov ah,9
mov dx,offset message
int 21h
popa
endm
;; desc : macro to tansfer the index of an array to it's correspinding row and col
; inputs :taks x which is the index
; output: stores the row and col in row and col
get_cellLocation macro x
pusha
mov ax,x
mov bh,8
DIV bh
mov row,al
mov col,ah
popa
endm
GUI_getNowColor proc
pusha
mov dl,selectedCell_row
mov dh,selectedCell_col
mov bh,row
mov selectedCell_row,bh
mov bh,col
mov selectedCell_col,bh
call GUI_getColor
mov selectedCell_row,dl
mov selectedCell_col,dh
popa
ret
GUI_getNowColor endp
;; inputs: c
;; Description: print the char c
;; inputs :NULL
;Descritpion: A proc that checks whether the entered name is valid or not
isValidName proc
pusha
mov ah,user1
cmp ah,'A'
jl wrong
cmp ah,'Z'
jle go
cmp ah,'a'
jl wrong
cmp ah, 'z'
jle go
wrong:
print notValidName
jmp exit1
go:
mov cur+1,20
call SET_CURSOR
print validName
exit1:
popa
ret
isValidName endp
; inputs: NULL
; Description:initializing the main screen to show the main screen to the user
MAINSCREEN_init proc
pusha
;clear screen
again:
mov ax,3
int 10h
print msg
; mov
; pos is x,, pos+1 yy
mov cur,4
mov cur+1,1
call SET_CURSOR
call get_username
inc cur+1
call SET_CURSOR
call isValidName
call CURSOR_getPosition
cmp cur+1,20;if the valid message is printed in isValidName then this would be true else it would be false
je goo
;;wait for user to press ENTER
re3:
mov ah,0
int 16h
cmp ah,28;; scan code of ENTER
jne re3
jmp again
goo:
pusha
re1:
mov ah,0
int 16h
cmp ah,28
jne re1
popa
popa
ret
MAINSCREEN_init endp
;;inputs:NULL
;Descritiion: UI screen responsible to show the interface screen and wait for the user option
UI_init proc
pusha
; clearing the screen
mov ax,3
int 10h
;; printing the messages
mov cur,28
mov cur+1,8
call SET_CURSOR
print chatMSG
mov cur+1,10
call SET_CURSOR
print startMSG
mov cur+1,12
call SET_CURSOR
print endMSG
mov cur,0
mov cur+1,22
call SET_CURSOR
print rr
;; checking for a valid opotion
;; in Phase 2 the next lines will be edited not to move forward to the next stage but wait for user 2 to accept the invite for your option
pusha
re2:
mov ah,0
int 16h
cmp ah,59; scan code of F1
jne conn1
;; delay the user until we recieve the scan code of F1
mov bh,59
mov VALUE,BH
call UART_transmit
mov bh,0
mov cur,bh
mov bh,23
mov cur+1,bh
call SET_CURSOR
print inviteChat
;; check
cmp lastStage,59
jne wait1
mov bh,1
mov stage ,bh
jmp exit2
wait1:
call UART_rec
mov ah,1
int 16h
jz ty
cmp ah,1 ; scan code of ESC
jne ty
mov bh,VALUE
mov lastStage,bh
jmp exit2
ty:
cmp rec_bool,1
je yes
jmp wait1
yes:
cmp VALUE,59
je timeto
mov bh,0
mov rec_bool,bh
jmp wait1
timeto:
mov bh,0
mov rec_bool,bh
mov stage,1
jmp exit2
re4:
jmp re2
conn1:
cmp ah,60 ;scan code of F2
jne conn2
mov bh,60
mov VALUE,bh
call UART_transmit
print invitePlay
cmp lastStage,2
jne wait2
mov bh,2
mov stage,2
jmp exit2
wait2:
call UART_rec
mov ah,1
int 16h
jz ty1
cmp ah,1
jne ty1
mov bh,VALUE
mov lastStage,bh
jmp exit2
ty1:
cmp rec_bool,1
je yes1
jmp wait2
yes1:
cmp VALUE,60
je timeto1
mov bh,0
mov rec_bool,bh
jmp wait2
timeto1:
mov bh,0
mov rec_bool,bh
mov stage,2
jmp exit2
conn2:
exit2:
mov bh,0
mov rec_bool,bh
popa
popa
ret
UI_init endp
; inputs::NULL
;;Description:: proc to clear player 1 screen , used when player 1 chat space is full
;;This is used only in chat room
PLAYER1_clearScreen proc
pusha
pusha
mov ax,0600h
mov cl,0
mov bh,07
mov ch,2
mov dx,0B4FH
int 10h
popa
;;
mov cur,bh
mov cur+1,2
mov last1,2
call SET_CURSOR
popa
ret
PLAYER1_clearScreen endp
; inputs::NULL
;;Description:: proc to clear player 2 screen , used when player 2 chat space is full
;;This is used only in chat room
PLAYER2_clearScreen proc
pusha
pusha
mov ax,0600h
mov cl,0
mov bh,07
mov ch,14
mov dx,164FH
int 10h
popa
;;
mov cur,bh
mov cur+1,14
mov last2,14
call SET_CURSOR
popa
ret
PLAYER2_clearScreen endp
print_char macro c
pusha
mov ah,2
mov dl,c
int 21h
popa
endm
print macro message
pusha
mov ah,9
mov dx,offset message
int 21h
popa
endm
;;UART MODULE
;; uart is used with 9600 divisor
;; proc that initalzie the UART
UART_init proc
pusha
; initinalize COM
;Set Divisor Latch Access Bit
mov dx,3fbh ; Line Control Register
mov al,10000000b ;Set Divisor Latch Access Bit
out dx,al ;Out it
;Set LSB byte of the Baud Rate Divisor Latch register.
mov dx,3f8h
mov al,0ch
out dx,al
;Set MSB byte of the Baud Rate Divisor Latch register.
mov dx,3f9h
mov al,00h
out dx,al
;; we are working with 9600 Baud rate
;Set port configuration
mov dx,3fbh
mov al,00011011b
out dx,al
popa
ret
UART_init endp
;;
;; UART Polling mode
;; this proc takes
UART_transmit proc
pusha
mov bh,0
mov tra_bool,bh
transmit:
mov dx , 3FDH ; Line Status Register
In al , dx ;Read Line Status
AND al , 00100000b
jz transmit
ex1:
mov tra_bool,1;indication
;; transmitting the data
mov dx , 3F8H ; Transmit data register
mov al,VALUE
out dx , al
;; transmitting is done
popa
ret
UART_transmit endp
;; when reieving we are not using polling mode
;; we know if there is data is recieved using the rec_bool
UART_rec proc
pusha
mov bh,0
mov rec_bool,bh
;Check that Data Ready
mov dx , 3FDH ; Line Status Register
in al , dx
AND al , 1
jz ex5
; ;If Ready read the VALUE in Receive data register
mov bh,1
mov rec_bool,bh
mov dx ,03F8H
in al,dx
mov VALUE,al
jmp ex2
ex5:
mov bl ,0
mov rec_bool,bl
mov bh,-1
mov VALUE,bh
ex2:
popa
ret
UART_rec endp
; ;If empty put the VALUE in Transmit data register
; mov dx , 3F8H ; Transmit data register
; mov al,"A"
; out dx , al
; ;If Ready read the VALUE in Receive data register
; mov dx , 03F8H
; in al , dx
; mov VALUE , al
;; CHAT MODULE
CHAT_init proc
pusha
; clearing the screen
mov ax,3
int 10h
mov bh,0
mov exitChat_bool,bh
mov bh,player1_start
mov last1_row,bh
mov bh,0
mov cur,bh
mov bh,player2_start
mov last2_row,bh
mov bh,11
mov cur+1,bh
call SET_CURSOR
print rr
print str1
print ':'
mov bh,0
mov cur,bh
mov cur+1,bh
call SET_CURSOR
print str2
mov bh,0
mov cur,bh
mov bh,23
mov cur+1,bh
call SET_CURSOR
print rr
mov bh,0
mov cur,bh
mov bh,24
mov cur+1,bh
print exitChat
mov tra_bool,bh
mov rec_bool,bh
mov bh,3
mov shift,bh
mov last1_col,bh
mov last2_col,bh
popa
ret
CHAT_init endp
CHAT_printRecieved proc
pusha
;; check is something meant to be recieved
call UART_rec
cmp rec_bool,1
jne lz1
; ;If Ready read the VALUE in Receive data register
; pusha
; mov dx , 03F8H
; in al , dx
; mov VALUE , al
mov rec_bool,0
mov bh,last2_col
mov cur,bh
mov bh,last2_row
mov cur+1,bh
call SET_CURSOR
;; exit logic
cmp VALUE,0
jne enterz
mov bh,1
mov exitChat_bool,bh
jmp lz1
enterz: ;; enter logic
cmp VALUE,13
jne backspace2
mov bh,cur+1
inc bh
mov cur+1,bh
mov bh,player2_end
cmp cur+1,bh
jne reg2
call CHAT_player2Clear
mov bh,player2_start
mov last2_back,bh
lz1:
jmp nochat
reg2:
mov bh,shift
cmp cur,bh
je nostore2
mov bh,cur+1
mov last2_back,bh
nostore2:
mov bh,shift
mov last2_col,bh
mov cur,bh
mov bh,cur+1
mov last2_row,bh
call SET_CURSOR
jmp nochat
backspace2:
cmp VALUE,8
jne Rec__
cmp cur,0
je cv2
mov bh,shift
cmp cur,bh
jne ad2
cv2:
mov bh,last2_back
cmp cur+1,bh
je nochat
cmp cur,0
jne ad2
mov bh,79
mov cur,bh
mov last2_col,bh
mov bh,cur+1
dec bh
mov cur+1,bh
mov last2_row,bh
jmp bd2
ad2:
mov bh,cur
dec bh
mov cur,bh
mov last2_col,bh
bd2:
call SET_CURSOR
print_char 0
call SET_CURSOR
jmp nochat
Rec__:
call CURSOR_getPosition
mov bh,player2_end
cmp cur+1,bh
jne avdd2
cmp cur,79
jne avdd2
call CHAT_player2Clear
avdd2:
print_char VALUE
call CURSOR_getPosition
mov bh,cur
mov last2_col,bh
mov bh,cur+1
mov last2_row,bh
nochat:
popa
ret
CHAT_printRecieved endp
CHAT_sendChat proc
pusha
;; reset cursor to my side
mov bh,last1_col
mov cur,bh
mov bh,last1_row
mov cur+1,bh
call SET_CURSOR
mov ah,1
int 16h
jz ki4
;; checking bug keys and exit F3
cmp ah,72;; scan code of up arrow
je ki4
cmp ah,75;; scan code of left arrow
je ki4
cmp ah,77;;scan code of right
je ki4
cmp ah,80;;scan code of down
je ki4
cmp ah,59;; scan code of F1
je ki4
cmp ah,60;; scan code of F2
je ki
;; checking if it is F3 key is pressed
cmp ah,61
jne F4
mov bh,1
mov exitChat_bool,bh
mov bh,0
mov VALUE,bh
call UART_transmit
jmp ki
F4:
cmp ah,62;; scan code of F4
je ki
cmp ah,63;; scan code of F5
je ki
cmp ah,64;; scan code of F6
je ki
cmp ah,65;; scan code of F7
je ki
cmp ah,66;; scan code of F8
je ki
cmp ah,67;; scan code of F9
je ki
cmp ah,68;; scan code of F10
je ki
cmp ah,133;; scan code of F11
je ki
cmp ah,134;; scan code of F12
je ki
cmp ah,83;; scan code of del
je ki
;; checking if we reached the limit of any player
;; assuming its player 1
call CURSOR_getPosition