forked from historicalsource/defender
-
Notifications
You must be signed in to change notification settings - Fork 0
/
MESS0.SRC
executable file
·952 lines (952 loc) · 22.5 KB
/
MESS0.SRC
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
TTL MESS0 - MESSAGE BLOCK REV 0 - 12/22/80
NMLIST
NOGEN
SETDP $A0
*
* EQUATES
*
INITS EQU $A000
PNUMB EQU INITS+6
INITDS EQU PNUMB+2
SCOREN EQU INITDS+4
ORG $A03A LOCAL RAM HERE
*
* LOCAL RAM VARIABLES DURING DIAGS
*
TEMP1A RMB 1
TEMP1B RMB 1
TEMP1C RMB 1
TEMP2A RMB 2
TEMP2B RMB 2
TEMP2C RMB 2
TEMP2D RMB 2
TMPAD RMB 2 XHATCH
ASBUFF RMB 1 ADVANCE SWITCH WITH AUTO BUFFER
ASLAST RMB 1 ADVANCE SWITCH WITH AUTO LAST POSITION
ASCNTR RMB 1 ADVANCE SWITCH WITH AUTO COUNTER
CURSR2 RMB 2 USER CURSER
CHARSP RMB 1 HORIZONTAL SPACE BETWEEN CHARACTERS(TEXT ROUTINE)
LINESP RMB 1 VERTICAL SPACING BETWEEN LINE CENTERS(TEXT ROUTINE)
TOPL RMB 2 TOP LEFT ADDRESS(TEXT ROUTINE)
CURSER RMB 2 CURSER ADDRESS(TEXT ROUTINE)
MESPT RMB 2 MESSAGE POINTER(TEXT ROUTINE)
WORDPT RMB 2 WORD POINTER(TEXT ROUTINE)
MESEND RMB 2 MESSAGE END(TEXT ROUTINE)
SPACEF RMB 1 SPACE FLAG(TEST ROUTINE)
NUMBER RMB 2 NUMBER(NUMBER ROUTINE)
ROMPTR RMB 2 ROM TABLE POINTER(COMPREHENSIVE ROM TEST)
LSCC00 RMB 1 LAST STATE OF PAI AT CC00
LSCC04 RMB 1 LAST STATE OF PAI AT CC04 PLAYER 1
LSCC06 RMB 1 LAST STATE OF PAI AT CC06 PLAYER 1
LCC042 RMB 1 LAST STATE OF PAI AT CC04 PLAYER 2
LCC062 RMB 1 LAST STATE OF PAI AT CC06 PLAYER 2
DISTBL RMB 38 DISPLAY TABLE(SWITCH TEST)
*
*
ORG $C000
*
* VECTORS INTO MESSAGE ROM
*
N0V FDB N0
TV1 JMP WTEXTB
TV2 JMP ETEXTB
TV3 JMP WTEXTC
TV4 JMP ETEXTC
TV5 JMP WNUMBB
TV6 JMP ENUMBB
TV7 JMP WNUMBC
TV8 JMP ENUMBC
TV9 JMP ERASTK
TV10 JMP DISSTK
TV11 JMP OPER$
TV12 JMP OPERIN
RMB 9 EXPANSION FOR 3 MORE
*
* CHECKBYTE
*
FDB $FFFF
*
* OPERATOR INSTRUCTION TABLE
*
IGAMEO FDB VINS2,VINS3 GAME OVER
IROMFL FDB VINS4,0 ROM FAILURE
IROMDO FDB VINS4,0 ROM TEST DONE
IRAMTS FDB VINS5,0 RAM TEST
IRAMFL FDB VINS6,0 RAM FAILURE
IRAMDO FDB VINS6,0 RAM TEST DONE
ICMSDO FDB VINS7,0 CMOS RAM TEST DONE
ICOLTS FDB VINS5,0 COLOR RAM TEST
ICOLDO FDB VINS8,0 COLOR RAM TEST DONE
IAUDTS FDB VINS9,VINS10 AUDIO TEST
ISWTTS FDB VINS11,0 SWITCH TEST
IMONTS FDB VINS2,VINS12 MONITOR TEST
IAUD1 FDB VINS13,VINS14 AUDIT/GAME ADJUST
IAUD2 FDB VINS17,0 PART TWO
*
* MESSAGE VECTORS
*
VINITT FDB INITT "INITIAL TESTS INDICATE "
VUNIOK FDB UNIOK "UNIT OK "
VWROM FDB WROM "ROM "
VWRAM FDB WRAM "RAM "
VROMFL FDB ROMFL "ROM FAILURE "
VRAMFL FDB RAMFL "RAM FAILURE "
VGAMOV FDB GAMOV "GAME OVER "
VALROM FDB ALROM "ALL ROMS OK "
VRAMTS FDB RAMTS "RAM TEST "
VNORAM FDB NORAM "NO RAM ERRORS DETECTED "
VCMSFL FDB CMSFL "CMOS RAM FAILURE
* TEST MUST BE ENTERED
* WITH COIN DOOR OPEN "
VCMSOK FDB CMSOK "CMOS RAM OK "
VCMSAB FDB CMSAB "MULTIPLE RAM FAILURE,
* CMOS RAM CAN NOT BE TESTED "
VCOLTS FDB COLTS "COLOR RAM TEST
* VERTICAL COLOR BARS INDICATE
* COLOR RAM FAILURE "
VAUDTS FDB AUDTS "AUDIO TEST
* SOUND "
VSWTTS FDB SWTTS "SWITCH TEST "
VMONTS FDB MONTS "MONITOR TEST PATTERNS "
VSW0 FDB SW0 "AUTO UP "
VSW1 FDB SW1 "ADVANCE "
VSW2 FDB SW2 "RIGHT COIN "
VSW3 FDB SW3 "HIGHSCORE RESET "
VSW4 FDB SW4 "LEFT COIN "
VSW5 FDB SW5 "CENTER COIN "
VSW6 FDB SW6 "INVALID SWITCH "
VSW7 FDB SW7 "INVALID SWITCH "
VSW8 FDB SW8 "FIRE "
VSW9 FDB SW9 "THRUST "
VSWA FDB SWA "SMART BOMB "
VSWB FDB SWB "HYPERSPACE "
VSWC FDB SWC "TWO PLAYERS "
VSWD FDB SWD "ONE PLAYER "
VSWE FDB SWE "REVERSE "
VSWF FDB SWF "DOWN "
VSW10 FDB SW10 "UP "
VSW11 FDB SW11 "INVALID SWITCH "
VSW12 FDB SW12 "INVALID SWITCH "
VSW13 FDB SW13 "INVALID SWITCH "
VSW14 FDB SW14 "INVALID SWITCH "
VSW15 FDB SW15 "INVALID SWITCH "
VSW16 FDB SW16 "INVALID SWITCH "
VSW17 FDB SW17 "INVALID SWITCH "
VINS1 FDB INS1 "PRESS ADVANCE WITH SWITCH SET FOR: "
VINS2 FDB INS2 "AUTO FOR GAME AUDIT, GAME ADJUSTMENT "
VINS3 FDB INS3 "MANUAL FOR ROM TEST "
VINS4 FDB INS4 "AUTO FOR RAM TEST "
VINS5 FDB INS5 "AUTO TO EXIT TEST "
VINS6 FDB INS6 "AUTO FOR CMOS RAM TEST "
VINS7 FDB INS7 "AUTO FOR COLOR RAM TEST "
VINS8 FDB INS8 "AUTO FOR AUDIO TEST "
VINS9 FDB INS9 "AUTO FOR SWITCH TEST "
VINS10 FDB INS10 "MANUAL TO TEST AN INDIVIDUAL SOUND "
VINS11 FDB INS11 "AUTO FOR MONITOR TEST PATTERNS "
VINS12 FDB INS12 "MANUAL TO STEP THRU PATTERNS "
VINS13 FDB INS13 "AUTO FOR GAME OVER"
VINS14 FDB INS14 "MANUAL TO STEP THRU ADJUST"
VINS15 FDB INS15 "WILLIAMS DEFENDER"
VINS16 FDB INS16 "PRESS ADV TO STEP THRU TEST"
VINS17 FDB INS17 "PRESS HIGH SCORE RESET"
*
* AMODE MESSAGE VECTORS
*
LANDV FDB LAND
MUTV FDB MUT
SWRMPV FDB SWRMP
BOMBV FDB BOMBR
SWARMV FDB SWARM
BAITV FDB BAIT
CREDV FDB CRED
SCANV FDB SCAN
ELECV FDB ELEC
*
* EUGENE'S VECTORS
*
PLYR1 FDB PLAYR1
PLYR2 FDB PLAYR2
BONSX FDB BONUSX
P1S FDB P1STA
P12S FDB P12STA
ATWV FDB ATW "ATTACK WAVE"
COMPV FDB COMP "COMPLETED"
*
* SAM'S VECTORS
*
HOFV FDB HOF
INIT$V FDB INIT$
HALLDV FDB HALLD
HALENV FDB HALEN
VMEND FDB MEND END OF MESSAGES
*
* MESSAGES
*
INITT FDB INITAL,TESTS,INDCAT
UNIOK FDB UNIT,OK
WROM FDB ROM
WRAM FDB RAM
ROMFL FDB ROM,FAILUR
RAMFL FDB RAM,FAILUR
GAMOV FDB GAME,OVER
ALROM FDB ALL,ROMS,OK
RAMTS FDB RAM,TEST
NORAM FDB NO,RAM,ERRORS,DETECT
CMSFL FDB CMOSW,RAM,FAILUR
FCB RTC,$28,$A0
FDB TEST,MUST,BE,ENTERD
FCB RLF
FDB WITH,COINW,DOOR,OPEN
CMSOK FDB CMOSW,RAM,OK
CMSAB FDB MULTIP,RAM,FAILUR
FCB HMC,$FE
FDB CCOMA
FCB VMT,$10,HMT,$F8
FDB CMOSW,RAM,CAN,NOT,BE,TESTED
COLTS FDB COLOR,RAM,TEST
FCB VMT,$30,HMT,$E8
FDB VERTIC,COLOR,BARS,INDCAT
FCB RLF,HMC,$FC
FDB COLOR,RAM,FAILUR
AUDTS FDB AUDIO,TEST
FCB RLF,RLF,HMC,4
FDB SOUND
SWTTS FDB SWITCH,TEST
MONTS FDB MONITR,TEST,PATRNS
SW0 FDB AUTO,UP
SW1 FDB ADVANC
SW2 FDB RIGHT,COINW
SW3 FDB HSR
SW4 FDB LEFT,COINW
SW5 FDB CENTER,COINW
SW6 FDB INVSW
SW7 FDB INVSW
SW8 FDB FIRE
SW9 FDB THRUST
SWA FDB SMART,BOMB
SWB FDB HYPERS
SWC FDB TWO,PLAYRS
SWD FDB ONE,PLAYER
SWE FDB REVERS
SWF FDB DOWN
SW10 FDB UP
SW11 FDB INVSW
SW12 FDB INVSW
SW13 FDB INVSW
SW14 FDB INVSW
SW15 FDB INVSW
SW16 FDB INVSW
SW17 FDB INVSW
INS1 FDB PRESS,ADVANC,WITH,SWITCH,SET,FOR
FCB HMC,$FE
FDB CCOLON
INS2 FDB AUTO,FOR,AUDIT
FCB HMC,$FE
FDB CCOMA,GAME,ADJUST
INS3 FDB MANUAL,FOR,ROM,TEST
INS4 FDB AUTO,FOR,RAM,TEST
INS5 FDB AUTO,TO,EXIT,TEST
INS6 FDB AUTO,FOR,CMOSW,RAM,TEST
INS7 FDB AUTO,FOR,COLOR,RAM,TEST
INS8 FDB AUTO,FOR,AUDIO,TEST
INS9 FDB AUTO,FOR,SWITCH,TEST
INS10 FDB MANUAL,TO,TEST,INDIVL,SOUNDS
INS11 FDB AUTO,FOR,MONITR,TEST,PATRNS
INS12 FDB MANUAL,TO,STEP,THRU,PATRNS
INS13 FDB AUTO,FOR,GAME,OVER
INS14 FDB MANUAL,TO,STEP,THRU,ADJUST
INS15 FDB WILLAM,DEFEND
INS16 FDB PRESS,ADVANC,TO,STEP,THRU,TEST
INS17 FDB PRESS,HSR,TO,MAKE,CHANGE
*
* AMODE MESSAGES
*
LAND FDB LANDER
FCB RLF,HMC,6
FDB N150
MUT FDB MUTANT
FCB RLF,HMC,6
FDB N150
SWRMP FDB POD
FCB RLF,HMC,0
FDB N1000
BOMBR FDB BOMBER
FCB RLF,HMC,6
FDB N250
SWARM FDB SWARMR
FCB RLF,HMC,8
FDB N150
BAIT FDB BAITER
FCB RLF,HMC,6
FDB N200
CRED FDB CREDW$
SCAN FDB SCANER
ELEC FDB ELECTR
FCB RLF,RLF,HMC,12
FDB PRESEN
*
* EUGENE'S MESSAGES
*
PLAYR1 FDB PLAYER,ONE
PLAYR2 FDB PLAYER,TWO
BONUSX FDB BX
P1STA FDB PRESS,ONE,PLAYER,START
P12STA FDB PRESS,ONE,OR,TWO,PLAYER,START
ATW FDB ATTACK,WAVE
COMP FDB COMPLE
*
* SAM'S MESSAGES
*
HOF FDB YOU,HAVE,QUALIF,FOR
FCB RLF
FDB THE,DEFEND,H.O.F
FCB RLF,RLF
FDB SELECT,INITLS,WITH,UP,DOWN,STICK
FCB RLF,RLF
FDB PRESS,FIRE,TO,ENTER,INITAL
INIT$ FDB INITS
FCB HMT,8
FDB INITS+2
FCB HMT,16
FDB INITS+4
HALLD FDB H.O.F
FCB RTC,$22,$68
FDB TODAYS
FCB HMT,$3E
FDB ALL,TIME
FCB RLF,HMC,$FC
FDB GREAT
FCB HMT,$3D
FDB GREAT
HALEN FDB PNUMB
FCB HMT,$5
FDB INITDS
FCB HMT,$13
FDB SCOREN
MEND EQU *
*
* WORDS
*
ADJUST FCC "ADJUSTMENT/"
ADVANC FCC "ADVANCE/"
ALL FCC "ALL/"
ATTACK FCC "ATTACK/"
AUDIO FCC "AUDIO/"
AUDIT FCC "AUDIT/"
AUTO FCC "AUTO/"
BAITER FCC "BAITER/"
BARS FCC "BARS/"
BE FCC "BE/"
BOMB FCC "BOMB/"
BOMBER FCC "BOMBER/"
BX FCC "BONUS X/"
CAN FCC "CAN/"
CCOMA FCC ",/"
CCOLON FCC ":/"
CENTER FCC "CENTER/"
CHANGE FCC "CHANGE/"
CMOSW FCC "CMOS/"
COINW FCC "COIN/"
COLOR FCC "COLOR/"
COMPLE FCC "COMPLETED/"
CREDW FCC "CREDIT/"
CREDW$ FCC "CREDITS:/"
DEFEND FCC "DEFENDER/"
DETECT FCC "DETECTED/"
DOOR FCC "DOOR/"
DOWN FCC "DOWN/"
ELECTR FCC "ELECTRONICS INC./"
ENTER FCC "ENTER/"
ENTERD FCC "ENTERED/"
ERRORS FCC "ERRORS/"
EXIT FCC "EXIT/"
FAILUR FCC "FAILURE/"
FIRE FCC "FIRE/"
FOR FCC "FOR/"
GAME FCC "GAME/"
GREAT FCC "GREATEST/"
H.O.F FCC "HALL OF FAME/"
HAVE FCC "HAVE/"
HSR FCC "HIGHSCORE RESET/"
HYPERS FCC "HYPERSPACE/"
INDCAT FCC "INDICATE/"
INDIVL FCC "INDIVIDUAL/"
INITAL FCC "INITIAL/"
INITLS FCC "INITIALS/"
INVSW FCC "INVALID SWITCH/"
LANDER FCC "LANDER/"
LEFT FCC "LEFT/"
MAKE FCC "MAKE/"
MANUAL FCC "MANUAL/"
MONITR FCC "MONITOR/"
MULTIP FCC "MULTIPLE/"
MUST FCC "MUST/"
MUTANT FCC "MUTANT/"
N150 FCC "150/"
N200 FCC "200/"
N250 FCC "250/"
N1000 FCC "1000/"
NO FCC "NO/"
NOT FCC "NOT/"
OK FCC "OK/"
ONE FCC "ONE/"
OPEN FCC "OPEN/"
OR FCC "OR/"
OVER FCC "OVER/"
PATRNS FCC "PATTERNS/"
PLAYER FCC "PLAYER/"
PLAYRS FCC "PLAYERS/"
POD FCC " POD/"
PRESEN FCC "PRESENTS/"
PRESS FCC "PRESS/"
QUALIF FCC "QUALIFIED/"
RAM FCC "RAM/"
REVERS FCC "REVERSE/"
RIGHT FCC "RIGHT/"
ROM FCC "ROM/"
ROMS FCC "ROMS/"
SCANER FCC "SCANNER/"
SELECT FCC "SELECT/"
SET FCC "SET/"
SLAM FCC "SLAM/"
SMART FCC "SMART/"
SOUND FCC "SOUND/"
SOUNDS FCC "SOUNDS/"
START FCC "START/"
STEP FCC "STEP/"
STICK FCC "STICK/"
SWARMR FCC "SWARMER/"
SWITCH FCC "SWITCH/"
TEST FCC "TEST/"
TESTED FCC "TESTED/"
TESTS FCC "TESTS/"
THE FCC "THE/"
THRU FCC "THRU/"
THRUST FCC "THRUST/"
TILT FCC "TILT/"
TIME FCC "TIME/"
TO FCC "TO/"
TODAYS FCC "TODAYS/"
TWO FCC "TWO/"
UNIT FCC "UNIT/"
UP FCC "UP/"
VERTIC FCC "VERTICAL/"
WAVE FCC "WAVE/"
WILLAM FCC "WILLIAMS/"
WITH FCC "WITH/"
YOU FCC "YOU/"
*
* CHARACTER DESCRIPTOR TABLE
*
CHRTBL FDB $0108,SPACE SPACE DESCRIPTER TABLE
FDB $0108,EXCLPT ESCLAMATION POINT
FDB $0108,COMMA COMMA
FDB $0308,QUESMK QUESTION MARK
FDB $0108,PERIOD PERIOD
FDB $0308,QUESMK QUESTION MARK
N0 FDB $0308,NUMBR0 NUMBER 0
FDB $0308,NUMBR1 NUMBER 1
FDB $0308,NUMBR2 NUMBER 2
FDB $0308,NUMBR3 NUMBER 3
FDB $0308,NUMBR4 NUMBER 4
FDB $0308,NUMBR5 NUMBER 5
FDB $0308,NUMBR6 NUMBER 6
FDB $0308,NUMBR7 NUMBER 7
FDB $0308,NUMBR8 NUMBER 8
FDB $0308,NUMBR9 NUMBER 9
FDB $0108,COLON COLON
FDB $0308,QUESMK QUESTION MARK
ALPHA0 FDB $0308,BLANK BLANK BLOCK
FDB $0308,LETTRA LETTER A
FDB $0308,LETTRB LETTER B
FDB $0308,LETTRC LETTER C
FDB $0308,LETTRD LETTER D
FDB $0308,LETTRE LETTER E
FDB $0308,LETTRF LETTER F
FDB $0308,LETTRG LETTER G
FDB $0308,LETTRH LETTER H
FDB $0208,LETTRI LETTER I
FDB $0308,LETTRJ LETTER J
FDB $0308,LETTRK LETTER K
FDB $0308,LETTRL LETTER L
FDB $0408,LETTRM LETTER M
FDB $0308,LETTRN LETTER N
FDB $0308,LETTRO LETTER O
FDB $0308,LETTRP LETTER P
FDB $0308,LETTRQ LETTER Q
FDB $0308,LETTRR LETTER R
FDB $0308,LETTRS LETTER S
FDB $0308,LETTRT LETTER T
FDB $0308,LETTRU LETTER U
FDB $0308,LETTRV LETTER V
FDB $0408,LETTRW LETTER W
FDB $0308,LETTRX LETTER X
FDB $0308,LETTRY LETTER Y
FDB $0308,LETTRZ LETTER Z
*
* CHARACTERS
*
*SPACE AND BLANK
SPACE EQU *
BLANK FDB 0,0,0,0,0,0
FDB 0,0,0,0,0,0 (BSZ 3*8)
* EXCLAMATION POINT
EXCLPT FDB $0101,$0101,$0100,$0100
* COMMA
COMMA FDB $0000,$0000,$0001,$0110
* PERIOD
PERIOD FDB $0000,$0000,$0000,$0100
* NUMBER 0
NUMBR0 FDB $0101,$0101,$0101,$0100
FDB $1100,$0000,$0000,$1100
FDB $1111,$1111,$1111,$1100
* NUMBER 1
NUMBR1 FDB $0000,$0100,$0000,$0000
FDB $0111,$1000,$0000,$0000
FDB $1111,$1111,$1111,$1100
* NUMBER 2
NUMBR2 FDB $0101,$0000,$0001,$0100
FDB $1100,$0001,$1000,$1100
FDB $1111,$1110,$0000,$1100
* NUMBER 3
NUMBR3 FDB $0100,$0000,$0000,$0100
FDB $1100,$0011,$0000,$1100
FDB $1111,$1111,$1111,$1100
* NUMBER 4
NUMBR4 FDB $0000,$0101,$0000,$0000
FDB $0110,$0011,$0000,$0000
FDB $1111,$1111,$1111,$1100
* NUMBER 5
NUMBR5 FDB $0101,$0101,$0000,$0100
FDB $1110,$1011,$0000,$1100
FDB $1100,$0011,$0101,$1100
* NUMBER 6
NUMBR6 FDB $0101,$0101,$0101,$0100
FDB $1110,$1011,$1010,$1100
FDB $1100,$0011,$0101,$1100
* NUMBER 7
NUMBR7 FDB $0100,$0000,$0001,$0100
FDB $1100,$0001,$1110,$1000
FDB $1111,$1110,$0000,$0000
* NUMBER 8
NUMBR8 FDB $0101,$0100,$0101,$0100
FDB $1110,$1011,$1010,$1100
FDB $1101,$0110,$0101,$1100
* NUMBER 9
NUMBR9 FDB $0101,$0101,$0000,$0100
FDB $1110,$1011,$0000,$1100
FDB $1101,$0111,$0101,$1100
* COLON
COLON FDB $0000,$0100,$0001,$0000
* QUESTION MARK
QUESMK FDB $0101,$0000,$0000,$0000
FDB $1100,$0001,$0100,$0100
FDB $1111,$1110,$0000,$0000
* LETTER A
LETTRA FDB $0101,$0101,$0101,$0100
FDB $1100,$0011,$0000,$0000
FDB $1111,$1111,$1111,$1100
* LETTER B
LETTRB FDB $0101,$0101,$0101,$0100
FDB $1100,$0011,$0000,$1100
FDB $1111,$1111,$1111,$1100
* LETTER C
LETTRC FDB $0101,$0101,$0101,$0100
FDB $1110,$1010,$1010,$1100
FDB $1100,$0000,$0000,$1100
* LETTER D
LETTRD FDB $0101,$0101,$0101,$0100
FDB $1100,$0000,$0000,$1100
FDB $1011,$1111,$1111,$1000
* LETTER E
LETTRE FDB $0101,$0101,$0101,$0100
FDB $1110,$1011,$1010,$1100
FDB $1100,$0010,$0000,$1100
* LETTER F
LETTRF FDB $0101,$0101,$0101,$0100
FDB $1110,$1011,$1010,$1000
FDB $1100,$0010,$0000,$0000
* LETTER G
LETTRG FDB $0101,$0101,$0101,$0100
FDB $1110,$1010,$1010,$1100
FDB $1100,$0011,$0101,$1100
* LETTER H
LETTRH FDB $0101,$0101,$0101,$0100
FDB $1010,$1011,$1010,$1000
FDB $0101,$0111,$0101,$0100
* LETTER I
LETTRI FDB $0101,$0101,$0101,$0100
FDB $1010,$1010,$1010,$1000
* LETTER J
LETTRJ FDB $0000,$0000,$0001,$0100
FDB $0000,$0000,$0000,$1100
FDB $1111,$1111,$1111,$1100
* LETTER K
LETTRK FDB $0101,$0101,$0101,$0100
FDB $0000,$0111,$0100,$0000
FDB $0110,$0000,$0010,$0100
* LETTER L
LETTRL FDB $0101,$0101,$0101,$0100
FDB $1010,$1010,$1010,$1100
FDB $0000,$0000,$0000,$1100
* LETTER M
LETTRM FDB $0101,$0101,$0101,$0100
FDB $1110,$1010,$1010,$1000
FDB $1110,$1010,$0000,$0000
FDB $1111,$1111,$1111,$1100
* LETTER N
LETTRN FDB $0101,$0101,$0101,$0100
FDB $1110,$1010,$1010,$1000
FDB $1101,$0101,$0101,$0100
* LETTER O
LETTRO FDB $0101,$0101,$0101,$0100
FDB $1110,$1010,$1010,$1100
FDB $1101,$0101,$0101,$1100
* LETTER P
LETTRP FDB $0101,$0101,$0101,$0100
FDB $1110,$1011,$1010,$1000
FDB $1101,$0111,$0000,$0000
* LETTER Q
LETTRQ FDB $0101,$0101,$0101,$0100
FDB $1110,$1010,$1010,$1100
FDB $1101,$0101,$0111,$1110
* LETTER R
LETTRR FDB $0101,$0101,$0101,$0100
FDB $1110,$1011,$1010,$1000
FDB $1101,$0111,$1001,$0100
* LETTER S
LETTRS FDB $0101,$0101,$0000,$0100
FDB $1110,$1011,$0000,$1100
FDB $1100,$0011,$1111,$1100
* LETTER T
LETTRT FDB $1100,$0000,$0000,$0000
FDB $1111,$1111,$1111,$1100
FDB $1100,$0000,$0000,$0000
* LETTER U
LETTRU FDB $0101,$0101,$0101,$0100
FDB $1010,$1010,$1010,$1100
FDB $0101,$0101,$0101,$1100
* LETTER V
LETTRV FDB $0101,$0101,$0100,$0000
FDB $0000,$0000,$0010,$0100
FDB $0101,$0101,$0110,$0000
* LETTER W
LETTRW FDB $0101,$0101,$0101,$0000
FDB $1010,$1010,$1010,$0100
FDB $1010,$1010,$1010,$0100
FDB $1010,$1010,$1010,$0000
* LETTER X
LETTRX FDB $0101,$0000,$0001,$0100
FDB $0000,$1001,$1000,$0000
FDB $0101,$1000,$1001,$0100
* LETTER Y
LETTRY FDB $0101,$0000,$0000,$0000
FDB $0000,$1001,$0101,$0100
FDB $0101,$1000,$0000,$0000
* LETTER Z
LETTRZ FDB $0100,$0000,$0101,$0100
FDB $1100,$0110,$0000,$1100
FDB $1110,$0000,$0000,$1100
*
* UPPER HALF CHECKBYTE
*
FDB $FFFF
*
* MESSAGE INSTRUCTION TABLE
*
RSP EQU 0 RESET SPACE BETWEEN CHARACTERS <2 BYTES>
RLS EQU 1 RESET LINE SPACING <2 BYTES>
HMT EQU 2 HORIZONTAL MOVE RELATIVE TO TOP LEFT <2 BYTES>
HMC EQU 3 HORIZONTAL MOVE RELATIVE TO CURSER <2 BYTES>
VMT EQU 4 VERTICAL MOVE RELATIVE TO TOP LEFT <2 BYTES>
VMC EQU 5 VERTICAL MOVE RELATIVE TO CURSER <2 BYTES>
RTC EQU 6 RESET TOP LEFT AND CURSER <3 BYTES>
RLF EQU 7 RETURN(TO TOPL LEFT), LINE FEED <1 BYTE>
PIC EQU 8 PICTURE <3 BYTES>
*
* OPERATOR INSTRUCTIONS
*
* Y POINTING TO TABLE
*
*
OPER$ PSHS U,X,Y SAVE STATE
LDU #VINS16 "PRESS ADVANCE TO STEP"
BRA OPER0 DO BELOW
OPERIN PSHS U,X,Y
LDU #VINS1 "PRESS ADVANCE WITH SW..."
OPER0 LDX #$18CE SCREEN ADDRESS
JSR WTEXTB OUTPUT IT
LDU ,Y++ GET POINTER
BEQ OPER1 NO, INSTRUCTION SKIP
LDX #$10DA SCREEN ADDRESS
JSR WTEXTB WRITE IT OUT
OPER1 LDU ,Y++
BEQ OPER2 DONE!
LDX #$10E4 SCREEN ADDRESS
JSR WTEXTB DO IT
OPER2 PULS X,Y,U,PC GO BACK CLEAN
*
* ERASE A "WORD FROM THE SCREEN
*
ERASTK PSHS U,Y,X,D,CC
LDY #COFFV
BRA DISST0 DO BELOW
*
* OUTPUT A "WORD" FROM 32 BYTES OF STACK
*
DISSTK PSHS U,Y,X,D,CC
LDY #CWRITV
DISST0 LDD #TEXT3 POINT TO HANDLER
STY TEMP2A
STD TEMP2B
STX CURSER PUT DOWN CURSER
STX TOPL SET TOP LEFT
LDX #$010A STANDARD SPACING
STX CHARSP
CLR SPACEF
LDU 5,S GET IT
STU WORDPT SAVE AS POINTER
LEAU 32,U MOVE IT TO END
STU MESEND SAVE AS END
STU MESPT AND POINTER
BRA TEXT3 GO DO BELOW
*
* TEXT ROUTINE X IS TOP LEFT ADDRESS
* U IS MESSAGE VECTOR ADDRESS
*
* ALL REGISTERS SAVED
* EXCEPT CARRY BIT(0-MESSAGE IN PROGRESS
* 1-MESSAGE COMPLETED)
*
* WRITE TEXT BLOCK
WTEXTB PSHS U,Y,X,D,CC <=START HERE TO WRITE TEXT BLOCK
LDY #CWRITV
LDD #TEXT3
BRA TEXT1
* ERASE TEXT BLOCK
ETEXTB PSHS U,Y,X,D,CC <=START HERE TO ERASE TEXT BLOCK
LDY #COFFV
LDD #TEXT3
BRA TEXT1
* WRITE TEXT CHARACTER
WTEXTC PSHS U,Y,X,D,CC <=START HERE TO WRITE TEXT CHARACTER
LDY #CWRITV
LDD #TEXT8
BRA TEXT1
* ERASE TEXT CHARACTER
ETEXTC PSHS U,Y,X,D,CC <=START HERE TO ERASE TEXT CHARACTER
LDY #COFFV
LDD #TEXT8
TEXT1 STY TEMP2A SAVE WRITE/ERASE SELECT
STD TEMP2B SAVE BLOCK/CHARACTER SELECT
TEXT2 TST MESPT CHECK IF NEW MESSAGE
BNE TEXT3 NO, SKIP INITIALIZATION
* NEW MESSAGE
STX CURSER SET CURSOR
STX TOPL SET TOP LEFT
LDX #$010A SET CHARACTER AND LINE SPACINGS
STX CHARSP
CLR SPACEF CLEAR SPACE FLAG
LDX 2,U GET END OF MESSAGE
STX MESEND SAVE IT
LDX ,U GET MESSAGE POINTER
BRA TEXT5 BRANCH TO NEXT WORD OR INSTRUCTION
* NEXT CHARACTER
TEXT3 TST SPACEF CHECK SPACE FLAG
BNE TEXT9 YES SPACE?, PROCESS NEXT WORD OR INSTRUCTION
LDX WORDPT GET WORD POINTER
LDB ,X+ GET ASCII CHARACTER AND ADVANCE WORD POINTER
CMPB #$2F CHECK FOR END OF WORD "/"
BNE TEXT7 BRANCH TO CHARACTER PROCESSING
LDB #$20 MAKE CHARACTER A SPACE
STB SPACEF SET SPACE FLAG
BRA TEXT7 PROCESS SPACE
* NEXT WORD OR INSTRUCTION
TEXT9 CLR SPACEF CLEAR SPACE FLAG
LDX MESPT GET MESSAGE POINTER
TEXT4 CMPX MESEND CHECK IF DONE
BNE TEXT5 CONTINUE
TEXT4A CLR MESPT ZERO MESSAGE POINTER
PULS CC,D,X,Y,U
ORCC #1 SET CARRY-MESSAGE COMPLETED
RTS
TEXT5 LDU ,X++ GET NEXT WORD OR INSTRUCTION
BMI TEXT6 BRANCH TO WORD PROCESSING
* INSTRUCTION PROCESSING
LEAX -1,X BACKUP MESSAGE POINTER
TFR U,D TRANSFER INSTRUCION INTO A
CMPA #8 CHECK IF INSTRUCTION IS VALID
BHI TEXT4A NO? QUIT MESSAGE
ASLA MULTIPLY BY 2
LDY #INSTBL GET INSTRUCTION TABLE ADDRESS
JSR [A,Y] EXECUTE INSTRUCTION
BRA TEXT4 NEXT WORD OR INSTRUCTION
* WORD PROCESSING
TEXT6 STX MESPT SAVE MESSAGE POINTER
STU WORDPT SAVE WORD POINTER
BRA TEXT3 BRANCH TO NEXT CHARACTER
* CHARACTER PROCESSING
TEXT7 STX WORDPT SAVE WORD POINTER
SUBB #$20
CMPB #1 CHECK IF SPACE OR EXCLAMATION PT.
BLS TEXT7B YES?, WRITE IT
CMPB #11 CHECK INVALID
BLS TEXT7A YES?, CHANGE TO QUEST MK
SUBB #10
CMPB #16 CHECK FOR NEXT VALID GROUP
BLS TEXT7B YES?, WRITE IT
CMPB #20 CHECK INVALID
BLS TEXT7A YES?, CHANGE TO QUEST MK
SUBB #4
CMPB #44 CHECK FOR LAST VALID GROUP
BLS TEXT7B YES?, WRITE IT
TEXT7A LDB #3 CHANGE INVALID CHAR TO QUEST MK
TEXT7B ASLB MULTIPLY CHARACTER BY 4
ASLB
LDX #CHRTBL GET CHARACTER DESCRIPTER TABLE
ABX FIND CHARACTER DESCRIPTER
TFR X,Y SET CHARACTER DESCRIPTER POINTER
LDD CURSER SET CURSER
LDX TEMP2A WRITE/ERASE CHARACTER
JSR ,X
ADDA ,Y ADVANCE CURSER CHARACTER WIDTH
ADDA CHARSP ADVANCE CURSER CHARACTER SPACING
STA CURSER SAVE CURSER
LDX TEMP2B NEXT TEXT BYTE / QUIT
JMP ,X
TEXT8 PULS CC,D,X,Y,U
ANDCC #$FE CLEAR CARRY-MESSAGE NOT COMPLETED
RTS RETURN FROM WRITE/ERASE CHARACTER
* INSTRUCTION ADDRESS TABLE
INSTBL FDB RSP1,RLS1,HMT1,HMC1,VMT1,VMC1,RTC1,RLF1,PIC1
* RESET SPACE BETWEEN CHARACTERS
RSP1 LDA ,X+ GET NEXT TEXT BYTE
STA CHARSP RESET CHARSP
RTS
* RESET LINE SPACING
RLS1 LDB ,X+ GET NEXT TEXT BYTE
STB LINESP RESET LINESP
RTS
* HORIZONTAL MOVE RELATIVE TO TOP LEFT
HMT1 LDA TOPL GET TOP LEFT HORIZONTAL
ADDA ,X+ ADD NEXT TEXT BYTE
STA CURSER RESET CURSER HORIZONTAL
RTS
* HORIZONTAL MOVE RELATIVE TO CURSER
HMC1 LDA CURSER GET CURSER HORIZONTAL
ADDA ,X+ ADD NEXT TEXT BYTE
STA CURSER RESET CURSER HORIZONTAL
RTS
* VERTICAL MOVE RELATIVE TO TOP LEFT
VMT1 LDB TOPL+1 GET TOP LEFT VERTICAL
ADDB ,X+ ADD NEXT TEXT BYTE
STB CURSER+1 RESET CURSER VERTICAL
RTS
* VERTICAL MOVE RELATIVE TO CURSER
VMC1 LDB CURSER+1 GET CURSER VERTICAL
ADDB ,X+ ADD NEXT TEXT BYTE
STB CURSER+1 RESET CURSER VERTICAL
RTS
* RESET TOP LEFT AND CURSER
RTC1 LDD ,X++ GET NEXT TWO TEXT BYTES
STD TOPL RESET TOP LEFT
STD CURSER RESET CURSER
RTS
* RETURN(TO TOPL LEFT), LINE FEED
RLF1 LDA TOPL GET TOP LEFT HORIZONTAL
LDB CURSER+1 GET CURSER VERTICAL
ADDB LINESP ADD LINE SPACING TO VERTICAL
STD CURSER RESET CURSER
RTS
* PICTURE
PIC1 LDY ,X++ GET NEXT TWO TEXT BYTES
STX MESPT SAVE MESSAGE POINTER
LDX TEMP2A WRITE/ERASE PICTURE
JSR ,X
ADDA ,Y ADVANCE CURSER PICTURE WIDTH
ADDA CHARSP ADVANCE CURSER CHARACTER SPACING
STA CURSER SAVE CURSER
LEAS 2,S POP STACK
LDX TEMP2B NEXT TEXT BYTE / QUIT
JMP ,X
*
* NUMBER ROUTINE X IS TOP LEFT ADDRESS,
* CHANGED AFTER NUMBER COMPLETED
* D IS BCD NUMBER
* CHARSP IS USED AS SPACING
*
* NUMBER IS SHIFTED ONE NIBBLE AT A TIME LEFT
* AND REPLACED BY F, AS IT IS WRITTEN TO SCREEN
* (EX. 5349 => 349F => 49FF => 9FFF => FFFF DONE)
*
* WRITE NUMBER BLOCK
WNUMBB PSHS U,Y,X,D,CC <=START HERE TO WRITE NUMBER BLOCK
LDY #CWRITV
LDU #NUMB4
BRA NUMB1
* ERASE NUMBER BLOCK
ENUMBB PSHS U,Y,X,D,CC <=START HERE TO ERASE NUMBER BLOCK
LDY #COFFV
LDU #NUMB4
BRA NUMB1
* WRITE NUMBER DIGIT
WNUMBC PSHS U,Y,X,D,CC <=START HERE TO WRITE NUMBER DIGIT
LDY #CWRITV
LDU #NUMB6
BRA NUMB1
* ERASE NUMBER DIGIT
ENUMBC PSHS U,Y,X,D,CC <=START HERE TO ERASE NUMBER DIGIT
LDY #COFFV
LDU #NUMB6
NUMB1 STY TEMP2A SAVE WRITE/ERASE SELECT
STU TEMP2B SAVE BLOCK/DIGIT SELECT
LDU NUMBER
CMPU #$FFFF CHECK IF NEW NUMBER
BNE NUMB3A CONTINUE OLD NUMBER
STX CURSER SAVE SCREEN POSITION
STD NUMBER SAVE NUMBER
BNE NUMB2 CHECK FOR >0
LDD #$0FFF DISPLAY ONE DIGIT "0"
BRA NUMB3 SKIP LEADING 0 SUPRESSION
NUMB2 BITA #$F0 TEST LEADING DIGIT
BNE NUMB3 NOT 0
BSR NUMB10 SHIFT ONE NIBBLE LEFT
BRA NUMB2
NUMB3 STD NUMBER SAVE NUMBER
NUMB3A LDD NUMBER GET NUMBER
NUMB4 ANDA #$F0 EXTRACT NEXT DIGIT
CMPA #$F0 CHECK IF FINISHED
BNE NUMB5 NO, CONTINUE
PULS CC,D,X,Y,U
LDX CURSER NEW SCREEN POSITION
ORCC #1 SET CARRY BIT(NUMBER COMPLETED)
RTS RETURN
NUMB5 LSRA DIVIDE NUMBER BY 4
LSRA
LDX #N0 SET DIGIT DESCRIPTER
LEAY A,X
LDD CURSER SET SCREEN POSITION
LDX TEMP2A WRITE/ERASE DIGIT
JSR ,X
ADDA ,Y ADVANCE CURSER DIGIT WIDTH
ADDA CHARSP ADVANCE CURSER CHARACTER SPACING
STA CURSER SAVE CURSER
LDD NUMBER GET NUMBER
BSR NUMB10 SHIFT ONE NIBBLE LEFT
STD NUMBER
LDX TEMP2B NEXT DIGIT / QUIT
JMP ,X
NUMB6 PULS CC,D,X,Y,U
ANDCC #$FE CLEAR CARRY BIT(NUMBER NOT FINISHED)
RTS RETURN
NUMB10 ASLB SHIFT ONE NIBBLE LEFT
ROLA
ASLB
ROLA
ASLB
ROLA
ASLB
ROLA
ORB #$0F
RTS
PAGE