-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathed.asm
executable file
·9804 lines (6689 loc) · 152 KB
/
ed.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
.MODEL LARGE
.STACK
.DATA
OWNER DB "KAAN ARI","$"
SCHL_NUM DB "21628042","$"
BUTTON1 DB "LOAD FILE","$"
BUTTON2 DB "NEW FILE","$"
BUTTON3 DB "SAVE FILE","$"
BUTTON4 DB "RESUME","$"
BUTTON5 DB "EXIT","$"
LOAD_MSG DB "Please enter the Filename to Load:","$"
NEWFILE_MSG DB "Please enter the Filename to Create:","$"
CLEAR_MSG DB "CLEAR",'$'
OK_MSG DB "OK","$"
FILE_MSG DB "File : ","$"
FILE_EXIST_MSG DB "FILE EXIST!","$"
LINE_MSG DB "Line : ","$"
COL_MSG DB "Column : ","$"
HACETTEPE_LOGO DB 00h,00h,00h,00h,00h,00h,00h,00h,00h,00h,00h,00h,00h,00h,'$'
;---------EDITOR FOOTER TEXTS-------------
F1_MSG DB "F1 Menu","$"
F2_MSG DB "F2 Load","$"
F3_MSG DB "F3 New","$"
F4_MSG DB "F4 Save","$"
F5_MSG DB "F5 Find","$"
F6_MSG DB "F6 Find-Replace","$"
F7_MSG DB "F7 Capitalize Sentences",'$'
F8_MSG DB "F8 Capitalize Words","$"
ESC_MSG DB "ESC Exit","$"
BLANK_FILE_MSG DB "THIS FIELD CAN NOT BE EMPTY","$"
FILE_NEXIST_MSG DB "FILE DOES NOT EXIST!","$"
FILENAME DB 12 DUP(?)
FILE_HANDLE DW ?
FILE_BUFFER DB ?
TEMP_PAGE DW ?
EOF_FLAG DW ?
CURSOR_X DW 0000h
CURSOR_Y DW 0000h
FILE_POINTER DW 0000h
FILE_POINTER_TEMP DW 0000h
NEWLINE_POINTERS DW 30 DUP(?)
NEXTLINE_TEMP DW 0000h
BACKLINE_TEMP DW 0000h
FILE_LEN DW 0000h
BACKSPACE_LINE DW 0000h
CAP_WORDS_FLAG DW 0000h
CAP_SENT_FLAG DW 0000h
FILE_CHANGED_FLAG DW 0000h
MENU_SELECTED_BUTTON DW 0000h
WANNA_QUIT_BUT DW 0000h
DISABLED_EDITOR DW 0000h
FILE_SAVED_MSG DB "File Saved.","$"
WANNA_QUIT_MSG DB "Do you want to QUIT without SAVE ?","$"
WANNA_LOAD_MSG DB "Do you want to LOAD without SAVE ?","$"
WANNA_SAVE_MSG DB "Choose one option to SAVE FILE:","$"
WANNA_NEW_MSG DB "Do you want to SAVE first ?","$"
SAVE_AS_MEN_MSG DB "Save as :","$"
FIND_MSG DB "Please enter the string to Search:","$"
FIND2_MSG DB "First enter the string to Search:","$"
FIND_REP_MSG DB "Replace ","$"
FIND_REP_MSG2 DB " with:","$"
ZERO_FOUND_MSG DB "NOT FOUND !","$"
SAVE_QUIT_MSG DB "SAVE/QUIT","$"
QUIT_MSG DB "QUIT","$"
SAVE_LOAD_MSG DB "SAVE/LOAD","$"
LOAD_MEN_MSG DB "LOAD","$"
SAVE_MEN_MSG DB "SAVE","$"
SAVE_AS_MSG DB "SAVE AS","$"
SAVE_NEW_MSG DB "SAVE/NEW","$"
NEW_MEN_MSG DB "NEW","$"
FIND_BTN DB "SEARCH","$"
REPLACE_MSG DB "REPLACE","$"
FOUND_MSG DB "TOT. FOUND : ","$"
FOUND2_MSG DB "IN THIS PAGE : ","$"
FOUND_TEMP DW 0000h
LAST_FILE_POINTER DW 0000h
FILENAME_OLD DB 12 DUP(?)
FIND_WORD DB 21 DUP(?)
FIND_WORD_LEN DW 0000h
REPLACE_WORD DB 21 DUP(?)
REPLACE_WORD_LEN DW 0000h
NEXTLINE_PAGES DW 50 DUP(0)
FOUND_NUM DW 0000h
FOUND_NUM_PAGE DW 0000h
FOUND_INDEX DW 50 DUP(?)
FOUND_PAGE DW 50 DUP(?)
FOUND_CURSOR DW 50 DUP(?)
FILE_RESTORE DB 5000 DUP(?)
FILE_DUMMY DB 5000 DUP(?)
.CODE
MAIN PROC FAR
CALL INITIALIZE_VGA ;INITIALIZE VGA
BACK_HOMEPAGE:
CALL HOMEPAGE ; DRAW HOMEPAGE
CALL CLEAR_SCREEN
CALL EDITOR
;CALL MENU
EXIT:
MOV BX,offset FILE_CHANGED_FLAG
MOV AX,[BX]
CMP AX,0
JZ EXIT_CHECK
CALL WANNA_QUIT
EXIT_CHECK:
CALL CLOSE_FILE
CALL CLEAR_SCREEN
MOV AH,4Ch ;go back
INT 21h ; to DOS.
MAIN ENDP
;-------------------------------------------------------------------------------------------------------------------------
;-------------------------------------------------GUI PROCEDURES----------------------------------------------------------
;-------------------------------------------------------------------------------------------------------------------------
;----------------------------------------------------------------
;----------------------------MAIN TEMPLATE-----------------------
;----------------------------------------------------------------
INITIALIZE_VGA PROC
MOV AX,@DATA
MOV DS,AX
MOV AX,012h ;VGA mode
INT 10h ;640 x 480 16 colors.
INT 10h
MOV AX,0A000h
MOV ES,AX ;ES points to the video memory.
RET
INITIALIZE_VGA ENDP
CLEAR_SCREEN PROC
MOV ax,18h
INT 10h
CALL INITIALIZE_VGA
RET
CLEAR_SCREEN ENDP
CURSOR_SET PROC ; PROC WILL SET CURSOR AT POSITION DL = COL,DH = ROW
;----ADJUST CURSOR----
MOV AH,02h ;settin cursor position
MOV BH,00h ;page number
INT 10h
RET
CURSOR_SET ENDP
;----------------HOMEPAGE AND MENU GUI PROC----------------------
HEADER PROC
CALL HCTTP_LOGO ; DRAWING HACETTEPE LOGO TOP ON THE SCREEN
MOV DX,03C4h ; dx = indexregister
MOV AX,0402h ; INDEX = MASK MAP,[COLOR][X]
OUT DX,AX ; write all the bitplanes.
MOV DI,0 ; DI pointer in the video memory.
MOV CX,1200 ; Counter for Header
MOV AX,0FFh ; write to every pixel.
REP STOSB ; fill the screen
;---DRAWING LOGO CURVE---
MOV BX,0FFFFh
MOV BP,15
L_HEADER:
XXXX
XXXX
XXXX
XXXX
XXXX
XXXX
XXXX
XXXX
XXXX
XXXX
XXXX
XXXX
XXXX
XXXX
XXXX
XXXX
XXXX
XXXX
XXXX
XXXX
XXXX
XXXX
XXXX
XXXX
XXXX
XXXX
XXXX
XXXX
MOV CX,0
MOV SI,16
L1_ROR_HEADER:
SHR BX,1
RCL CX,1
DEC SI
JNZ L1_ROR_HEADER
MOV BX,CX
NOT BX
XXXX
XXXX
XXXX
XXXX
XXXX
XXXX
XXXX
XXXX
XXXX
XXXX
XXXX
XXXX
XXXX
XXXX
XXXX
XXXX
XXXX
XXXX
XXXX
XXXX
XXXX
XXXX
XXXX
XXXX
XXXX
XXXX
XXXX
XXXX
DEC BP
JNZ L_HEADER
RET
HEADER ENDP
FOOTER_TEXT PROC
JNC COLORED_2
MOV CX,3
JMP SET_SI
COLORED_2:
MOV CX,2
SET_SI:
MOV SI,BX
L_FOOTER_TEXT_1:
MOV AL,[SI]
MOV BL,0F3h;White Foreground,Red Background 0F3 good
CALL PRINT_COLORED_TEXT
INC SI
LOOP L_FOOTER_TEXT_1
L_FOOTER_TEXT:
MOV AL,[SI]
MOV BL,0FBh;White Foreground,Red Background
CALL PRINT_COLORED_TEXT
INC SI
MOV BL,[SI]
CMP BL,"$"
JNZ L_FOOTER_TEXT
RET
FOOTER_TEXT ENDP
FOOTER PROC ; DRAWING FOOTER
CALL OWNERs_SIGNATURE
MOV BP,16
MOV BX,0000h
L1_FOOTER_SHAPE_MAIN:
MOV DX,03C4h ; dx = indexregister
MOV AX,0702h ; INDEX = MASK MAP,[COLOR][X]
OUT DX,AX ; write all the bitplanes.
MOV CX,34 ; Counter for Header
MOV AX,0FFh ; write to every pixel.
REP STOSB ; fill the screen
XXXX
XXXX
XXXX
XXXX
XXXX
XXXX
XXXX
XXXX
XXXX
XXXX
XXXX
XXXX
XXXX
XXXX
XXXX
XXXX
XXXX
XXXX
XXXX
XXXX
XXXX
XXXX
XXXX
XXXX
XXXX
XXXX
XXXX
XXXX
MOV CX,0
MOV SI,16
L1_ROR_FOOTER_MAIN:
SHR BX,1
RCL CX,1
DEC SI
JNZ L1_ROR_FOOTER_MAIN
MOV BX,CX
NOT BX
MOV DX,03C4h ; dx = indexregister
MOV AX,0702h ; INDEX = MASK MAP,[COLOR][X]
OUT DX,AX ; write all the bitplanes.
MOV CX,1 ; Counter for Header
MOV AL,BH ; write to every pixel.
MOV AH,BL
REP STOSW ; fill the screen
NOT BX
DEC DI
DEC DI
XXXX
XXXX
XXXX
XXXX
XXXX
XXXX
XXXX
XXXX
XXXX
XXXX
XXXX
XXXX
XXXX
XXXX
MOV DX,03C4h ; dx = indexregister
MOV ax,0402h ; INDEX = MASK MAP,[COLOR][X]
OUT dx,ax ; write all the bitplanes.
MOV cx,1440 ; Counter for Footer
MOV ax,0FFh ; write to every pixel.
REP STOSB ; fill the screen
RET
FOOTER ENDP
CLEAR_FRAME PROC ; CLEAR BUTTON AREA AND POPUP AREA , CLEARING SELECTED AREA WILL SAVE THE TIME !
MOV SI,DI
MOV DI,8340
MOV BP,DI
MOV BH,5
L_CLR_MAIN:
MOV DI,BP
MOV BL,30
L_CLR:
MOV dx,03C4h ; dx = indexregister
MOV ax,0402h ; INDEX = MASK MAP,[COLOR][X]
OUT dx,ax ; write all the bitplanes.
MOV cx,40 ; Counter for Gray
MOV ax,00h ; write to every pixel.
REP STOSB ; fill the screen
ADD DI,40
DEC BL
JNZ L_CLR
MOV DI,BP
MOV BL,30
L2_CLR:
XXXX
XXXX
XXXX
XXXX
XXXX
XXXX
XXXX
XXXX
XXXX
XXXX
XXXX
XXXX
XXXX
XXXX
XXXX
XXXX
XXXX
XXXX
XXXX
XXXX
XXXX
ADD DI,40
DEC BL
JNZ L3_CLR
ADD DI,5120-2400
MOV BP,DI
DEC BH
JNZ L_CLR_MAIN
MOV DI,SI
RET
CLEAR_FRAME ENDP
DRAW_BUTTONS PROC ; DRAW BUTTON, NUMBER OF STORED IN BL
L_ALL:
MOV BL,30
LB:
CALL CLEAR_BUTTONAREA
CALL DRAW_BUTTONCOLOR
DEC BL
CMP BL,0
JNZ LB
ADD DI,2720 ;PER LINE NUM x LINE NUM = 80 x 30 = 2400
DEC BH
CMP BH,0
JNZ L_ALL
MOV DI,SI
RET
DRAW_BUTTONS ENDP
CLEAR_BUTTONAREA PROC
MOV dx,03C4h ; dx = indexregister
MOV ax,0702h ; INDEX = MASK MAP,[COLOR][MEMORY MODE]
OUT dx,ax ; write all the bitplanes.
MOV cx,40 ; Counter for Gray
MOV ax,00h ; write to every pixel.
REP STOSB ; fill the screen
SUB DI,40
RET
CLEAR_BUTTONAREA ENDP
DRAW_BUTTONCOLOR PROC
MOV dx,03C4h ; dx = indexregister (try 03C6. its nicee)
MOV ax,0F02h ; INDEX = MASK MAP,[COLOR][MEMORY MODE]
OUT dx,ax ; write all the bitplanes.
MOV cx,7 ; Counter for Gray
MOV ax,0FFh ; write to every pixel.
REP STOSB ; fill the screen
MOV dx,03C4h ; dx = indexregister (try 03C6. its nicee)
MOV ax,0402h ; INDEX = MASK MAP,[COLOR][MEMORY MODE]
OUT dx,ax ; write all the bitplanes.
MOV cx,33 ; Counter for Gray
MOV ax,0FFh ; write to every pixel.
REP STOSB ; fill the screen
SUB DI,40
ADD DI,80
RET
DRAW_BUTTONCOLOR ENDP
BUTTON_BACKGROUND PROC
MOV SI,DI
MOV DI,0
MOV dx,03C4h ; dx = indexregister (try 03C6. its nicee)
MOV ax,0002h ; INDEX = MASK MAP,[COLOR][MEMORY MODE]
OUT dx,ax ; write all the bitplanes.
MOV cx,36000 ; Counter for Gray
MOV ax,00h ; write to every pixel.
REP STOSB ; fill the screen
MOV DI,0
MOV dx,03C4h ; dx = indexregister (try 03C6. its nicee)
MOV ax,0402h ; INDEX = MASK MAP,[COLOR][MEMORY MODE]
OUT dx,ax ; write all the bitplanes.
MOV cx,36000 ; Counter for RED BACKGROUND
MOV ax,0FFh ; write to every pixel.
REP STOSB ; fill the screen
MOV DI,SI
RET
BUTTON_BACKGROUND ENDP
BUTTON_TEXT PROC ; Printing BUTTON TEXTs
MOV AX,@data ;ES -> DATA Segment
MOV es,ax
JNC HMPG ; IF carry is set before CALL this PROC it will display MENU
MOV DH,7 ; row to put string
MOV dl,66 ; column to put string
MOV BX,OFFSET BUTTON1 ;LOAD BUTTON
CALL PRINT_BUTTON_TEXT_MENU
MOV BX,OFFSET BUTTON2 ;NEW FILE BUTTON
add dh,4 ; row to put string
CALL PRINT_BUTTON_TEXT_MENU
MOV BX,OFFSET BUTTON3 ;SAVE FILE BUTTON
add dh,4 ; row to put string
CALL PRINT_BUTTON_TEXT_MENU
MOV BX,OFFSET BUTTON4 ;RESUME BUTTON
add dh,4 ; row to put string
add dl,1 ; column to put string
CALL PRINT_BUTTON_TEXT_MENU
MOV BX,OFFSET BUTTON5 ;EXIT BUTTON
add dh,4 ; row to put string
add dl,1 ; column to put string
CALL PRINT_BUTTON_TEXT_MENU
JMP PASS3
HMPG:
MOV DH,11 ; row to put string
MOV dl,39 ; column to put string
MOV BX,OFFSET BUTTON1 ;LOAD BUTTON
CALL PRINT_BUTTON_TEXT
MOV BX,OFFSET BUTTON2 ;NEW FILE BUTTON
add dh,4 ; row to put string
CALL PRINT_BUTTON_TEXT
MOV BX,OFFSET BUTTON5 ;EXIT BUTTON
add dh,4 ; row to put string
add dl,2 ; column to put string
CALL PRINT_BUTTON_TEXT
PASS3:
MOV AX,0A000H ;ES -> Video Memory
MOV ES,AX
RET
BUTTON_TEXT ENDP
PRINT_BUTTON_TEXT_MENU PROC
MOV SI,BX
CALL CURSOR_SET
L_TEXT_M:
MOV AL,[SI]
MOV BL,0FBh;White Foreground,Red Background
CALL PRINT_COLORED_TEXT
INC SI
MOV BL,[SI]
CMP BL,"$"
JNZ L_TEXT_M
RET
PRINT_BUTTON_TEXT_MENU ENDP
PRINT_BUTTON_TEXT PROC
MOV CX,0
DEC BX
countCHR:
INC BX
INC CX
MOV AL,[BX]
CMP AL,'$'
JNZ countCHR
DEC CX ;length of string
SUB BX,CX
MOV BP,BX
MOV ah,13h ; function 13 - write string
MOV al,01h ; attrib in bl,move cursor
MOV bh,00h ; video page 0
MOV bl,0Fh ; attribute - white
INT 10h ; call BIOS service
RET
PRINT_BUTTON_TEXT ENDP
;-----------------------------------------------------------------
;-----------------------TEXT EDITOR GUI PROC----------------------
;-----------------------------------------------------------------
HEADER_TEXT PROC
;-------------WRITING FILENAME-------------
MOV DH,0 ;row
MOV DL,1 ;column
CALL CURSOR_SET
MOV BX,OFFSET FILE_MSG
MOV SI,BX ;EXIT BUTTON
L_HEADER_TEXT:
MOV AL,[SI]
MOV BL,0F3h;White Foreground,Red Background
CALL PRINT_COLORED_TEXT
INC SI
MOV BL,[SI]
CMP BL,"$"
JNZ L_HEADER_TEXT
MOV BX,OFFSET FILENAME
MOV SI,BX ;EXIT BUTTON
L_HEADER_TEXT2:
MOV AL,[SI]
MOV BL,0FBh;White Foreground,Red Background
CALL PRINT_COLORED_TEXT
INC SI
MOV BL,[SI]
CMP BL,"."
JNZ L_HEADER_TEXT2
MOV CX,4
L_HEADER_TEXT2_2:
MOV AL,[SI]
MOV BL,0FBh;White Foreground,Red Background
CALL PRINT_COLORED_TEXT
INC SI
MOV BL,[SI]
LOOP L_HEADER_TEXT2_2
;--WRITING LINE--
MOV DH,0 ;row
MOV DL,54 ;column
CALL CURSOR_SET
MOV BX,OFFSET LINE_MSG
MOV SI,BX ;EXIT BUTTON
L_HEADER_TEXT3:
MOV AL,[SI]
MOV BL,0FBh;White Foreground,Red Background
CALL PRINT_COLORED_TEXT
INC SI
MOV BL,[SI]
CMP BL,"$"
JNZ L_HEADER_TEXT3
;--WRITING COLUMN--
MOV BX,OFFSET COL_MSG
MOV SI,BX ;EXIT BUTTON
MOV DH,0 ;row
MOV DL,67 ;column
CALL CURSOR_SET
L_HEADER_TEXT4:
MOV AL,[SI]
MOV BL,0FBh;White Foreground,Red Background
CALL PRINT_COLORED_TEXT
INC SI
MOV BL,[SI]
CMP BL,"$"
JNZ L_HEADER_TEXT4
;--DRAWING NUMBER BOX FOR LINE AND COLUMN--
MOV SI,DI
MOV DI,75+80
MOV BX,12
L_HEADER_TEXT5:
MOV DX,03C4h ; dx = indexregister
MOV AX,0302h ; INDEX = MASK MAP,[COLOR][X]
OUT DX,AX ; write all the bitplanes.
MOV CX,1 ; Counter for Header
MOV AX,00Fh ; write to every pixel.
REP STOSB ; fill the screen
XXXX
XXXX
XXXX
XXXX
XXXX
XXXX
XXXX
XXXX
XXXX
XXXX
XXXX
XXXX
XXXX
XXXX
SUB DI,4
ADD DI,80
DEC BX
JNZ L_HEADER_TEXT5
MOV DI,60+80
MOV BX,12
L_HEADER_TEXT6:
MOV DX,03C4h ; dx = indexregister
MOV AX,0302h ; INDEX = MASK MAP,[COLOR][X]
OUT DX,AX ; write all the bitplanes.
MOV CX,1 ; Counter for Header
MOV AX,00Fh ; write to every pixel.
REP STOSB ; fill the screen
XXXX
XXXX
XXXX
XXXX
XXXX
XXXX
XXXX
XXXX
XXXX
XXXX
XXXX
XXXX
XXXX
XXXX
SUB DI,5
ADD DI,80
DEC BX
JNZ L_HEADER_TEXT6
MOV DI,SI
RET
HEADER_TEXT ENDP
BACKGROUND_GRAY PROC ; DRAWING BACKGROUND COLOR
MOV dx,03C4h ; dx = indexregister
MOV ax,0702h ; INDEX = MASK MAP,[COLOR][X]
OUT dx,ax ; write all the bitplanes.
MOV cx,33440 ; Counter for Gray
MOV ax,0FFh ; write to every pixel.
REP STOSB ; fill the screen
RET
BACKGROUND_GRAY ENDP
BACKGROUND_GRAY_EDITOR PROC ; DRAWING BACKGROUND COLOR
MOV dx,03C4h ; dx = indexregister
MOV ax,0702h ; INDEX = MASK MAP,[COLOR][X]
OUT dx,ax ; write all the bitplanes.
MOV cx,16640 ; Counter for Gray
MOV ax,0FFFFh ; write to every pixel.
REP STOSW ; fill the screen
RET
BACKGROUND_GRAY_EDITOR ENDP
BACKGROUND_EDITOR_MENU_CLEAR PROC
MOV DI,2400
MOV dx,03C4h ; dx = indexregister
MOV ax,0F02h ; INDEX = MASK MAP,[COLOR][X]
OUT dx,ax ; write all the bitplanes.
MOV cx,16640 ; Counter for Gray
MOV ax,0h ; write to every pixel.
REP STOSW ; fill the screen
RET
BACKGROUND_EDITOR_MENU_CLEAR ENDP
FOOTER_EDITOR PROC ; DRAWING FOOTER
MOV BP,16
MOV BX,0000h
L1_FOOTER_SHAPE:
NOT BX
MOV DX,03C4h ; dx = indexregister
MOV AX,0702h ; INDEX = MASK MAP,[COLOR][X]
OUT DX,AX ; write all the bitplanes.
MOV CX,1 ; Counter for Header
MOV AL,BH ; write to every pixel.
MOV AH,BL
REP STOSW ; fill the screen
NOT BX
DEC DI
DEC DI
MOV DX,03C4h ; dx = indexregister
MOV AX,0402h ; INDEX = MASK MAP,[COLOR][X]
OUT DX,AX ; write all the bitplanes.
MOV CX,1 ; Counter for Header
MOV AL,0FFh ; write to every pixel.
MOV AH,0FFh
REP STOSW ; fill the screen
XXXX
XXXX
XXXX
XXXX
XXXX
XXXX
XXXX
MOV CX,0
MOV SI,16
L1_ROR_FOOTER:
SHR BX,1
RCL CX,1
DEC SI
JNZ L1_ROR_FOOTER
MOV BX,CX
NOT BX
MOV DX,03C4h ; dx = indexregister
MOV AX,0702h ; INDEX = MASK MAP,[COLOR][X]
OUT DX,AX ; write all the bitplanes.
MOV CX,1 ; Counter for Header
MOV AL,BH ; write to every pixel.
MOV AH,BL
REP STOSW ; fill the screen
NOT BX
DEC DI
DEC DI
MOV DX,03C4h ; dx = indexregister
MOV AX,0402h ; INDEX = MASK MAP,[COLOR][X]
OUT DX,AX ; write all the bitplanes.
MOV CX,1 ; Counter for Header
MOV AL,0FFh ; write to every pixel.
MOV AH,0FFh
REP STOSW ; fill the screen
MOV CX,0
MOV SI,16
L1_ROR_FOOTER2:
SHR BX,1
RCL CX,1
DEC SI
JNZ L1_ROR_FOOTER2
MOV BX,CX
STC
RCL BX,1