-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.asm
1318 lines (1105 loc) · 26.6 KB
/
test.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
;hi non
;matrix2.asm ==== You can use this code on website http://pastebin.com/raw/8MaqeGWN
.model tiny
print_color macro
mov ax,0920h ;AH=Function number AL=Space character
mov cx,200 ; number of chars that will be painted
int 10h ;BIOS function 09h
int 21h ;DOS function 09h
endm
dark_green macro
mov bl,02h ;dark green color
print_color
endm
bright_green macro
mov bl,0ah ;bright green color
print_color
endm
white macro
mov bl,0fh ;white color
print_color
endm
blue macro
mov bl,09 ;blue color
print_color
endm
y_llo macro
mov bl,014 ;yello color
print_color
endm
red macro
mov bl,04 ;red color
print_color
endm
mas macro
lea dx, msg
dark_green
endm
mas2 macro
lea dx, msg2
white
endm
mas3 macro
lea dx, msg3
blue
endm
mas4 macro
lea dx, msg4
y_llo
endm
mas5 macro
lea dx, msg5
red
endm
mas6 macro
lea dx, msg6
white
endm
mas7 macro
lea dx, msg7
white
endm
mas8 macro
lea dx, msg8
white
endm
mas9 macro
lea dx, msg9
white
endm
mas10 macro
lea dx, msg10
white
endm
mas11 macro
lea dx, msg11
dark_green
endm
link_main macro
jmp main
endm
link_EndGame macro
jmp EndGame
endm
mas_L macro
lea dx, msg_0L
red
endm
print_str macro
mov ah, 09h
int 21h
endm
mas_0L macro
lea dx, msg_0L
red
endm
;============ no color ============
mas_1L macro
lea dx, msg_1L
print_str
endm
mas_2L macro
lea dx, msg_2L
print_str
endm
mas_3L macro
lea dx, msg_3L
print_str
endm
mas_4L macro
lea dx, msg_4L
grey
endm
mas_5L macro
lea dx, msg_5L
print_str
endm
mas_9L macro
lea dx, msg_9L
print_str
endm
mas_10L macro
lea dx, msg_10L
print_str
endm
;========== end no color ==========
mas_11L macro
lea dx, msg_11L
red
endm
;============ result ===============
data_1 macro
val dw ?
msg_score db ""
decimal db "00000$"
endm
data_2 macro
val_x dw ?
msg_x db ""
x db "00000$"
endm
AX_to_DEC macro
mov bx, 10 ; divisor
xor cx, cx ; CX=0 (number of digits)
First_Loop:
xor dx, dx ; Attention: DIV applies also DX!
div bx ; DX:AX / BX = AX remainder: DX
push dx ; LIFO
inc cx ; increment number of digits
test ax, ax ; AX = 0?
jnz First_Loop ; no: once more
mov di,offset decimal ; target string DECIMAL
Second_Loop:
pop ax ; get back pushed digit
or ax,00110000b ; to ASCII
mov byte ptr [di], al ; save AL
inc di ; DI points to next character in string DECIMAL
loop Second_Loop ; until there are no digits left
mov byte ptr [di], '$' ; End-of-string delimiter for INT 21 / FN 09h
endm
AX_to_DEC2 macro
mov bx, 10 ; divisor
xor cx, cx ; CX=0 (number of digits)
x_loop:
xor dx, dx ; Attention: DIV applies also DX!
div bx ; DX:AX / BX = AX remainder: DX
push dx ; LIFO
inc cx ; increment number of digits
test ax, ax ; AX = 0?
jnz x_loop ; no: once more
mov di,offset x ; target string x
y_loop:
pop ax ; get back pushed digit
or ax,00110000b ; to ASCII
mov byte ptr [di], al ; save AL
inc di ; DI points to next character in string DECIMAL
loop y_loop ; until there are no digits left
mov byte ptr [di], '$' ; End-of-string delimiter for INT 21 / FN 09h
endm
correct_score macro
xor ax, ax
;mov dl, 115 ;wait dl
mov al, dl ;al for show numbers <-------------------------------------------------- *** Link Here***
add al, 0
adc ah, 0
mov val, ax
mov ax,val
AX_to_DEC
endm
wrong_score macro
xor ax, ax
;mov dl, 100 ;wait dl
mov al, dl ;al for show numbers <------------------------------------------------ *** Link Here***
add al, 0
adc ah, 0
mov val_x, ax
mov ax,val_x
AX_to_DEC2
endm
print_true macro
mas_2L
lea dx,msg_score
dark_green
endm
grey macro
mov bl,07 ;white grey color
print_color
endm
print_space macro
lea dx,msg_space
grey
endm
print_false macro
print_space
mas_3L
lea dx,msg_x
red
endm
print_numbers macro
mov ax, 4c00h
int 21h
endm
;============end result ===============
print macro
mas_0L
mas_1L
;===========Answer==================
correct_score
print_true
wrong_score
print_false
;===========END Answer==================
mas_4L
mas_9L
mas_10L
mas_11L
endm
cls macro
mov ah, 00h ; Set to 80x25
mov al, 03h
int 10h
endm
;---------------------------------------------------------------------------------------------------
.data
data_1
data_2
msg db 10,13,'============================[The Matrix Game]=================================$'
msg2 db 10,13,' [Choose Level]$'
msg3 db 10,13,' a)Easy$'
msg4 db 10,13,' b)Hard$'
msg5 db 10,13,' c)Hell$'
msg6 db 10,13,' Enter Level:$'
msg7 db 10,13,' ...Exit press ESC...$'
msg8 db 10,13,' Hello$'
msg9 db 10,13,' Try again press(y):$'
msg10 db 10,13," [Be careful with your characters fall to Blue line !!!! -0-]$"
msg11 db 10,13,'===============================================================================$'
msg_0L db 10,13,'=============================== [END Game] ===================================$'
msg_1L db 10,13,' ___________________$'
msg_2L db 10,13,' Score:$'
msg_3L db 10,13,' typing Wrong:$'
msg_4L db 10,13,' ___________________$'
;msg_5L db 10,13,' $'
;msg_6L db 10,13,' $'
;msg_7L db 10,13,' $'
;msg_8L db 10,13,' $'
msg_9L db 10,13,' $'
msg_10L db 10,13,' Esc to exit...$'
msg_11L db 10,13,'===============================================================================$'
msg_space db ' $',0
;---------------------------------------------------------------------------------------------------
ColumnSt db 80 dup(0) ; Column Start
ColumnCh db 80 dup(0) ; Column Char
temp db 0
tempChar db 0
runColumn db 0
Score db 0
Wrong db 0
HP db 9
tempHP db 9
RunHP db 0
Level db 0
tempScore db 0
tempWrong db 0
savePress db 0
skipColumn db 10
tempAh db 0
SomeTune dw 3043, 512 ;g1
dw 50, 128 ;silent
dw 3043, 512 ;g1
dw 50, 128 ;silent
dw 3043, 512 ;g1
dw 50, 128 ;silent
dw 3834, 512 ;dis1
dw 2559, 128 ;ais1
dw 3043, 512 ;g1
dw 50, 64 ;silent
dw 3834, 512 ;dis1
dw 2559, 128 ;ais1
dw 3043, 512 ;g1
dw 50, 256 ;silent
dw 2031, 512 ;d2
dw 50, 64 ;silent
dw 2031, 512 ;d2
dw 50, 64 ;silent
dw 2031, 512 ;d2
dw 50, 64 ;silent
dw 1917, 512 ;dis2
dw 2559, 128 ;ais1
dw 3224, 512 ;fis1
dw 50, 64 ;silent
dw 3834, 512 ;dis1
dw 2559, 128 ;ais1
dw 3043, 512 ;g1
dw 50, 64 ;silent
dw 1521, 512 ;g2
dw 50, 64 ;silent
dw 3043, 256 ;g1
dw 50, 8 ;silent
dw 3043, 256 ;g1
dw 50, 8 ;silent
;dw 1521, 512 ;g2
dw 50, 128 ;silent
dw 3224, 512 ;fis1
dw 3416, 128 ;f1
dw 3619, 128 ;e1
dw 1917, 128 ;dis2
dw 3619, 512 ;e1
dw 50, 64 ;silent
dw 2873, 256 ;gis1
dw 2152, 512 ;cis2
dw 50, 32 ;silent
dw 2280, 512 ;c2
dw 4560, 128 ;h1
dw 2559, 128 ;ais1
dw 2711, 128 ;a1
dw 2559, 512 ;ais1
dw 50, 128 ;silent
dw 3834, 128 ;dis1
dw 3224, 512 ;fis1
dw 3834, 128 ;dis1
dw 3224, 256 ;fis1
dw 2559, 512 ;ais1
dw 3043, 128 ;g1
dw 2559, 256 ;ais1
dw 2031, 512 ;d2
dw 50, 64 ;silent
dw 1521, 512 ;g2
dw 50, 128 ;silent
dw 3043, 256 ;g1
dw 50, 8 ;silent
dw 3043, 256 ;g1
dw 50, 8 ;silent
dw 1521, 512 ;g2
dw 50, 128 ;silent
dw 1612, 512 ;fis2
dw 1715, 128 ;f2
dw 1809, 128 ;e2
dw 1917, 128 ;dis2
dw 1809, 512 ;e2
dw 50, 128 ;silent
dw 2873, 256 ;gis1
dw 2152, 512 ;cis2
dw 2280, 512 ;c2
dw 4560, 128 ;h1
dw 2559, 128 ;ais1
dw 2711, 128 ;a1
dw 2559, 512 ;ais1
dw 50, 128 ;silent
dw 3834, 128 ;dis1
dw 3224, 512 ;fis1
dw 3834, 128 ;dis1
dw 2559, 256 ;ais1
dw 3043, 512 ;g1
dw 3834, 128 ;dis1
dw 2559, 128 ;ais1
dw 3043, 512 ;g1
dw 50, 1024 ;silent
dw 00h,00h
Sonic dw 1355,32 ;a3
dw 1715,32 ;f3
dw 1355,32 ;a3
dw 1715,32 ;f3
dw 2415,32 ;b3
dw 1521,32 ;g3
dw 2415,32 ;b3
dw 1521,32 ;g3
dw 2280,32 ;c3
dw 1355,32 ;a3
dw 2280,32 ;c3
dw 1355,32 ;a3
dw 2031,32 ;d3
dw 2415,32 ;b3
dw 2031,32 ;d3
dw 2415,32 ;b3
dw 2280,32 ;c3
dw 2415,32 ;b3
dw 1355,32 ;a3
dw 1521,32 ;g3
dw 2280,32 ;c3
dw 2415,32 ;b3
dw 1355,32 ;a3
dw 1521,32 ;g3
dw 2280,32 ;c3
dw 2415,32 ;b3
dw 1355,32 ;a3
dw 1521,32 ;g3
dw 50,64;silent
dw 00h,00h
WrongSound dw 3500, 10
dw 5000, 50
dw 00h,00h
CorrectSound dw 2500,20
dw 00h,00h
MissingSound dw 1000,20
dw 50,8;silent
dw 1000,20
dw 00h,00h
.code
org 0100h
main:
mov ah, 00h ; Set to 80x25
mov al, 03h
int 10h
;--------- welcome message
set_rol:
mov ah, 02h ; Move cursor XY
mov bh, 00h
mov dh, 5
mov dl, 0
int 10h
mas
mas2
mas3
mas4
mas5
mas7
mas10
mas11
mas6
WaitSound:
push ds
pop es
mov si, offset Sonic
mov dx,61h ; turn speaker on
in al,dx ;
or al,03h ;
out dx,al ;
mov dx,43h ; get the timer ready
mov al,0B6h ;
out dx,al ;
LoopIt: lodsw ; load desired freq.
or ax,ax ; if freq. = 0 then done
jz short LDone ;
mov tempAh, ah
mov ah,1h
int 16h
jnz WaitType
mov ah, tempAh
mov dx,42h ; port to out
out dx,al ; out low order
xchg ah,al ;
out dx,al ; out high order
lodsw ; get duration
mov cx,ax ; put it in cx (16 = 1 second)
call PauseIt ; pause it
jmp short LoopIt
LDone: mov dx,61h ; turn speaker off
in al,dx ;
and al,0FCh ;
out dx,al ;
jmp WaitSound
WaitType:
;mov ah,1h
;int 16h
;jz WaitType
mov ah, 00h
int 16h
cmp al,'a' ;a for Easy
je SetLevel0
cmp al,'A' ;a for Easy
je SetLevel0
cmp al,'b' ;a for Hard
je SetLevel1
cmp al,'B' ;a for Hard
je SetLevel1
cmp al,'c' ;a for Hell
je SetLevel2
cmp al,'C' ;a for Hell
je SetLevel2
cmp al,1BH ;Esc for exit
je exit2
exit2:
mov dx,61h ; turn speaker off
in al,dx ;
and al,0FCh ;
out dx,al ;
mov ah, 4ch
int 21h
SetLevel0:
mov Level, 0
jmp SetPointer
SetLevel1:
mov Level, 1
jmp SetPointer
SetLevel2:
mov Level, 2
jmp SetPointer
SetPointer:
mov dx,61h ; turn speaker off
in al,dx ;
and al,0FCh ;
out dx,al ;
;--------- set pointer -------------
mov ah, 00h ; Set to 80x25
mov al, 03h
int 10h
mov si, offset ColumnSt
mov di, offset ColumnCh
mov temp, 0
;input:
; mov ah, 01h
; int 16h
;
; jz main; not press
;
; mov ah, 00h
; int 16h
root:
;--------- random first start ------
mov ax, 10 ; random row in Column to fall
int 62h
mov byte ptr [si], al ; create position to fall
inc si
;------------ char
mov ax, 75 ; random Char
int 62h
add ax, 48
mov byte ptr [di], al
inc di
inc temp
cmp temp, 80
jne root
mov si, offset ColumnSt
mov di, offset ColumnCh
loopCreate: ; use for create long text
; -------- prepare for create text
mov dh, [si]
mov temp, dh
; -------- print char to screen
mov ah, 02h ; set cursor
mov dh, temp
mov dl, runColumn
int 10h
mov ah, 09h ; Write Character and Attribute at Current Cursor Position
mov al, [di]
mov bh, 0
mov bl, 00fh ; color
mov cx, 1
int 10h
dec temp
; -------- print char to screen
mov ah, 02h ; set cursor
mov dh, temp
mov dl, runColumn
int 10h
mov ah, 09h ; Write Character and Attribute at Current Cursor Position
mov al, [di]
mov bx, 007h ; color
mov cx, 1
int 10h
dec temp
; -------- print char to screen
mov ah, 02h ; set cursor
mov dh, temp
mov dl, runColumn
int 10h
mov ah, 09h ; Write Character and Attribute at Current Cursor Position
mov al, [di]
mov bx, 00Ah ; color
mov cx, 1
int 10h
dec temp
; -------- print char to screen
mov ah, 02h ; set cursor
mov dh, temp
mov dl, runColumn
int 10h
mov ah, 09h ; Write Character and Attribute at Current Cursor Position
mov al, [di]
mov bx, 00Ah ; color
mov cx, 1
int 10h
dec temp
; -------- print char to screen
mov ah, 02h ; set cursor
mov dh, temp
mov dl, runColumn
int 10h
mov ah, 09h ; Write Character and Attribute at Current Cursor Position
mov al, [di]
mov bx, 00Ah ; color
mov cx, 1
int 10h
dec temp
; -------- print char to screen
mov ah, 02h ; set cursor
mov dh, temp
mov dl, runColumn
int 10h
mov ah, 09h ; Write Character and Attribute at Current Cursor Position
mov al, [di]
mov bx, 002h ; color
mov cx, 1
int 10h
dec temp
; -------- print char to screen
mov ah, 02h ; set cursor
mov dh, temp
mov dl, runColumn
int 10h
mov ah, 09h ; Write Character and Attribute at Current Cursor Position
mov al, [di]
mov bx, 002h ; color
mov cx, 1
int 10h
dec temp
; -------- print char to screen
mov ah, 02h ; set cursor
mov dh, temp
mov dl, runColumn
int 10h
mov ah, 09h ; Write Character and Attribute at Current Cursor Position
mov al, [di]
mov bx, 008h ; color
mov cx, 1
int 10h
dec temp
; -------- fall Char
inc byte ptr [si]
mov dh, [si]
cmp dh, 23
jne NextFall
MissType:
;------------- Check Miss Char
dec HP
cmp HP, 0
je EndGame
;--------- random first start ------
mov ax, 10 ; random row in Column to fall
int 62h
mov byte ptr [si], al ; create position to fall
inc si
;------------ char
mov ax, 75 ; random Char
int 62h
add ax, 48
mov byte ptr [di], al
NextFall:
; -------- next Column
inc si
inc di
mov dl, skipColumn
add runColumn, dl ; skip column
; -------- last column of screen
cmp runColumn, 80
jge gotoCreateLine
jmp loopCreate ; back to create next column
gotoCreateLine:
jmp createLine
EndGame:
cls
;---------- Show last screen
mov ah, 02h ; Move cursor XY
mov bh, 00h
mov dh, 5
mov dl, 0
int 10h
mas_0L
mas_1L
;===========Answer==================
mov dl, Score
correct_score
print_true
mov dl, Wrong
wrong_score
print_false
;===========END Answer==================
mas_4L
mas_9L
mas_10L
mas_11L
; ========= Sound end game
EndSound:
push ds
pop es
mov si, offset SomeTune
mov dx,61h ; turn speaker on
in al,dx ;
or al,03h ;
out dx,al ;
mov dx,43h ; get the timer ready
mov al,0B6h ;
out dx,al ;
LoopItE: lodsw ; load desired freq.
or ax,ax ; if freq. = 0 then done
jz short LDoneE ;
mov tempAh, ah
mov ah,1h
int 16h
jnz CloseGame
mov ah, tempAh
mov dx,42h ; port to out
out dx,al ; out low order
xchg ah,al ;
out dx,al ; out high order
lodsw ; get duration
mov cx,ax ; put it in cx (16 = 1 second)
call PauseIt ; pause it
jmp short LoopItE
LDoneE: mov dx,61h ; turn speaker off
in al,dx ;
and al,0FCh ;
out dx,al ;
jmp EndSound
; ========= Sound
CloseGame:
mov ah, 00h
int 16h
cmp al,1BH ;Esc for clear screen
je goExit
goExit:
jmp exit
createLine:
mov runColumn, 0 ; set var for runColumn
LineLoop:
; -------- print -- to screen
mov ah, 02h ; set cursor
mov dh, 23
mov dl, runColumn
int 10h
mov ax, '-'
mov ah, 09h ; Write Character and Attribute at Current Cursor Position
mov bh, 0
mov bl, 0BBh; color
mov cx, 1
int 10h
inc runColumn
cmp runColumn, 80
jne LineLoop
mov runColumn, 24
HPLine:
; -------- print -- to screen
mov ah, 02h ; set cursor
mov dh, 24
mov dl, runColumn
int 10h
mov ax, 'H'
mov ah, 09h ; Write Character and Attribute at Current Cursor Position
mov bh, 0
mov bl, 004h; color
mov cx, 1
int 10h
inc runColumn
mov ah, 02h ; set cursor
mov dh, 24
mov dl, runColumn
int 10h
mov ax, 'P'
mov ah, 09h ; Write Character and Attribute at Current Cursor Position
mov bh, 0
mov bl, 004h; color
mov cx, 1
int 10h
inc runColumn
mov ah, 02h ; set cursor
mov dh, 24
mov dl, runColumn
int 10h
mov ax, ' '
mov ah, 09h ; Write Character and Attribute at Current Cursor Position
mov bh, 0
mov bl, 004h; color
mov cx, 1
int 10h
inc runColumn
mov ah, 02h ; set cursor
mov dh, 24
mov dl, runColumn
int 10h
mov ax, ':'
mov ah, 09h ; Write Character and Attribute at Current Cursor Position
mov bh, 0
mov bl, 004h; color
mov cx, 1
int 10h
inc runColumn
;-------- RunHP
mov al, HP
mov RunHP, al
createHP:
;--------- check HP for play sound
mov al, tempHP
cmp al, HP
je createHPbar
mov al, HP
mov tempHP, al
call MissTypingSound
;--------- END play sound
createHPbar:
mov ah, 02h ; set cursor
mov dh, 24
mov dl, runColumn
int 10h
mov ax, '='
mov ah, 09h ; Write Character and Attribute at Current Cursor Position
mov bh, 0
mov bl, 0EEh; color
mov cx, 1
int 10h
inc runColumn
mov ah, 02h ; set cursor
mov dh, 24
mov dl, runColumn
int 10h
mov ax, '='
mov ah, 09h ; Write Character and Attribute at Current Cursor Position
mov bh, 0