-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMAIN.asm
1984 lines (1792 loc) · 27.8 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
; multi-segment executable file template.
data segment
; add your data here!
CHAR_X DW 5
CHAR_Y DW 54
CHAR_SIZE DW 10
STRING DB "STEP: ","$"
SCORE_0 DB '0'
SCORE_1 DB '0'
SCORE_2 DB '0'
MIN_SCORE DB "MIN STEP:","$"
LV DB "LV.","$"
QUIT_MSG DW "DO YOU WANT TO QUIT?","$"
CONFIRMATION DB "(PRESS y TO CONFIRM, n TO DENY)","$"
CONFIRMATIONLVL DB "(PRESS y TO CONFIRM)","$"
LVL_UP_MSG DB "DO YOU WANT TO MOVE TO NEXT LEVEL?","$"
GAME1 DW "WELCOME TO MAZE RUN","$"
GAME2 DW "PRESS 's' TO START GAME","$"
GAME3 DW "PRESS 'i' FOR INSTRUCTIONS","$"
INSTR1 DW "USE ARROW KEYS TO MOVE","$"
INSTR2 DW "MOVE THE CHARACTER TO GO OUT OF THE MAZE","$"
INSTR3 DW "PRESS ESC ANYTIME TO PAUSE OR END THE GAME","$"
INSTR4 DW "STEPS ARE CALCULATED AND SHOWN AT THE TOP","$"
INSTR5 DW "MINIMUM STEPS ARE SHOWN AS A CHALLENGE FOR YOU","$"
INSTR6 DW "PRESS 'esc' TO GO BACK TO MAIN MENU","$"
GAMECOMPLETE DW "YOU HAVE COMPLETED ALL 3 MAZE RUNS SUCCESSSFULLY","$"
CONG DW "CONGRATULATIONS!!!","$"
bool db 0
LV2_DOWN_BOUND DW 16
LV2_UP_BOUND DW 4
LV2_LEFT_BOUND DW 5
LV2_RIGHT_BOUND DW 15
LV3_DOWN_BOUND DW 16
LV3_UP_BOUND DW 4
LV3_LEFT_BOUND DW 5
LV3_RIGHT_BOUND DW 15
CURR_LV DB 1
ends
;------------------------------------------------------
stack segment
dw 128 dup(0)
ends
;--------------------------------------------------------
code segment
start:
MAIN PROC
; set segment registers:
mov ax, data
mov ds, ax
mov es, ax
;add your code here
MOV AH,00H;SET VIDEO MODE
MOV AL,12H;RESOLUTION
INT 10H
CALL MAINMENU
ret
MAIN ENDP
;------------------------------------------------------
MAINMENU PROC
CALL CLEAR_SCR
MOV DL,28
MOV DH,3
MOV AH,02
INT 10H
LEA DX,GAME1
MOV AH,09H
INT 21H
MOV DL,25
MOV DH,6
MOV AH,02
INT 10H
LEA DX,GAME2
MOV AH,09H
INT 21H
MOV DL,25
MOV DH,7
MOV AH,02
INT 10H
LEA DX,GAME3
MOV AH,09H
INT 21H
CHECKAGAINMAIN:
MOV AH,07H
INT 21H;char input
CMP AL,73H;s
JE STARTGAME
CMP AL,69H;i
JE INSTRUCT
JMP CHECKAGAINMAIN
STARTGAME:
CALL CLEAR_SCR
MOV SCORE_0,'0'
MOV SCORE_1,'0'
MOV SCORE_2,'0'
MOV CHAR_X,5
MOV CHAR_Y,54
CALL LEVEL1
RET
INSTRUCT:
CALL CLEAR_SCR
CALL INSTRUCTION
RET
RET
MAINMENU ENDP
;------------------------------------------------------
INSTRUCTION PROC
CALL CLEAR_SCR
MOV DL,28
MOV DH,5
MOV AH,02
INT 10H
LEA DX,INSTR1
MOV AH,09H
INT 21H
MOV DL,20
MOV DH,6
MOV AH,02
INT 10H
LEA DX,INSTR2
MOV AH,09H
INT 21H
MOV DL,20
MOV DH,7
MOV AH,02
INT 10H
LEA DX,INSTR3
MOV AH,09H
INT 21H
MOV DL,20
MOV DH,8
MOV AH,02
INT 10H
LEA DX,INSTR4
MOV AH,09H
INT 21H
MOV DL,18
MOV DH,9
MOV AH,02
INT 10H
LEA DX,INSTR5
MOV AH,09H
INT 21H
MOV DL,22
MOV DH,12
MOV AH,02
INT 10H
LEA DX,INSTR6
MOV AH,09H
INT 21H
CHECKAGAININSTR:
MOV AH,07H
INT 21H
CMP AL,1BH;esc
JE MAINMENUINSTR
JMP CHECKAGAININSTR
MAINMENUINSTR:
CALL MAINMENU
RET
RET
INSTRUCTION ENDP
;------------------------------------------------------
CLEAR_SCR PROC
MOV CX,0
MOV DX,0
MOV AH,0CH
MOV AL,00H
CLEAR:
INT 10H
INC CX
CMP CX,550
JNG CLEAR
MOV CX,0
INC DX
CMP DX,500
JNG CLEAR
RET
CLEAR_SCR ENDP
;----------------------------------------------------
LEVEL1 PROC
CALL SHOW_SCORE
CALL SHOW_MINSCORE1
CALL SHOW_LEVEL
CALL CREATE_MAZE1
CALL DRAW_CHAR
CALL INPUT
RET
LEVEL1 ENDP
;-----------------------------------------------------
LEVEL3 PROC
CALL SHOW_SCORE
CALL SHOW_MINSCORE3
CALL SHOW_LEVEL
CALL CREATE_MAZE3
CALL DRAW_CHAR
CALL INPUT
RET
LEVEL3 ENDP
;---------------------------------------------------
LEVEL2 PROC
CALL SHOW_SCORE
CALL SHOW_MINSCORE2
CALL SHOW_LEVEL
CALL CREATE_MAZE2
CALL DRAW_CHAR
CALL INPUT
RET
LEVEL2 ENDP
;-----------------------------------------------------------------------
DRAW_CHAR PROC
MOV CX,CHAR_X
MOV DX,CHAR_Y
MOV AH,0CH
MOV AL,0FH
DRAW:
INT 10H
INC CX
MOV BX,CX
SUB BX,CHAR_X
CMP BX,CHAR_SIZE;(CX-char_x<char_size)
JNG DRAW
MOV CX,CHAR_X
INC DX
MOV BX,DX
SUB BX,CHAR_Y
CMP BX,CHAR_SIZE
JNG DRAW
RET
DRAW_CHAR ENDP
;--------------------------------------------------
INPUT PROC
INP:
MOV AH,00H
INT 16H ;AH CONTAINS SCAN CODE AND AL CONTAINS ASCII
CMP AH,48H ;IF ARROW UP IS PRESSSED
JE UP
CMP AH,50H ;DOWN KEY
JE DOWN
CMP AH,4BH ;LEFT
JE LEFT
CMP AH,4DH ;RIGHT
JE RIGHT
CMP AL,1BH;esc
JE ESCAPE
JMP INP
RIGHT:
MOV CX,CHAR_X;COLUMN NUMBER
ADD CX,LV3_RIGHT_BOUND
MOV DX,CHAR_Y
ADD DX,4
call check
cmp bool,1
je exit
CALL CALC_SCORE
CALL DELETE_CHAR
MOV CX,CHAR_X
ADD CX,10
MOV CHAR_X,CX
CALL DRAW_CHAR
JMP INP
UP:
MOV CX,CHAR_X
MOV DX,CHAR_Y
SUB DX,LV3_UP_BOUND
call check
cmp bool,1
je exit
CALL CALC_SCORE
CALL DELETE_CHAR
SUB CHAR_Y,10
CALL DRAW_CHAR
JMP INP
LEFT:
MOV CX,CHAR_X
SUB CX,LV3_LEFT_BOUND
MOV DX,CHAR_Y
ADD DX,4
call check
cmp bool,1
je exit
CALL CALC_SCORE
CALL DELETE_CHAR
SUB CHAR_X,10
CALL DRAW_CHAR
JMP INP
DOWN:
MOV CX,CHAR_X
ADD CX,5
MOV DX,CHAR_Y
ADD DX,LV3_DOWN_BOUND
call check
cmp bool,1
je exit
MOV DX,CHAR_Y
ADD DX,10
CMP DX,350
JA LVCOMPLETE
CALL CALC_SCORE
CALL DELETE_CHAR
ADD CHAR_Y,10
CALL DRAW_CHAR
JMP INP
ESCAPE:
CALL CLEAR_SCR
MOV DL,25
MOV DH,5
MOV AH,02
INT 10H
LEA DX,QUIT_MSG
MOV AH,09H
INT 21H
MOV DL,25
MOV DH,6
MOV AH,02
INT 10H
LEA DX,CONFIRMATION
MOV AH,09H
INT 21H
CHECKAGAIN:
MOV AH,07H
INT 21H
CMP AL,79H;y
JE MAINMENUINSTR
CMP AL,6EH;n
JE CONTINUEGAME
JMP CHECKAGAIN
RET
CONTINUEGAME:
CALL CLEAR_SCR
CMP CURR_LV,1
JE LV1CONTINUE
CMP CURR_LV,2
JE LV2CONTINUE
CMP CURR_LV,3
JE LV3CONTINUE
LV1CONTINUE:
CALL LEVEL1
LV2CONTINUE:
CALL LEVEL2
LV3CONTINUE:
CALL LEVEL3
exit:
mov ah,02h
mov dl,07h
int 21h
mov bool,0
jmp inp
LVCOMPLETE:
CMP CURR_LV,3
JE ENDGAME
CALL CLEAR_SCR
MOV DL,25
MOV DH,5
MOV AH,02
INT 10H
LEA DX,LVL_UP_MSG
MOV AH,09H
INT 21H
MOV DL,25
MOV DH,6
MOV AH,02
INT 10H
LEA DX,CONFIRMATIONLVL
MOV AH,09H
INT 21H
CHECKAGAINLVL:
MOV AH,07H
INT 21H
CMP AL,79H;y
JE COMPLETE
JMP CHECKAGAINLVL
COMPLETE:
CALL CLEAR_SCR
MOV CHAR_X,5
MOV CHAR_Y,54
CMP CURR_LV,1
JE LV2
CMP CURR_LV,2
JE LV3
CMP CURR_LV,3
JE ENDGAME
LV2:
MOV CURR_LV,2
MOV SCORE_0,'0'
MOV SCORE_1,'0'
MOV SCORE_2,'0'
CALL LEVEL2
RET
LV3:
MOV CURR_LV,3
MOV SCORE_0,'0'
MOV SCORE_1,'0'
MOV SCORE_2,'0'
CALL LEVEL3
RET
ENDGAME:
MOV CURR_LV,1
CALL ENDGAMEP
RET
RET
INPUT ENDP
;--------------------------------------------------
ENDGAMEP PROC
CALL CLEAR_SCR
MOV DL,20
MOV DH,5
MOV AH,02
INT 10H
LEA DX,GAMECOMPLETE
MOV AH,09H
INT 21H
MOV DL,25
MOV DH,8
MOV AH,02
INT 10H
LEA DX,CONG
MOV AH,09H
INT 21H
MOV DL,22
MOV DH,12
MOV AH,02
INT 10H
LEA DX,INSTR6
MOV AH,09H
INT 21H
CHECKAGAINEND:
MOV AH,07H
INT 21H
CMP AL,1BH;esc
JE MAINMENUEND
JMP CHECKAGAINEND
MAINMENUEND:
CALL MAINMENU
RET
ENDGAMEP ENDP
;-------------------------------------------------
DELETE_CHAR PROC
MOV CX,CHAR_X
MOV DX,CHAR_Y
MOV AH,0CH
MOV AL,00H
DELETE:
INT 10H
INC CX
MOV BX,CX
SUB BX,CHAR_X
CMP BX,CHAR_SIZE
JNG DRAW
MOV CX,CHAR_X
INC DX
MOV BX,DX
SUB BX,CHAR_Y
CMP BX,CHAR_SIZE
JNG DELETE
RET
DELETE_CHAR ENDP
;--------------------------------------------------------------------
SHOW_SCORE PROC
MOV DL,1;column
MOV DH,1;row
MOV AH,02
INT 10H;setting cursor position
LEA DX,STRING
;output the string
;loaded in dx
MOV AH,09H
INT 21H
MOV DL,8
MOV DH,1
MOV AH,02
INT 10H
mov al, SCORE_0
mov bl, 0Ch ;Color is red
mov bh, 0 ;Display page
mov ah, 0Eh ;Teletype
int 10h
mov al,SCORE_1
int 10h
MOV AL,SCORE_2
INT 10H
RET
SHOW_SCORE ENDP
;--------------------------------------------------------
SHOW_MINSCORE1 PROC
MOV DL,25
MOV DH,1
MOV AH,02
INT 10H;setting cursor position
LEA DX,MIN_SCORE
MOV AH,09H
INT 21H
MOV DL,35
MOV DH,1
MOV AH,02
INT 10H
MOV BL,0CH
MOV AH,0EH
MOV AL,'0'
INT 10H
MOV AL,'8'
INT 10H
MOV AL,'1'
INT 10H
RET
SHOW_MINSCORE1 ENDP
;-----------------------------------------------------
SHOW_MINSCORE2 PROC
MOV DL,25
MOV DH,1
MOV AH,02
INT 10H;setting cursor position
LEA DX,MIN_SCORE
MOV AH,09H
INT 21H
MOV DL,35
MOV DH,1
MOV AH,02
INT 10H
MOV BL,0CH
MOV AH,0EH
MOV AL,'1'
INT 10H
MOV AL,'1'
INT 10H
MOV AL,'1'
INT 10H
RET
SHOW_MINSCORE2 ENDP
;--------------------------------------------------------
SHOW_MINSCORE3 PROC
MOV DL,25
MOV DH,1
MOV AH,02
INT 10H;setting cursor position
LEA DX,MIN_SCORE
MOV AH,09H
INT 21H
MOV DL,35
MOV DH,1
MOV AH,02
INT 10H
MOV BL,0CH
MOV AH,0EH
MOV AL,'1'
INT 10H
MOV AL,'4'
INT 10H
MOV AL,'0'
INT 10H
RET
SHOW_MINSCORE3 ENDP
;--------------------------------------------------------
SHOW_LEVEL PROC
MOV DL,15
MOV DH,1
MOV AH,02
INT 10H
LEA DX,LV
MOV AH,09
INT 21H
MOV DL,20
MOV DH,1
MOV AH,02
INT 10H
MOV BL,0CH;RED
MOV AH,0EH
CMP CURR_LV,1
JE LV1CHAR
CMP CURR_LV,2
JE LV2CHAR
CMP CURR_LV,3
JE LV3CHAR
LV1CHAR:
MOV AL,'1'
JMP PRINT
LV2CHAR:
MOV AL,'2'
JMP PRINT
LV3CHAR:
MOV AL,'3'
PRINT:
INT 10H
RET
SHOW_LEVEL ENDP
;--------------------------------------------------------
CALC_SCORE PROC
CMP SCORE_2,'9'
JE TENTH_PLACE
INC SCORE_2
JMP LAST
TENTH_PLACE:
CMP SCORE_1,'9'
JE HUNDREDTH_PLACE
INC SCORE_1
MOV SCORE_2,'0'
JMP LAST
HUNDREDTH_PLACE:
INC SCORE_0
MOV SCORE_1,'0'
MOV SCORE_2,'0'
JMP LAST
LAST:
CALL SHOW_SCORE
RET
CALC_SCORE ENDP
;---------------------------------------------------------
check proc
MOV AH,0DH
MOV BH,0
INT 10H;reads the pixel
cmp al,0DH;al contains the colour
jne ex
mov bool,1
ex:
ret
check endp
;------------------------------------------------------
CREATE_MAZE1 PROC
MOV AL,0DH ;MAGENTA
MOV AH,0CH ;WRITE PIXEL
MOV DX,50
MOV CX,0
;INT 10H
L1V1:
INC DX
INT 10H
CMP DX,350
JB L1V1
MOV DX,50
MOV CX,300
L1V2:
INC DX
INT 10H
CMP DX,350
JB L1V2
MOV DX,50
MOV CX,0
L1H1:
INC CX
INT 10H
CMP CX,300
JB L1H1
MOV DX,350
MOV CX,0
L1H3:
INC CX
INT 10H
CMP CX,150
JB L1H3
MOV DX,350
MOV CX,180
L1H4:
INC CX
INT 10H
CMP CX,300
JB L1H4
MOV DX,110
MOV CX,0
L1H5:
INC CX
INT 10H
CMP CX,30
JB L1H5
MOV DX,260
MOV CX,0
L1H6:
INC CX
INT 10H
CMP CX,60
JB L1H6
MOV DX,320
MOV CX,0
L1H7:
INC CX
INT 10H
CMP CX,30
JB L1H7
MOV DX,320
MOV CX,30
L1V3:
DEC DX
INT 10H
CMP DX,290
JA L1V3
MOV DX,170
MOV CX,30
L1V4:
INC DX
INT 10H
CMP DX,230
JB L1V4
MOV DX,80
MOV CX,30
L1H8:
INC CX
INT 10H
CMP CX,60
JB L1H8
MOV DX,80
MOV CX,60
L1V5:
INC DX
INT 10H
CMP DX,110
JB L1V5
MOV DX,110
MOV CX,60
L1H9:
INC CX
INT 10H
CMP CX,210
JB L1H9
MOV DX,140
MOV CX,30
L1H10:
INC CX
INT 10H
CMP CX,90
JB L1H10
MOV DX,200
MOV CX,30
L1H11:
INC CX
INT 10H
CMP CX,90
JB L1H11
MOV DX,230
MOV CX,30
L1H12:
INC CX
INT 10H
CMP CX,120
JB L1H12
MOV DX,350
MOV CX,60
L1V6:
DEC DX
INT 10H
CMP DX,320
JA L1V6
MOV DX,80
MOV CX,90
L1V7:
INC DX
INT 10H
CMP DX,170
JB L1V7
MOV DX,170
MOV CX,60
L1H13:
INC CX
INT 10H
CMP CX,120
JB L1H13
MOV DX,170
MOV CX,120
L1V8:
INC DX
INT 10H
CMP DX,230
JB L1V8
MOV DX,230
MOV CX,90
L1V9:
INC DX
INT 10H
CMP DX,260
JB L1V9
MOV DX,290
MOV CX,60
L1H14:
INC CX
INT 10H
CMP CX,120
JB L1H14
MOV DX,290
MOV CX,90
L1V10:
INC DX
INT 10H
CMP DX,320
JB L1V10
MOV DX,50
MOV CX,120
L1V11:
INC DX
INT 10H
CMP DX,80
JB L1V11
MOV DX,110
MOV CX,120
L1V12:
INC DX
INT 10H
CMP DX,140
JB L1V12
MOV DX,140
MOV CX,120
L1H15:
INC CX
INT 10H
CMP CX,150
JB L1H15
MOV DX,140
MOV CX,150
L1V13:
INC DX
INT 10H
CMP DX,260
JB L1V13
MOV DX,260
MOV CX,150
L1H16:
DEC CX
INT 10H
CMP CX,120
JA L1H16
MOV DX,260
MOV CX,120
L1V14:
INC DX
INT 10H
CMP DX,350
JB L1V14
MOV DX,80
MOV CX,150
L1V15:
INC DX
INT 10H
CMP DX,110
JB L1V15
MOV DX,80
MOV CX,150
L1H17:
INC CX
INT 10H
CMP CX,180
JB L1H17
MOV DX,80
MOV CX,210
L1V16:
INC DX
INT 10H
CMP DX,110
JB L1V16
MOV DX,110
MOV CX,180
L1V17:
INC DX
INT 10H
CMP DX,170
JB L1V17
MOV DX,200
MOV CX,150
L1H18:
INC CX
INT 10H
CMP CX,210
JB L1H18
MOV DX,140
MOV CX,180
L1H19:
INC CX
INT 10H
CMP CX,240
JB L1H19
MOV DX,80
MOV CX,240
L1H20:
INC CX
INT 10H
CMP CX,270
JB L1H20
MOV DX,80
MOV CX,270
L1V18:
INC DX
INT 10H
CMP DX,110
JB L1V18
MOV DX,110
MOV CX,270
L1H21:
DEC CX
INT 10H
CMP CX,240
JA L1H21
MOV DX,110
MOV CX,240
L1V19:
INC DX
INT 10H
CMP DX,230
JB L1V19
MOV DX,170
MOV CX,210
L1H22:
INC CX
INT 10H
CMP CX,240
JB L1H22
MOV DX,200
MOV CX,240
L1H23:
INC CX
INT 10H
CMP CX,270
JB L1H23
MOV DX,200
MOV CX,270
L1V20:
INC DX
INT 10H
CMP DX,320
JB L1V20
MOV DX,320
MOV CX,270
L1H24:
DEC CX
INT 10H
CMP CX,240
JA L1H24
MOV DX,350
MOV CX,180
L1V21:
DEC DX
INT 10H
CMP DX,320
JA L1V21
MOV DX,320
MOV CX,180
L1H25: