-
Notifications
You must be signed in to change notification settings - Fork 0
/
base.asm
973 lines (752 loc) · 18.5 KB
/
base.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
IDEAL
MODEL small
STACK 100h
P186
JUMPS
; Variables/Data segment
; -------------------------------------------------------------------------------------------------
DATASEG
white equ 15 ;white
black equ 0 ;black
cyan equ 11 ;cyan
yellow equ 14 ;yellow
keyHeight equ 200
keyWidth equ 9
smallHeight equ 100
smallWidth equ 4 ; must be EVEN!
smallY equ 101
initX equ 3
right equ 1
left equ 2
mid equ 3
blackKey equ 4
; -------------------------------------------------------------------------------------------------
; misc vars
blackKeyHelper dw blackKey
; -------------------------------------------------------------------------------------------------
; -------------------------------------------------------------------------------------------------
; utility vars for storing "current" variables (current color, current key, etc.)
currColor dw 0 ; the color identifying the key
currKey dw 0
currFreq dw 0
currPos dw 0
effectiveColor dw 0 ; the color we want to use (for example, if we are playing a sound we want to color the key in Yellow)
currChar dw 0
; -------------------------------------------------------------------------------------------------
; -------------------------------------------------------------------------------------------------
; right - 1, left - 2, mid - 3, black - 4
keysArr dw 3 dup (right, blackKey, mid, blackKey, left, right, blackKey, mid, blackKey, mid, blackKey, left)
keysLocs dw 36 dup (initX) ; location of all keys. ALL INITIALIZED TO THE FIRST X VALUE (REST WILL BE CHANGED IN THE CODE)
keyCount equ 36
; -------------------------------------------------------------------------------------------------
; -------------------------------------------------------------------------------------------------
; 1st part ; ' 2nd part black keys
keyBoard db 'ASDFGHJKL', 03Bh, 027h, 'ZXCVBNM,.\', 'QWERTYUIOP[]0-=', '$'
; keyBoard dw 65,83, 68, 70, 71, 72, 74, 75, 76, 03Bh, 027h;, 'zxcvbnm,./', 'qwertyuiop[]0-=', '$'
; -------------------------------------------------------------------------------------------------
; -------------------------------------------------------------------------------------------------
; frequencies for 36 key keyboard: https://learn.digilentinc.com/Documents/400
; assembly list copied from: https://stackoverflow.com/questions/34500138/playing-music-with-the-ibm-pc-speaker
c5 = 2280 ; 523.2510 hz
cis5 = 2152 ; 554.3650 hz
d5 = 2032 ; 587.3300 hz
dis5 = 1918 ; 622.2540 hz
e5 = 1810 ; 659.2550 hz
f5 = 1708 ; 698.4560 hz
fis5 = 1612 ; 739.9890 hz
g5 = 1522 ; 783.9910 hz
gis5 = 1437 ; 830.6090 hz
a5 = 1356 ; 880.0000 hz
ais5 = 1280 ; 932.3280 hz
b5 = 1208 ; 987.7670 hz
c6 = 1140 ; 1046.5000 hz
cis6 = 1076 ; 1108.7300 hz
d6 = 1016 ; 1174.6600 hz
dis6 = 959 ; 1244.5100 hz
e6 = 905 ; 1318.5100 hz
f6 = 854 ; 1396.9100 hz
fis6 = 806 ; 1479.9800 hz
g6 = 761 ; 1567.9800 hz
gis6 = 718 ; 1661.2200 hz
a6 = 678 ; 1760.0000 hz
ais6 = 640 ; 1864.6600 hz
b6 = 604 ; 1975.5300 hz
c7 = 570 ; 2093.0000 hz
cis7 = 538 ; 2217.4600 hz
d7 = 508 ; 2349.3200 hz
dis7 = 479 ; 2489.0200 hz
e7 = 452 ; 2637.0200 hz
f7 = 427 ; 2793.8300 hz
fis7 = 403 ; 2959.9600 hz
g7 = 380 ; 3135.9600 hz
gis7 = 359 ; 3322.4400 hz
a7 = 339 ; 3520.0000 hz
ais7 = 320 ; 3729.3100 hz
b7 = 302 ; 3951.0700 hz
; ordered frequencies in a list
freqs dw c5, cis5, d5, dis5, e5, f5, fis5, g5, gis5, a5, ais5, b5, c6, cis6, d6, dis6, e6, f6, fis6, g6, gis6, a6, ais6, b6, c7, cis7, d7, dis7, e7, f7, fis7, g7, gis7, a7, ais7, b7
; -------------------------------------------------------------------------------------------------
;================================
; showing bmp file
filename db 'piano.bmp',0
filehandle dw ?
Header db 54 dup (0)
Palette db 256*4 dup (0)
ScrLine db 320 dup (0)
ErrorMsg db 'Error', 13, 10 ,'$'
;================================
; Code segment
; -------------------------------------------------------------------------------------------------
CODESEG
; draw horizontal line, left starting at (arg1, arg2) of length arg3. color is arg4
; push color (param4)
; push length (param3)
; push y (param2)
; push x (param1)
; bp+10 => param3 | bp+8 => param3 | bp+6 => param2 | bp+4 => param1
proc horizontal
push bp
mov bp, sp
pusha
mov cx, [bp+4]
add cx, [bp+8]
mov dx, [bp+6] ; row
mov al, [bp+10] ; color
hPixelDrawLoop:
mov ah, 0ch ; put pixel
int 10h
dec cx
cmp cx, [bp+4]
jae hPixelDrawLoop
popa
pop bp
ret
endp horizontal
; draw vecrtical line, top starting at (arg1, arg2) of length arg3. color is arg4
proc vertical
push bp
mov bp, sp
pusha
mov dx, [bp+6]
add dx, [bp+8]
mov cx, [bp+4] ; col
mov al, [bp+10] ; color
vPixelDrawLoop:
mov ah, 0ch ; put pixel
int 10h
dec dx
cmp dx, [bp+6]
jae vPixelDrawLoop
popa
pop bp
ret
endp vertical
; draw a rectangle, top left at (arg1, arg2) of keyWidth arg3 and keyHeight arg4. color is arg5
; use the vertical procedure only
proc rectangle
push bp
mov bp, sp
pusha
mov dx, [bp+8] ; dx tells us the keyWidth
add dx, [bp+4] ; add the x coord
push [bp+12] ; push the color
push [bp+10] ; push the keyHeight
push [bp+6] ; push the starting y
hLineDrawLoop:
push dx
call vertical
add sp, 2 ; (pop) remove the keyWidth (dx) from the stack
dec dx
cmp dx, [bp+4]
jae hLineDrawLoop
add sp, 6 ; remove top 3 values of stack
popa
pop bp
ret
endp rectangle
; draw a piano key looking like "L". x position is (arg1=bp+4)
proc drawRightKey
push bp
mov bp, sp
pusha
mov dx, [bp+4] ; dx tells us the x coord
push [effectiveColor] ; color
push keyHeight ; keyHeight
push keyWidth ; keyWidth
push 1 ; y
push dx ; x
call rectangle
add sp, 10 ; clear stack
add dx, keyWidth
push [effectiveColor] ; color
push smallHeight ; keyHeight
push smallWidth ; keyWidth
push smallY ; y
push dx ; x
call rectangle
add sp, 10 ; clear stack
popa
pop bp
ret
endp drawRightKey
; draw a piano key looking like a *reversed* "L". x position is (arg1=bp+4)
proc drawLeftKey
push bp
mov bp, sp
pusha
mov dx, [bp+4] ; dx tells us the x coord
push [effectiveColor] ; color
push smallHeight ; keyHeight
push smallWidth ; keyWidth
push smallY ; y
push dx ; x
call rectangle
add sp, 10 ; clear stack
add dx, smallWidth
push [effectiveColor] ; color
push keyHeight ; keyHeight
push keyWidth ; keyWidth
push 1 ; y
push dx ; x
call rectangle
add sp, 10 ; clear stack
popa
pop bp
ret
endp drawLeftKey
; draw a piano key looking like "⊥". x position is (arg1=bp+4)
proc drawMidKey
push bp
mov bp, sp
pusha
mov dx, [bp+4] ; dx tells us the x coord
push [effectiveColor] ; color
push smallHeight ; keyHeight
push smallWidth ; keyWidth
push smallY ; y
push dx ; x
call rectangle
add sp, 10 ; clear stack
add dx, smallWidth
; mid of mid part size
mov ax, keyWidth
sub ax, smallWidth
push [effectiveColor] ; color
push keyHeight ; keyHeight
push ax ; keyWidth
push 1 ; y
push dx ; x
call rectangle
add sp, 10 ; clear stack
add dx, ax
push [effectiveColor] ; color
push smallHeight ; keyHeight
push smallWidth ; keyWidth
push smallY ; y
push dx ; x
call rectangle
add sp, 10 ; clear stack
popa
pop bp
ret
endp drawMidKey
; draw a piano blackKey. *MID* x position is (arg1=bp+4)
proc drawBlackKey
push bp
mov bp, sp
pusha
mov dx, [bp+4] ; dx tells us the x coord
sub dx, smallWidth
dec dx
; the black keys width is 2*smallWidth + 1
mov ax, smallWidth
shl ax, 1
inc ax
; black key height is SCREEN_HEIGHT-keyHeight - 1
mov bx, 200
sub bx, smallHeight
dec bx
push [effectiveColor] ; color
push bx ; keyHeight
push ax ; keyWidth
push 1 ; y
push dx ; x
call rectangle
add sp, 10 ; clear stack
popa
pop bp
ret
endp drawBlackKey
proc drawKeySelect
push bp
mov bp, sp
pusha
mov dx, [bp+4] ; dx tells us the x coord
mov ax, [bp+6] ; ax tells us the key
push dx
cmp ax, mid
je drawMid
cmp ax, left
je drawLeft
cmp ax, right
je drawRight
cmp ax, blackKey
je drawBlack
drawMid:
call drawMidKey
jmp finishKey
drawRight:
call drawRightKey
jmp finishKey
drawLeft:
call drawLeftKey
jmp finishKey
drawBlack:
call drawBlackKey
jmp finishKey
finishKey:
pop dx
popa
pop bp
ret
endp drawKeySelect
proc drawPiano
push bp
mov bp, sp
pusha
; init vars
xor cx, cx
mov bx, offset keysArr
mov dx, initX ; initial x position
keyLoop:
mov ax, [bx]
cmp ax, blackKey
je blackDraw
jmp whiteDraw
blackDraw:
mov [effectiveColor], cyan
jmp generalDraw
whiteDraw:
mov [effectiveColor], white
generalDraw:
push ax
push dx
call drawKeySelect
add sp, 4 ; pop items
push ax
mov ax, cx
shl ax, 1
; each item in the array is 1 word=2 bytes long
mov bx, offset keysLocs
add bx, ax
mov [bx], dx
pop ax
; add bx, 2 ; each item in the array is 1 word=2 bytes long
inc cx
; check if we should increment the dx
cmp ax, blackKey
je postInc
add dx, keyWidth
add dx, smallWidth
add dx, 2 ; was 2. testing
postInc:
mov ax, cx
shl ax, 1
; each item in the array is 1 word=2 bytes long
mov bx, offset keysArr
add bx, ax ; used at the beggining of the loop
cmp cx, keyCount-1 ; was keyCount. testing
jle keyLoop
popa
pop bp
ret
endp drawPiano
; color k-th key. k is (arg1=bp+4)
proc colorKey
push bp
mov bp, sp
pusha
mov ax, [bp+4] ; ax tells us the key
shl ax, 1
; get the location of the key
mov bx, offset keysLocs
add bx, ax
mov dx, [bx]
; get the type of the key
mov bx, offset keysArr
add bx, ax
mov ax, [bx]
; draw the key
push ax
push dx
call drawKeySelect
add sp, 4 ; pop items
popa
pop bp
ret
endp colorKey
; first parameter is the frequency,
; which is given by: (PC TIMER TICK RATE) / (NOTE FREQUENCY)
; reference used: https://stackoverflow.com/questions/61670296/generating-music-tone-using-pc-speaker
PROC playSound
push bp
mov bp, sp
pusha
mov al, 182
out 43h, al
mov ax, [bp+4] ; frequency
; write the frequency to 42h
out 42h, al
mov al, ah
out 42h, al
; ask the Programmable Peripheral Interface to connect speaker to the square-wave
; generator, by setting the two least significat bits of PPI port 0x61
in al, 61h
or al, 00000011b
out 61h, al
mov bx, 15
; wait to let the sound play
call delay
call delay
; set back to zero the two least significant bits of PPI port 0x61
in al, 61h
and al, 11111100b
out 61h, al
pop bp
popa
RET
endp playSound
; delay for a cx,dx microseconds (030d40h = 200000)
PROC delay
pusha
mov cx, 03h
mov dx, 0d40h
mov al, 0
mov ah, 86h
int 15h
popa
RET
endp delay
; check which frequency should be used for the key (index stored in currKey)
; proc assumes that currKey is set to a valid index
PROC getFreq
push ax
push bx
mov bx, offset freqs
mov ax, [currKey]
shl ax, 1
add bx, ax
mov ax, [bx]
mov [currFreq], ax
pop bx
pop ax
ret
endp getFreq
; check which x value should be used for the key (index stored in currKey)
; proc assumes that currKey is set to a valid index
PROC getX
push ax
push bx
mov bx, offset keysLocs
mov ax, [currKey]
shl ax, 1
add bx, ax
mov ax, [bx]
mov [currPos], ax
pop bx
pop ax
ret
endp getX
; check which color should be used for the key (index stored in currKey)
; proc assumes that currKey is set to a valid index
PROC getColor
push ax
push bx
mov bx, offset keysArr
mov ax, [currKey]
shl ax, 1
add bx, ax
mov [currColor], white ; default color
mov ax, blackKey
cmp [bx], ax ; check if color should be set to black black
je setColorBlack
jmp returnColor
setColorBlack:
mov [currColor], cyan ; black is currently cyan because its more fun!
returnColor:
pop bx
pop ax
ret
endp getColor
; convert key to index of the key. key will be stored in var currKey
; at the same time, set the appropriate frequency and color
PROC findKey
push bp
mov bp, sp
pusha
mov ax, [bp+4] ; ax tells us the key
mov bx, offset keyBoard
xor cx, cx
; while the key is not found, increment bx, until we find the key or we reach the end of the array
keyFindLoop:
mov dl, [byte ptr bx]
cmp al, dl
je keyFound
inc bx
inc cx
cmp cx, keyCount
je keyNotFound
jmp keyFindLoop
keyFound:
mov [currKey], cx
call getColor ; set the color needed
call getFreq ; set the frequency needed
call getX ; set the x value needed
jmp returnKey
keyNotFound:
mov [currKey], -1
returnKey:
popa
pop bp
ret
endp findKey
; play sound and create a visual effect, assuming that the following are valid and set:
; currFreq, currColor, currKey
PROC playNote
push bp
mov bp, sp
pusha
mov [effectiveColor], yellow ; set color
push [currKey]
call colorKey
add sp, 2 ; pop
push [currFreq]
call playSound
add sp, 2 ; pop
mov ax, [currColor]
mov [effectiveColor], ax ; set color back to original
push [currKey]
call colorKey
add sp, 2 ; pop
popa
pop bp
ret
endp playNote
proc playPiano
push bp
mov bp, sp
pusha
readingLoop:
charReadyLoop:
mov ah, 0bh
int 21h
cmp al, 0
je charReadyLoop
; get the key
mov ah, 0h
int 16h
; convert key to index
xor ah, ah ; get rid of the scan code, to keep only the ascii value
cmp al, '3'
je finishPlay
cmp al, '2'
je helper
push ax
call findKey
add sp, 2 ; pop
; if the key is valid, play the note
cmp [currKey], -1
je keyNotValid
; play the note
call playNote
keyNotValid:
jmp readingLoop
helper:
call presentHelper
jmp readingLoop
finishPlay:
popa
pop bp
ret
endp playPiano
;================================
; to show .bmp files
proc OpenFile
; Open file
mov ah, 3Dh
xor al, al
mov dx, offset filename
int 21h
jc openerror
mov [filehandle], ax
ret
openerror:
mov dx, offset ErrorMsg
mov ah, 9h
int 21h
ret
endp OpenFile
proc ReadHeader
; Read BMP file header, 54 bytes
mov ah,3fh
mov bx, [filehandle]
mov cx,54
mov dx,offset Header
int 21h
ret
endp ReadHeader
proc ReadPalette
; Read BMP file color palette, 256 colors * 4 bytes (400h)
mov ah,3fh
mov cx,400h
mov dx,offset Palette
int 21h
ret
endp ReadPalette
proc CopyPal
; Copy the colors palette to the video memory
; The number of the first color should be sent to port 3C8h
; The palette is sent to port 3C9h
mov si,offset Palette
mov cx,256
mov dx,3C8h
mov al,0
; Copy starting color to port 3C8h
out dx,al
; Copy palette itself to port 3C9h
inc dx
PalLoop:
; Note: Colors in a BMP file are saved as BGR values rather than RGB .
mov al,[si+2] ; Get red value .
shr al,2 ; Max. is 255, but video palette maximal
; value is 63. Therefore dividing by 4.
out dx,al ; Send it .
mov al,[si+1] ; Get green value .
shr al,2
out dx,al ; Send it .
mov al,[si] ; Get blue value .
shr al,2
out dx,al ; Send it .
add si,4 ; Point to next color .
; (There is a null chr. after every color.)
loop PalLoop
ret
endp CopyPal
proc CopyBitmap
; BMP graphics are saved upside-down .
; Read the graphic line by line (200 lines in VGA format),
; displaying the lines from bottom to top.
mov ax, 0A000h
mov es, ax
mov cx,200
PrintBMPLoop :
push cx
; di = cx*320, point to the correct screen line
mov di,cx
shl cx,6
shl di,8
add di,cx
; Read one line
mov ah,3fh
mov cx,320
mov dx,offset ScrLine
int 21h
; Copy one line into video memory
cld ; Clear direction flag, for movsb
mov cx,320
mov si,offset ScrLine
rep movsb ; Copy line to the screen
;rep movsb is same as the following code :
;mov es:di, ds:si
;inc si
;inc di
;dec cx
; ... ;loop until cx=0
pop cx
loop PrintBMPLoop
ret
endp CopyBitmap
proc presentHelper
; Process BMP file
call OpenFile
call ReadHeader
call ReadPalette
call CopyPal
call CopyBitmap
; wait for key to exit
charReadyLoop2:
mov ah, 0bh
int 21h
cmp al, 0
je charReadyLoop2
; get the key
mov ah, 0h
int 16h
; convert key to index
xor ah, ah ; get rid of the scan code, to keep only the ascii value
cmp al, '3'
je finishPlay2
jmp backToPlay
finishPlay2:
; back to text mode
mov ah, 0
mov al, 2
int 10h
; exit program
mov ax, 4c00h
int 21h
backToPlay:
; setting the mode to display mode clears the screen!
mov ah, 0 ; set display mode function.
mov al, 13h ; mode 13h = 320x200 pixels, 256 colors.
int 10h ; set it!
call drawPiano
ret
endp presentHelper
;================================
start:
mov ax, @data
mov ds, ax
mov ah, 0 ; set display mode function.
mov al, 13h ; mode 13h = 320x200 pixels, 256 colors.
int 10h ; set it!
; Process BMP file
call OpenFile
call ReadHeader
call ReadPalette
call CopyPal
call CopyBitmap
; Wait for key press
mov ah,1
int 21h
; setting the mode to display mode clears the screen!
mov ah, 0 ; set display mode function.
mov al, 13h ; mode 13h = 320x200 pixels, 256 colors.
int 10h ; set it!
call drawPiano
call playPiano
; back to text mode
mov ah, 0
mov al, 2
int 10h
exit:
; exit program
mov ax, 4c00h
int 21h
END start
; mov ah, 0eh ;0eh = 14
; mov al, 'c'
; xor bx, bx ;Page number zero
; mov bl, 0ch ;Color is red
; int 10h
; mov dl, 20 ;Column
; mov dh, 12 ;Row
; mov bh, 0 ;Display page
; mov ah, 02h ;SetCursorPosition
; int 10h
; mov al, 'x'
; inc al
; mov bl, 0Ch ;Color is red
; mov bh, 0 ;Display page
; mov ah, 0Eh ;Teletype
; int 10h