-
Notifications
You must be signed in to change notification settings - Fork 1
/
main.asm
1107 lines (873 loc) · 19.6 KB
/
main.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
;AUTHOR : SHEHAB KHALED
;---------------------------------------
.MODEL SMALL
.STACK 32
.286
;---------------------------------------
.DATA
include const.inc
include cars.inc
include img.inc
include data.inc
;ADDRESS VECTOR FOR INTERRUPTS
INT09_BX DW ?
INT09_ES DW ?
;KEYBOARD BUFFERS
KeyList db 128 dup(0)
;AUX VARIABLES
AUX_IMAGE_WIDTH dw ?
AUX_IMAGE_HEIGHT dw ?
START_ROW dw ?
FiveSecondsCount DB 0
SECONDS DB 0
;GENERAL FILES
file_buffer db 20000 dup(?)
;validate names
;---------------------------------------
.code
include files.inc ;File and image handling
include UI.inc ;UI
include keyboard.inc ;FOR KEYBOARD CONFIGURATION
include loadCars.inc
include grid.inc
include loop_m.inc
MAIN PROC FAR
MOV AX,@DATA
MOV DS,AX
; ;SET VIDEO MODE
MOV AX,VIDEO_MODE
MOV BX,VIDEO_MODE_BX
INT 10H
CALL Generate
BEGIN:
call setBackgroundColor
;WELCOME PAGE
call loadLogo
call drawWelcomePage
call clearUnderOwl
call drawpPlayerInfo
; call getInfo
call getplayer1name
call setBackgroundColor
;WELCOME PAGE
call loadLogo
call drawWelcomePage
call WaitSomeTime
call WaitSomeTime
call getplayer2name
call WaitSomeTime
mainmenu:
call setBackgroundColor
;WELCOME PAGE
call loadLogo
call drawWelcomePage
;TAKE KEY FROM USER
CHK_KEY:
;MOV AH,0
;INT 16H
;CMP AH,F1
;JE CHAT
;CMP AH,EscKey
;JE CLOSE
;CMP AH,EnterKey
;JNE CHK_KEY
;jmp Names
chat:
mov bypassMenuLoop,0
;call displaychat
call inviteToChat
cmp bypassMenuLoop,0
jz mainmenu
;ENTER NAMES
Names:
;To display the names
; mov ah, 9
; mov dx, offset player1_name + 2
; int 21h
; mov ah, 9
; mov dx, offset player2_name + 2
; int 21h
;CHOOSE CHARACTER
CHOOSE_LBL:
CALL loadSmallOwl
MOV BX, owl_current_row
CALL drawPage
CALL Choose
; TAKE CHARACTERS AND STORE THEM
call setBackgroundColor
;START THE GAME
; call ConfigKeyboard
CALL SetConfig
mov end_now,0
call MAIN_LOOP
call wait5sec
CALL ResetKeyboard
JMP mainmenu
HLT
CLOSE:
MOV AH,4CH
INT 21H
MAIN ENDP
getplayer1name proc
; CHECK_PLAYER1_NAME:
namegetting:
mov dh, player1_y/CharHeight + 2 ;ROW
mov dl, player1_x/CharWidth ;COLUMN
mov bh, 0 ; Page = 0
mov bl, BackgroundColor
mov ah, 02h ; BIOS.SetCursorPosition
int 10h
mov cx,0
mov bx, offset player1_name+2
mov di,offset player2_name+2
namelop:
mov ah,1
int 21h
cmp al,0dh
je doneee
mov byte ptr [bx],al
add bx,1
inc cx
cmp cx,15
jne namelop
doneee:
mov player1_name+1,cl
cmp cx,0
jne nameexist
call emptyNameMsg
call clear_input1
wait_for_Enterr1:
MOV AH, 0
INT 16H
CMP AH, EnterKey
JNE wait_for_Enterr1
call clear_warnings
JMP namegetting
nameexist:
; CHECK_first_characterr:
MOV AL, player1_name + 2
CMP AL, UPPERCASE_MIN_ASCII
JB INVALIDname
CMP AL, LOWERCASE_MAX_ASCII
JA INVALIDname
CMP AL, UPPERCASE_MAX_ASCII
JA CHECKk_IF_LESS_97
JMP safename
CHECKk_IF_LESS_97:
CMP AL, LOWERCASE_MIN_ASCII
JB INVALID_NAME
JMP safename
INVALIDname:
call clear_input1
Call invalid_Msg
wait_for_Enter_:
MOV AH, 0
INT 16H
CMP AH, EnterKey
JNE wait_for_Enter_
call clear_warnings
JMP namegetting
safename:
ret
getplayer1name endp
getInfo PROC
;PLAYER 1 NAME
CHECK_PLAYER1_NAME:
mov dh, player1_y/CharHeight + 2 ;ROW
mov dl, player1_x/CharWidth ;COLUMN
mov bh, 0 ; Page = 0
mov bl, BackgroundColor
mov ah, 02h ; BIOS.SetCursorPosition
int 10h
mov ah, 0AH
mov dx, offset player1_name
int 21h
MOV AL, player1_name + 1
CMP AL, 0
JNE CHECK_first_character
call emptyNameMsg
call clear_input1
wait_for_Enterr:
MOV AH, 0
INT 16H
CMP AH, EnterKey
JNE wait_for_Enterr
call clear_warnings
JMP CHECK_PLAYER1_NAME
CHECK_first_character:
MOV AL, player1_name + 2
CMP AL, UPPERCASE_MIN_ASCII
JB INVALID_NAME
CMP AL, LOWERCASE_MAX_ASCII
JA INVALID_NAME
CMP AL, UPPERCASE_MAX_ASCII
JA CHECK_IF_LESS_97
JMP CHECK_PLAYER2_name
CHECK_IF_LESS_97:
CMP AL, LOWERCASE_MIN_ASCII
JB INVALID_NAME
JMP CHECK_PLAYER2_name
INVALID_NAME:
call clear_input1
Call invalid_Msg
wait_for_Enter:
MOV AH, 0
INT 16H
CMP AH, EnterKey
JNE wait_for_Enter
call clear_warnings
JMP CHECK_PLAYER1_NAME
;PLAYER 2 NAME
CHECK_PLAYER2_name:
; mov dh, player2_y/CharHeight + 2 ;ROW
; mov dl, player2_x/CharWidth ;COLUMN
; mov bh, 0 ;Page = 0
; mov bl, BackgroundColor
; mov ah, 02h ;BIOS.SetCursorPosition
; int 10h
; ;take input form the user
; mov ah, 0AH
; mov dx, offset player2_name
; int 21h
; MOV AL, player2_name + 1
; CMP AL, 0
; JNE CHECK_first_character2
; call clear_input2
; call emptyNameMsg
; wait_for_Enterr2:
; MOV AH, 0
; INT 16H
; CMP AH, EnterKey
; JNE wait_for_Enterr2
; call clear_warnings
; JMP CHECK_PLAYER2_NAME
; CHECK_first_character2:
; MOV AL, player2_name + 2
; CMP AL, UPPERCASE_MIN_ASCII
; JB INVALID_NAME2
; CMP AL, LOWERCASE_MAX_ASCII
; JA INVALID_NAME2
; CMP AL, UPPERCASE_MAX_ASCII
; JA CHECK2_IF_LESS_97
; JMP EXTI_GET_INFO
; CHECK2_IF_LESS_97:
; CMP AL, LOWERCASE_MIN_ASCII
; JB INVALID_NAME2
; JMP EXTI_GET_INFO
; INVALID_NAME2:
; call clear_input2
; call invalid_Msg
; wait_for_Enter2:
; MOV AH, 0
; INT 16H
; CMP AH, EnterKey
; JNE wait_for_Enter2
; call clear_warnings
; JMP CHECK_PLAYER2_NAME
EXTI_GET_INFO:
RET
getInfo ENDP
ExitProg Proc
mov ah,4ch
int 21h
ExitProg ENDP
emptyNameMsg PROC
MOV DX, offset emptyName_file_name
MOV DI, offset file_handle
CALL openFile
MOV CX, emptyName_file_size
MOV DX, offset emptyName_file
MOV BX, [file_handle]
CALL ReadFileToMemory
MOV SI, offset emptyName_file
MOV AX, emptyName_starting_row
MOV [START_ROW], AX
MOV AX, emptyName_starting_column
MOV [START_COLUMN], AX
MOV [AUX_IMAGE_HEIGHT], emptyName_height
MOV [AUX_IMAGE_WIDTH], emptyName_width
CALL drawImage
RET
emptyNameMsg ENDP
invalid_Msg PROC
MOV DX, offset firstCharCheck_file_name
MOV DI, offset file_handle
CALL openFile
MOV CX, firstCharCheck_file_size
MOV DX, offset firstCharCheck_file
MOV BX, [file_handle]
CALL ReadFileToMemory
MOV SI, offset firstCharCheck_file
MOV AX, firstCharCheck_starting_row
MOV [START_ROW], AX
MOV AX, firstCharCheck_starting_column
MOV [START_COLUMN], AX
MOV [AUX_IMAGE_HEIGHT], firstCharCheck_height
MOV [AUX_IMAGE_WIDTH], firstCharCheck_width
CALL drawImage
RET
invalid_Msg ENDP
clear_input1 PROC
mov cx, 64 ;Column
mov dx, 290 ;Row
mov al, BackgroundColor ;Pixel color
mov ah, 0ch ;Draw Pixel Command
clear_text1: int 10h
INC CX
MOV BX, CX
SUB BX, 182
CMP BX, 66
JNZ clear_text1
MOV CX, 64
INC DX
MOV BX, DX
SUB BX, 32
CMP BX, 290
JNZ clear_text1
RET
clear_input1 ENDP
clear_input2 PROC
mov cx, 367 ;Column
mov dx, 290 ;Row
mov al, BackgroundColor ;Pixel color
mov ah, 0ch ;Draw Pixel Command
clear_text2: int 10h
INC CX
MOV BX, CX
SUB BX, 182
CMP BX, 367
JNZ clear_text2
MOV CX, 367
INC DX
MOV BX, DX
SUB BX, 32
CMP BX, 290
JNZ clear_text2
RET
clear_input2 ENDP
clear_warnings PROC
mov cx, emptyName_starting_column ;Column
mov dx, emptyName_starting_row ;Row
mov al, BackgroundColor ;Pixel color
mov ah, 0ch ;Draw Pixel Command
clear_msgs: int 10h
INC CX
MOV BX, CX
SUB BX, emptyName_width
CMP BX, emptyName_starting_column + 2
JNZ clear_msgs
MOV CX, emptyName_starting_column
INC DX
MOV BX, DX
SUB BX, emptyName_height
CMP BX, emptyName_starting_row + 2
JNZ clear_msgs
RET
clear_warnings ENDP
findCarRemSteps proc ;DI -> X_POS ; SI -> Y_POS
MOV DX,0
MOV ax,DI
MOV BX,CELL_W
div Bx
mov x,ax
MOV DX,0
MOV ax,SI
MOV BX,CELL_H
div BX
mov y,ax
mov cx,0
search_findcarindex:
MOV DX,x
MOV BX,CX
cmp [pathx+BX],DX
jnz skip_search_findcarindex
MOV DX,y
cmp [pathy+BX],DX
jnz skip_search_findcarindex
;found
mov bx,2
mov ax,cx
mov dx,0
div bx
mov carIndex,ax
ret
skip_search_findcarindex:
add cx,2
cmp cx,200
jl search_findcarindex
ret
findCarRemSteps endp
CHECKSEND PROC
PUSHA
MOV DX,3FDH
LOP1: IN AL,DX
AND AL,00100000B
JZ LOP1
POPA
ret
CHECKSEND ENDP
CHECKRECIEVE PROC
PUSHA
MOV DX,3FDH
IN AL,DX
AND AL,1
JZ NoRecieve
mov RecieveFlag,1
jmp donerecieve
NoRecieve:
mov RecieveFlag,0
donerecieve:
POPA
ret
CHECKRECIEVE ENDP
RecieveByte proc
PUSHA
MOV DX,03F8H
IN AL,DX
MOV DataIn,AL
POPA
ret
RecieveByte endp
sendbyte proc
PUSHA
MOV DX,3F8H
MOV AL,DataOut
OUT DX,AL
POPA
ret
sendbyte endp
getplayer2name proc
PUSHA
mov si,offset player1_name + 2
mov di,offset player2_name + 2
mov cl,15
namesloop:
cmp finish1,1
jne trysend
cmp finish2,1
jne trysend2
jmp akhertany
; call CHECKRECIEVE
; cmp RecieveFlag,1
; jne trysend
; call RecieveByte
; mov al,DataIn
; mov ah,0
; mov byte ptr [di],al
; add di,1
trysend:
; CMP finish1,1
; JE trysend2
mov al,byte ptr [si]
cmp al,'$'
jnz tany
mov finish1,1
tany:
mov DataOut,al
call CHECKSEND
call sendbyte
call WaitSomeTime
call WaitSomeTime
add si,1
trysend2:
cmp finish2,1
je namesloop
call CHECKRECIEVE
cmp RecieveFlag,1
jne trysend2
call RecieveByte
mov al,DataIn
cmp al,'$'
jnz tany2
mov finish2,1
; jmp namesloop
tany2:
mov ah,0
mov byte ptr [di],al
add di,1
nnnnnn:
; dec cl
; cmp cl,0
jmp namesloop
akhertany:
POPA
ret
getplayer2name endp
Wait_Sec PROC
; in memory
pusha
mov ah, 2Ch
int 21H ; puts the millseconds in dl
add dh,waittime
mov al, dh ; contain hundreds of seconds
mov bl,60
mov ah,0
xor dx,dx
div bl
mov goaltime,ah
wait_loop:
mov ah, 2Ch
int 21H ; puts the millseconds in dl
mov al, dh ; contain hundreds of seconds
mov bl,60
mov ah,0
xor dx,dx
div bl
cmp ah,goaltime
jnz wait_loop
popa
ret
Wait_Sec ENDP
displaychat proc
mov cx, 0 ;Column
mov dx, 0 ;Row
mov al, 0 ;Pixel color
mov ah, 0ch ;Draw Pixel Command
HorizonQ: int 10h
INC CX
CMP CX, 640
JNZ HorizonQ
MOV CX, 0
INC DX
CMP DX, 480
JNZ HorizonQ
mov ah,0CH
mov al,01
mov cx,0
mov dx,240
LL1:
int 10h
inc cx
cmp cx,640
jnz LL1
call displayPlayerNames
mov cx, 0 ;Column
mov dx, 270 ;Row
mov al, 0 ;Pixel color
mov ah, 0ch ;Draw Pixel Command
HorizonQ3: int 10h
INC CX
CMP CX, 640
JNZ HorizonQ3
MOV CX, 0
INC DX
CMP DX, 480
JNZ HorizonQ3
AGAIN:
CMP ENDCHAT1,1
JNE DONTQUIT1
MOV ENDCHAT1,0
MOV ENDCHAT2,0
JMP ENDINGCHAT
DONTQUIT1:
CMP ENDCHAT2,1
JNE DONTQUIT
MOV ENDCHAT1,0
MOV ENDCHAT2,0
JMP ENDINGCHAT
DONTQUIT:
mov dl,SRX
mov dh,SRY
mov ah,2
int 10h
CALL CHECKRECIEVE
CMP RecieveFlag,1
JNE SENDLOP
call RecieveByte
MOV DL,DataIn
MOV AH,2
INT 21H
CMP DL,0A1H
JNE NOQUIT2
MOV ENDCHAT2,1
NOQUIT2:
MOV AH,3
INT 10h
MOV SRX,DL
MOV SRY,DH
CMP DataIn,0DH
JNZ NEXmain
INC SRY
NEXmain:
CMP SRY,30
JNZ SKIP1111
mov cx, 0 ;Column
mov dx, 270 ;Row
mov al, 0 ;Pixel color
mov ah, 0ch ;Draw Pixel Command
HorizonQ23: int 10h
INC CX
CMP CX, 640
JNZ HorizonQ23
MOV CX, 0
INC DX
CMP DX, 480
JNZ HorizonQ23
MOV SRY,17
MOV SRX,0
SKIP1111:
JMP AGAIN
KOBRY:
JMP AGAIN
SENDLOP:
mov ah,2
mov dl,SSendX
mov dh,SSendY
int 10h
mov ah,01h
int 16h
jz KOBRY
mov ah,00H
int 16h
mov bl,al
MOV DataOut,AL
CMP AH,F3
JNE NOQUIT
MOV ENDCHAT1,1
mov DataOut,0A1H
NOQUIT:
mov dl,bl
mov ah,2
INT 21H
CALL CHECKSEND
call sendbyte
MOV AH,3
INT 10h
MOV SSendX,DL
MOV SSendY,dh
CMP BL,0DH
JNZ NEX1
INC SSendY
NEX1:
CMP SSendY,14
JNZ SKIPppp
mov cx, 0 ;Column
mov dx, 15 ;Row
mov al, 0 ;Pixel color
mov ah, 0ch ;Draw Pixel Command
HorizonQ2: int 10h
INC CX
CMP CX, 640
JNZ HorizonQ2
MOV CX, 0
INC DX
CMP DX, 222
JNZ HorizonQ2
MOV SSendX,0
MOV SSendY,1
SKIPppp:
JMP SENDLOP
ENDINGCHAT:
ret
displaychat endp
displayplayernames proc
PUSHA
mov ah,2
mov dx,0
int 10h
mov dx, offset player1_name + 2
mov ah, 9
int 21h
mov ah,2
mov dl,0
mov dh,16
int 10h
mov dx, offset player2_name+2
mov ah, 9
int 21h
popa
ret
displayplayernames endp
SetConfig PROC
MOV DX,3FBH
MOV AL,10000000B
OUT DX,AL
MOV DX,3F8H
MOV AL,0CH
OUT DX,AL
MOV DX,3F9H
MOV AL,00H
OUT DX,AL
MOV DX,3FBH
MOV AL,00011011B
OUT DX,AL
RET
SetConfig ENDP
inviteToChat proc
mainLoop_inviteToChat:
;send
mov ah,1
int 16h
jnz readKeyInviteToChat
cmp receivedInviteToChat,1
jz mainLoop_inviteToChat
cmp receivedInviteToGame,1
jz mainLoop_inviteToChat
jmp receive_inviteToChat
readKeyInviteToChat:
MOV AH,0
INT 16H
cmp ah,F1
jz continue_send_inviteToChat
cmp ah,F2
jz continue_send_inviteToChat
CMP AH,EscKey
; send it then terminate
jnz mainLoop_inviteToChat
;enno now its none of the three options
continue_send_inviteToChat:
;Check that Transmitter Holding Register is Empty
mov dx , 3FDH ; Line Status Register
In al , dx ;Read Line Status
AND al , 00100000b
JZ receive_inviteToChat ;jump untill it is empty
;If empty put the VALUE in Transmit data register
mov dx , 3F8H ; Transmit data register
mov al, ah ; is it safe to use ah here?
out dx , al
cmp ah,F1
jne inviteGame_after_send
cmp invitedChat,1
jne not_invited_send
call displaychat
mov invitedChat,0
mov receivedInviteToChat,0
mov invitedGame,0
mov receivedInviteToGame,0
mov ah,0
ret
inviteGame_after_send:
cmp ah,F2
jne esc_terminate_send
; invite game
cmp invitedGame,1
jne not_invited_game_send
mov bypassMenuLoop,1
ret
esc_terminate_send:
call ExitProg ;terminate after sending that byte
ret
not_invited_send:
;set cursor
mov ah, 2h
mov dh, 350/CharHeight + 2 ;ROW
mov dl, 130/CharWidth ;COLUMN
mov bh, 0
mov bh, 00h
int 10h
mov ah, 9
mov dx, offset sendChatInviteMes
int 21h
mov dx,offset player2_name + 2
int 21h
mov invitedChat,1
jmp receive_inviteToChat
not_invited_game_send:
mov ah, 2h
mov dh, 310/CharHeight + 2 ;ROW
mov dl, 130/CharWidth ;COLUMN
mov bh, 0
mov bh, 00h
int 10h
mov ah,9
mov dx,offset sendGameInviteMes
int 21h
mov dx,offset player2_name + 2
int 21h
mov invitedGame,1
;jmp receive_inviteToChat
receive_inviteToChat:
CLI
;Check that Data Ready
mov dx , 3FDH ; Line Status Register
in al , dx
AND al , 00000001b
jnz readValue_inviteToChat
cmp invitedChat,1
jz receive_inviteToChat
cmp invitedGame,1
jz receive_inviteToChat
Jmp mainLoop_inviteToChat ;jump untill it recive data