-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpractice2.asm
More file actions
1983 lines (1499 loc) · 43.9 KB
/
practice2.asm
File metadata and controls
1983 lines (1499 loc) · 43.9 KB
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
;////////////////////////////////////aaimlik code of paddles/////////////////////
;///////////////////////////////////LEVEL 2/////////////////////////////////////////////
; brick1 color=01h score marks as 3 // brick2 color =05h score as 4// brick 3 is know as=0Dh score 5 // brick 4 color=0A score 2
;brick5 color=08h score marks 1//brick6 color =0F white score 6//brick7 color is knpw as 04 score 7//brick 8 score color 0C scrore 8
;brick9 color==brick8 color// brick 10color ==brick 7// brick11 color==03 score 3==brick1 //brick 12==brick6 0Fh/// brick 13==brick 7//
;brick14==02 score 2 //brick 15==0D== brick 3//brick 16=01h brick one
;brick 17==brick 14//brick 18==brick 16 //brick 19==brick 5//brick 20==09 score 4 //brick 21==brick 10
.model small
.stack 100h
.data
TIME_CHANGE db 0 ;check if time has changed
x_ball dw 50 ; x axis
y_ball dw 70 ; y axis
;checking theball speed over here
ball_vol_x dw 04h ; horizontal velocity of ball
ball_vol_y dw 04h ; vertical velocity of ball
; ////////////////////////hence it will increase the ball speed
;lets find the ball size
ball_size dw 5
;setting the colision of the ball in the screen
screen_width dw 138h ;(300 pixel)
screen_height dw 0BDH ;(200 pixel)
; now lets start dealing with the paddles
paddle_down_x dw 112 ; 112
paddle_down_y dw 165 ;165
; hence it will shoten the paddle length
paddle_height dw 40;80
paddle_width dw 10 ;10
; now lets discuss paddle speed
paddle_vol dw 20
screen_bound dw 6
paddle_end dw 249
string db "SCORE :",'$'
string1 db "LEVEL 2 ",'$'
win db " GAME OVER ",'$'
win1 db " YOU WIN ",'$'
askii db 123
score db 0 ; current pointsof teh player
live db 3
live1 db 3
loss1 db "LOSS",'$'
; variables for the brick for first coloumn
brick1_x dw 20
brick1_y dw 30
brick2_x dw 55
brick2_y dw 30
brick3_x dw 90
brick3_y dw 30
brick4_x dw 125
brick4_y dw 30
brick5_x dw 160
brick5_y dw 30
brick6_x dw 195
brick6_y dw 30
brick7_x dw 230
brick7_y dw 30
brick8_x dw 265
brick8_y dw 30
; now we will declare the block for the next row let increse the y axis
brick9_x dw 20
brick9_y dw 60
brick10_x dw 55
brick10_y dw 60
brick11_x dw 90
brick11_y dw 60
brick12_x dw 125
brick12_y dw 60
brick13_x dw 160
brick13_y dw 60
brick14_x dw 195
brick14_y dw 60
brick15_x dw 230
brick15_y dw 60
brick16_x dw 265
brick16_y dw 60
;now we will draw brick for rows 3 havinf three brick
brick17_x dw 60
brick17_y dw 90
brick18_x dw 95
brick18_y dw 90
brick19_x dw 130
brick19_y dw 90
brick20_x dw 165
brick20_y dw 90
brick21_x dw 200
brick21_y dw 90
brick_width dw 30
brick_height dw 10
;checking the collision variables
br1 dw 0
br2 dw 0
br3 dw 0
br4 dw 0
br5 dw 0
br6 dw 0
br7 dw 0
br8 dw 0
br9 dw 0
br10 dw 0
br11 dw 0
br12 dw 0
br13 dw 0
br14 dw 0
br15 dw 0
br16 dw 0
;now checking condition for the double collision
hit1 dw 0
hit2 dw 0
hit3 dw 0
hit4 dw 0
hit5 dw 0
hit6 dw 0
hit7 dw 0
hit8 dw 0
hit9 dw 0
hit10 dw 0
hit11 dw 0
hit12 dw 0
hit13 dw 0
hit14 dw 0
hit15 dw 0
hit16 dw 0
hit17 dw 0
hit18 dw 0
hit19 dw 0
hit20 dw 0
hit21 dw 0
;ow we will find for thefollowing rows that is following
br17 dw 0
br18 dw 0
br19 dw 0
br20 dw 0
br21 dw 0
; lets see the variable for ball collision detection
v1 dw 0
v2 dw 0
v3 dw 0
v4 dw 0
; score of the player we will find lets assume the following score
point db 0
count db 0
.code
main proc
mov ax,@data
mov ds,ax
mov ah,00h
mov al,13h
int 10h
;;lets set the backgrond color of the game
;MOV AH, 06h ; Scroll up function
;XOR AL, AL ; Clear entire screen
;XOR CX, CX ; Upper left corner CH=row, CL=column
;MOV DX, 184FH ; lower right corner DH=row, DL=column
;MOV BH, 02h ; YellowOnBlue
;INT 10H
;///////////////////hence it change the backgound color
;ASSUME cs:code,ds:data ,ss:stack
;push ds
;sub ax,ax
;push ax
;mov ax,data
;mov ds,ax
;pop ax
;pop ax
mov ax,0
;mov ah,0bh
;mov bh,00h
;mov bh,00h
;int 10h
;draw the paddle and move the paddle according to their updated position
checktime:
mov ah,2ch ;set the system times
int 21h
cmp dl,TIME_CHANGE
je checktime
mov TIME_CHANGE,dl
; update time
mov ah,00h ; we again set it to video mode so that it cannot change continue the chane of the that ball
mov al,13h
int 10h
call background_color
call block_collision
call draw_block
call ball_movement
call drawball
call draw_user
call paddle_movement
call draw_paddle
;draw userinterface
jmp checktime ; check time again
mov ah,4ch
int 21h
ret
main endp
; over here we will draw the ball and ball will move here and there
;/////////////////////////////draw ball move////////////////////////////////////////////////
drawball proc
mov cx,x_ball ; intitial position of the ball
mov dx,y_ball ; initial y position of the ball
ball_move:
mov ah,0Ch
mov al,04h ;this will set the color of the
;mov bh,00
int 10h
inc cx
mov ax,cx
sub ax,x_ball
cmp ax,ball_size
jng ball_move
mov cx,x_ball ; cx register goesback to initial value
inc dx
mov ax,dx
sub ax,y_ball
cmp ax,ball_size
jng ball_move
ret
drawball endp
;/////////////////////////////////ball move///////////////////////////////////
ball_movement proc
mov ax,ball_vol_x
add x_ball,ax
; move ball horizontslly
; let check ball collision , if ball collision is less than zero or greater than 300 than
cmp x_ball,0
jl lx ; if it is cloliding than restart its position
mov ax,screen_width
sub ax,ball_size
cmp x_ball,ax
jg lx
mov bx,ball_vol_y
add y_ball,bx ; move ball vertically
cmp y_ball,28
jl ly
mov bx,screen_height
sub ax,ball_size
cmp y_ball,bx
jg ly
;now we will check if the ball is colliding with paddle or not
;maxx1 > minx2 && minx1 < maxx2 && maxy1 > miny1 && miny1 < maxy2,we will implement this code so
;x_ball+ball_size >paddle_down_x
mov ax,x_ball
add ax,ball_size
cmp ax,paddle_down_x
jng lc
;ball_x <max=(paddle_down_x+paddle_width)
mov ax,paddle_down_x
add ax,paddle_height
cmp x_ball,ax
jnl lc
;&&(y_ball+ball_size)> paddle_down_y
mov ax,y_ball
add ax,ball_size
cmp ax,paddle_down_y
jng lc
;&& y_ball < paddle_down_y+paddle_height
mov ax,paddle_down_y
add ax,paddle_width
cmp y_ball,ax
jnl lc
jmp neg_velocity ; exits the procedures
lc:
ret
lx:
neg ball_vol_x
ret
ly:
dec live
neg ball_vol_y
ret
neg_velocity:
neg ball_vol_y ; reverse the vertical position of the collision
ret
exit_collision:
ret
ball_movement endp
;//////////////////////////////////////////draw brick////////////////////////////////
draw_block proc
;set the initial column of the block
mov cx,brick1_x ; initial coloumn of the brick
mov dx,brick1_y ; initial line of the brick
draw_brick1:
mov ah,0Ch
mov al,01h ;this will set the color of the
;mov bh,00
int 10h
inc cx ; cx=cx+1
mov ax,cx ;cx-brick1_x>brick_width
sub ax,brick1_x
cmp ax,brick_width
jng draw_brick1
mov cx,brick1_x ; cx register goesback to initial value
inc dx
mov ax,dx
sub ax,brick1_y
cmp ax,brick_height
jng draw_brick1
mov cx,brick2_x
mov dx,brick2_y
; now this is code for the brick two code that we will implement
draw_brick2:
mov ah,0Ch
mov al,05h ;this will set the color of the
;mov bh,00
int 10h
inc cx ; cx=cx+1
mov ax,cx ;cx-brick1_x>brick_width
sub ax,brick2_x
cmp ax,brick_width
jng draw_brick2
mov cx,brick2_x ; cx register goesback to initial value
inc dx
mov ax,dx
sub ax,brick2_y
cmp ax,brick_height
jng draw_brick2
mov cx,brick3_x
mov dx,brick3_y
; now we will code for brick 3 to draw brick three this is the following code
draw_brick3:
mov ah,0Ch
mov al,0Dh ;this will set the color of the
;mov bh,00
int 10h
inc cx ; cx=cx+1
mov ax,cx ;cx-brick1_x>brick_width
sub ax,brick3_x
cmp ax,brick_width
jng draw_brick3
mov cx,brick3_x ; cx register goesback to initial value
inc dx
mov ax,dx
sub ax,brick3_y
cmp ax,brick_height
jng draw_brick3
; now we will write code for the brick 4
mov cx,brick4_x
mov dx,brick4_y
draw_brick4:
mov ah,0Ch
mov al,0Ah ;this will set the color of the
;mov bh,00
int 10h
inc cx ; cx=cx+1
mov ax,cx ;cx-brick1_x>brick_width
sub ax,brick4_x
cmp ax,brick_width
jng draw_brick4
mov cx,brick4_x ; cx register goesback to initial value
inc dx
mov ax,dx
sub ax,brick4_y
cmp ax,brick_height
jng draw_brick4
mov cx,brick5_x
mov dx,brick5_y
draw_brick5:
mov ah,0Ch
mov al,08h ;this will set the color of the
;mov bh,00
int 10h
inc cx ; cx=cx+1
mov ax,cx ;cx-brick1_x>brick_width
sub ax,brick5_x
cmp ax,brick_width
jng draw_brick5
mov cx,brick5_x ; cx register goesback to initial value
inc dx
mov ax,dx
sub ax,brick5_y
cmp ax,brick_height
jng draw_brick5
mov cx,brick6_x
mov dx,brick6_y
draw_brick6:
mov ah,0Ch
mov al,0Fh ;this will set the color of the
;mov bh,00
int 10h
inc cx ; cx=cx+1
mov ax,cx ;cx-brick1_x>brick_width
sub ax,brick6_x
cmp ax,brick_width
jng draw_brick6
mov cx,brick6_x ; cx register goesback to initial value
inc dx
mov ax,dx
sub ax,brick6_y
cmp ax,brick_height
jng draw_brick6
mov cx,brick7_x
mov dx,brick7_y
draw_brick7:
mov ah,0Ch
mov al,04h ;this will set the color of the
;mov bh,00
int 10h
inc cx ; cx=cx+1
mov ax,cx ;cx-brick1_x>brick_width
sub ax,brick7_x
cmp ax,brick_width
jng draw_brick7
mov cx,brick7_x ; cx register goesback to initial value
inc dx
mov ax,dx
sub ax,brick7_y
cmp ax,brick_height
jng draw_brick7
mov cx,brick8_x
mov dx,brick8_y
draw_brick8:
mov ah,0Ch
mov al,0Ch ;this will set the color of the
;mov bh,00
int 10h
inc cx ; cx=cx+1
mov ax,cx ;cx-brick1_x>brick_width
sub ax,brick8_x
cmp ax,brick_width
jng draw_brick8
mov cx,brick8_x ; cx register goesback to initial value
inc dx
mov ax,dx
sub ax,brick8_y
cmp ax,brick_height
jng draw_brick8
mov cx,brick9_x
mov dx,brick9_y
; now will start code for the next row let starts doing this for the next row
draw_brick9:
mov ah,0Ch
mov al,0Ch ;this will set the color of the
;mov bh,00
int 10h
inc cx ; cx=cx+1
mov ax,cx ;cx-brick1_x>brick_width
sub ax,brick9_x
cmp ax,brick_width
jng draw_brick9
mov cx,brick1_x ; cx register goesback to initial value
inc dx
mov ax,dx
sub ax,brick9_y
cmp ax,brick_height
jng draw_brick9
mov cx,brick10_x
mov dx,brick10_y
; now this is code for the brick two code that we will implement
draw_brick10:
mov ah,0Ch
mov al,04h ;this will set the color of the
;mov bh,00
int 10h
inc cx ; cx=cx+1
mov ax,cx ;cx-brick1_x>brick_width
sub ax,brick10_x
cmp ax,brick_width
jng draw_brick10
mov cx,brick10_x ; cx register goesback to initial value
inc dx
mov ax,dx
sub ax,brick10_y
cmp ax,brick_height
jng draw_brick10
mov cx,brick11_x
mov dx,brick11_y
; now we will code for brick 3 to draw brick three this is the following code
draw_brick11:
mov ah,0Ch
mov al,03h ;this will set the color of the
;mov bh,00
int 10h
inc cx ; cx=cx+1
mov ax,cx ;cx-brick1_x>brick_width
sub ax,brick11_x
cmp ax,brick_width
jng draw_brick11
mov cx,brick11_x ; cx register goesback to initial value
inc dx
mov ax,dx
sub ax,brick11_y
cmp ax,brick_height
jng draw_brick11
; now we will write code for the brick 4
mov cx,brick12_x
mov dx,brick12_y
draw_brick12:
mov ah,0Ch
mov al,0Fh ;this will set the color of the
;mov bh,00
int 10h
inc cx ; cx=cx+1
mov ax,cx ;cx-brick1_x>brick_width
sub ax,brick12_x
cmp ax,brick_width
jng draw_brick12
mov cx,brick12_x ; cx register goesback to initial value
inc dx
mov ax,dx
sub ax,brick12_y
cmp ax,brick_height
jng draw_brick12
mov cx,brick13_x
mov dx,brick13_y
draw_brick13:
mov ah,0Ch
mov al,04h ;this will set the color of the
;mov bh,00
int 10h
inc cx ; cx=cx+1
mov ax,cx ;cx-brick1_x>brick_width
sub ax,brick13_x
cmp ax,brick_width
jng draw_brick13
mov cx,brick13_x ; cx register goesback to initial value
inc dx
mov ax,dx
sub ax,brick13_y
cmp ax,brick_height
jng draw_brick13
mov cx,brick14_x
mov dx,brick14_y
draw_brick14:
mov ah,0Ch
mov al,0Bh ;this will set the color of the
;mov bh,00
int 10h
inc cx ; cx=cx+1
mov ax,cx ;cx-brick1_x>brick_width
sub ax,brick14_x
cmp ax,brick_width
jng draw_brick14
mov cx,brick14_x ; cx register goesback to initial value
inc dx
mov ax,dx
sub ax,brick14_y
cmp ax,brick_height
jng draw_brick14
mov cx,brick15_x
mov dx,brick15_y
draw_brick15:
mov ah,0Ch
mov al,0Dh ;this will set the color of the
;mov bh,00
int 10h
inc cx ; cx=cx+1
mov ax,cx ;cx-brick1_x>brick_width
sub ax,brick15_x
cmp ax,brick_width
jng draw_brick15
mov cx,brick15_x ; cx register goesback to initial value
inc dx
mov ax,dx
sub ax,brick15_y
cmp ax,brick_height
jng draw_brick15
mov cx,brick16_x
mov dx,brick16_y
draw_brick16:
mov ah,0Ch
mov al,01h ;this will set the color of the
;mov bh,00
int 10h
inc cx ; cx=cx+1
mov ax,cx ;cx-brick1_x>brick_width
sub ax,brick16_x
cmp ax,brick_width
jng draw_brick16
mov cx,brick16_x ; cx register goesback to initial value
inc dx
mov ax,dx
sub ax,brick16_y
cmp ax,brick_height
jng draw_brick16
; now we will start coding for the next rows
mov cx,brick17_x
mov dx,brick17_y
draw_brick17:
mov ah,0Ch
mov al,0Bh ;this will set the color of the
;mov bh,00
int 10h
inc cx ; cx=cx+1
mov ax,cx ;cx-brick1_x>brick_width
sub ax,brick17_x
cmp ax,brick_width
jng draw_brick17
mov cx,brick17_x ; cx register goesback to initial value
inc dx
mov ax,dx
sub ax,brick17_y
cmp ax,brick_height
jng draw_brick17
mov cx,brick18_x
mov dx,brick18_y
draw_brick18:
mov ah,0Ch
mov al,01h ;this will set the color of the
;mov bh,00
int 10h
inc cx ; cx=cx+1
mov ax,cx ;cx-brick1_x>brick_width
sub ax,brick18_x
cmp ax,brick_width
jng draw_brick18
mov cx,brick18_x ; cx register goesback to initial value
inc dx
mov ax,dx
sub ax,brick18_y
cmp ax,brick_height
jng draw_brick18
mov cx,brick19_x
mov dx,brick19_y
draw_brick19:
mov ah,0Ch
mov al,08h ;this will set the color of the
;mov bh,00
int 10h
inc cx ; cx=cx+1
mov ax,cx ;cx-brick1_x>brick_width
sub ax,brick19_x
cmp ax,brick_width
jng draw_brick19
mov cx,brick19_x ; cx register goesback to initial value
inc dx
mov ax,dx
sub ax,brick19_y
cmp ax,brick_height
jng draw_brick19
mov cx,brick20_x
mov dx,brick20_y
draw_brick20:
mov ah,0Ch
mov al,09h ;this will set the color of the
;mov bh,00
int 10h
inc cx ; cx=cx+1
mov ax,cx ;cx-brick1_x>brick_width
sub ax,brick20_x
cmp ax,brick_width
jng draw_brick20
mov cx,brick20_x ; cx register goesback to initial value
inc dx
mov ax,dx
sub ax,brick20_y
cmp ax,brick_height
jng draw_brick20
mov cx,brick21_x
mov dx,brick21_y
draw_brick21:
mov ah,0Ch
mov al,04h ;this will set the color of the
;mov bh,00
int 10h
inc cx ; cx=cx+1
mov ax,cx ;cx-brick1_x>brick_width
sub ax,brick21_x
cmp ax,brick_width
jng draw_brick21
mov cx,brick21_x ; cx register goesback to initial value
inc dx
mov ax,dx
sub ax,brick21_y
cmp ax,brick_height
jng draw_brick21
ret
draw_block endp
block_collision proc
.if(br1==0) ; for brick one (OC is the color score will be 3)
mov ax,x_ball ; in ax store the ball value
mov bx,ax ; now add ball in x coordinates plus ball size
add bx,ball_size
mov cx,y_ball ;cx=ball_y coordinates
mov dx,cx ;dx=ball_y +ball_size
add dx,ball_size
mov v1,ax
mov v2,bx
mov v3,cx
mov v4,dx
.if(v2>20 && v1<49 && v3>29 && v4<36 )
neg ball_vol_y
mov ah,0Ch
mov al,08h ;this will set the color of the
;mov bh,00
int 10h
inc hit1
.if(hit1==2)
mov brick1_x,500
mov brick1_y,600
add point,3 ; score will be add as 3
mov br1,1
inc count
.endif
; here we will place the sounding track
.endif
.endif
.if(br2==0) ; for brick one
mov ax,x_ball ; in ax store the ball value
mov bx,ax ; now add ball in x coordinates plus ball size
add bx,ball_size
mov cx,y_ball ;cx=ball_y coordinates
mov dx,cx ;dx=ball_y +ball_size
add dx,ball_size
mov v1,ax
mov v2,bx
mov v3,cx
mov v4,dx
.if(v2>55 && v1<85 && v3>29&& v4<36)
neg ball_vol_y
mov ah,0Ch
mov al,08h ;this will set the color of the
;mov bh,00
int 10h
inc hit2