forked from simonowen/samrom
-
Notifications
You must be signed in to change notification settings - Fork 0
/
text.asm
1406 lines (1012 loc) · 31.4 KB
/
text.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
;TEXT.SAM - ERROR MESSAGES, KEYWORDS, MSGS, TABLES, CHARSET ETC
;REPORTS GENERATED BY E.G. RST 08H: DB 0 FOR OK
;UTILITY MESSAGES (START AT 0)
;UMVAL IS LOADED INTO UMSGS SYS VAR AT INIT.
UMVAL:
DM " MILES GORDON TECHNOLOGY PLC "
DM " "
DB 127
DM " 1990 SAM Cou"
DB "p"+&80 ;0
DM "scroll"
DB "?"+&80 ;1
DB " "+&80 ;2 NOT USED
DM "St"
DB CAR
DM "t tape and then press a ke"
DB "y"+&80 ;3
DM "Basic:"
DB " "+&80 ;4
DM "Nu"
DB CME
DM "ric"
DB ARRAY+&80 ;5
DB STRING,ARRAY+&80 ;6
DM "Co"
DB CDE,":"," "+&80 ;7
DB "S",CREEN,":"," "+&80 ;8
;ERRMVAL IS LOADED INTO ERRMSGS SYS VAR AT INIT.
ERRMVAL:
DB "O","K"+&80 ;0
DM "Out"
DB SOFS,CME
DM "mor"
DB "y"+&80 ;1
DB SNOTS
DM "foun"
DB "d"+&80 ;2
DM "DATA has all been rea"
DB "d"+&80 ;3
DM "Subscript wron"
DB "g"+&80 ;4
DB CNXT,WITHOUT
DM "FO"
DB "R"+&80 ;5
DM "FOR"
DB WITHOUT,CNXT+&80 ;6
DM "FN"
DB WITHOUT
DM "DEF F"
DB "N"+&80 ;7
DM "RETURN"
DB WITHOUT
DM "GOSU"
DB "B"+&80 ;8
DB MISSING,CLOOP+&80 ;9
DB CLOOP,WITHOUT,"D","O"+&80 ;10
DB NO
DM "POP dat"
DB "a"+&80 ;11
DB MISSING
DM "DEF"
DB CPROC+&80 ;12
DB NO
DM "END"
DB CPROC+&80 ;13
DB BREAK
DM "- CONTINUE "
DB CTO
DM " repea"
DB "t"+&80 ;14
DB BREAK,CIN,CTO
DM " progra"
DB "m"+&80 ;15
DB CSTOP,"s",TATEMENT+&80 ;16
DB CSTOP,CIN
DM " INPU"
DB "T"+&80 ;17
DB INVALID,FILE,SNAME+&80 ;18
DM "Load"
DB CIN,"g",ERROR+&80 ;19
DB INVALID,CDE
DM "vic"
DB "e"+&80 ;20
DB INVALID,"s",TREAM
DM " n"
DB UMBER+&80 ;21
DM "End"
DB SOFS,FILE+&80 ;22
DB INVALID,CLOUR+&80 ;23
DB INVALID,PALET,CLOUR+&80 ;24
DB TOOMANY,PALET
DM "change"
DB "s"+&80 ;25
DB "P",CAR,"a",CME
DM "ter"
DB ERROR+&80 ;26
DB INVALID,CAR
DM "gu"
DB CME,"n","t"+&80 ;27
DB "N",UMBER,TOO,"l",CAR,"g","e"+&80 ;28
DM "Not un"
DB CDE
DM "rs"
DB CTO,"o","d"+&80 ;29
DM "Integer out"
DB SOFS
DM "rang"
DB "e"+&80 ;30
DB "S",TATEMENT
DM " doesn't exis"
DB "t"+&80 ;31
DM "Off s"
DB CREEN+&80 ;32
DB NO
DM "room for l"
DB CIN,"e"+&80 ;33
DB INVALID,"s",CREEN
DM " mod"
DB "e"+&80 ;34
DB INVALID
DM "BLITZ cod"
DB "e"+&80 ;35
DB "S",CTO
DM "red "
DB CAR
DM "ea"
DB TOO
DM "bi"
DB "g"+&80 ;36
DB INVALID
DM "PUT bloc"
DB "k"+&80 ;37
DM "PUT mask mismatc"
DB "h"+&80 ;38
DB MISSING
DM "END I"
DB "F"+&80 ;39
DB INVALID,"v",CAR
DM "iable"
DB SNAME+&80 ;40
DM "BASIC stack ful"
DB "l"+&80 ;41
DB STRING,TOO,LONG+&80 ;42
DB INVALID,"s",CREEN
DM " n"
DB UMBER+&80 ;43
DB "S",CREEN,ISALREDOP+&80 ;44
DB "S",TREAM,ISALREDOP+&80 ;45
DM "Current s"
DB CREEN+&80 ;46 WAS INVALID CHANNEL
DB "S",TREAM
DM " is"
DB SNOTS
DM "ope"
DB "n"+&80 ;47
DB INVALID
DM "CLEAR addres"
DB "s"+&80 ;48
DB INVALID,NOTE+&80 ;49
DB NOTE,TOO,LONG+&80 ;50
DM "FPC"
DB ERROR+&80 ;51
DB TOOMANY,CDE,"f",CIN
DM "ition"
DB "s"+&80 ;52
DM "No DO"
DB "S"+&80 ;53
DB INVALID
DM "WINDO"
DB "W"+&80 ;54
DB MISSING
DM "dis"
DB "k"+&80 ;55
;SAVES OVER 200 BYTES.
COMPLIST: DM "Invalid"
DB " "+&80 ;14 uses
INVALID: EQU 0
DM " without"
DB " "+&80 ;5 uses
WITHOUT: EQU 1
DM "Missing"
DB " "+&80 ;5 uses
MISSING: EQU 2
DM " too"
DB " "+&80 ;3 uses
TOO: EQU 3
DM " is already ope"
DB "n"+&80 ;2 uses
ISALREDOP: EQU 4
DM "palette"
DB " "+&80 ;2 uses
PALET: EQU 5
DM " of"
DB " "+&80 ;3 uses
SOFS: EQU 6
DM " erro"
DB "r"+&80 ;4 uses
ERROR: EQU 7
DM "trea"
DB "m"+&80 ;3 uses
TREAM: EQU 8
DM "umbe"
DB "r"+&80 ;3 uses
UMBER: EQU 9
DM "NEX"
DB "T"+&80 ;2 uses
CNXT: EQU 10
DM "No"
DB " "+&80 ;3 uses
NO: EQU 11
DM "BREAK"
DB " "+&80 ;2 uses
BREAK: EQU 12
DM "cree"
DB "n"+&80 ;6 USES
CREEN: EQU 13
DM " array:"
DB " "+&80 ;2 USES
ARRAY: EQU 14
DM "Not"
DB "e"+&80 ;2 USES
NOTE: EQU 15
DM "lon"
DB "g"+&80 ;2 USES
LONG: EQU 16
DM " not"
DB " "+&80 ;2 USES
SNOTS: EQU 17
DM " nam"
DB "e"+&80 ;2 USES
SNAME: EQU 18
DM "Strin"
DB "g"+&80 ;2 USES
STRING: EQU 19
DM "Too many"
DB " "+&80 ;2 USES
TOOMANY: EQU 20
DM "tatemen"
DB "t"+&80 ;2 USES
TATEMENT: EQU 21
DM "STOP"
DB " "+&80 ;2 USES
CSTOP: EQU 22
DM "fil"
DB "e"+&80 ;2 USES
FILE: EQU 23
DM "colou"
DB "r"+&80 ;2 USES
CLOUR: EQU 24
DB "i","n"+&80 ;5 USES
CIN: EQU 25
DM " PRO"
DB "C"+&80 ;2 USES
CPROC: EQU 26
DM "LOO"
DB "P"+&80 ;2 USES
CLOOP: EQU 27
DB "t","o"+&80 ;4 USES
CTO: EQU 28
DB "d","e"+&80 ;4 USES
CDE: EQU 29
DB "m","e"+&80 ;2 USES
CME: EQU 30
DB "a","r"+&80 ;6 USES
CAR: EQU 31
;TOKENS.SAM - SAM TOKEN TABLE.
;FUNCTIONS RANGE 21-&69, PRECEDED BY FF
;ASCII RANGE 20-7F
;BLOCK GRAPHICS/EXTENDED CHARS 80-8F
;EXTENDED CHARS 90-A8
;(&80-A8H ACT AS UDGS - PROGRAMMED AS BLOCK GRAPHICS, FOLLOWED BY EXTENDED CHARS
;ON POWER-UP. UDGS SYS VAR PTS TO USR "A". TAKES 328 BYTES OF RAM. OVERLAP WITH
;COMMAND TOKENS USES CONTEXT TO AVOID PROBLEMS - PRINT CHR$ 160 GIVES UDG, LIST
;COMMAND GIVES KEYWORD. QUOTES FORCES UDGS.
;ALLOW 80-95 IN PROC NAMES SO A FACE SYMBOL CAN BE A COMMAND?
;USE "." FOR EXTERNAL COMMAND
;QUALIFIERS 96-9F
;COMMANDS RANGE A0-FE
;FUNCTIONS HAVE &0FF PREFIX
;"IMMEDIATE" FUNCTIONS
KEYWTAB: DB &A0
IMFNTL: DM "P" ;&3B
DB "I"+&80
DM "RN" ;
DB "D"+&80
DM "POIN" ;
DB "T"+&80
DM "FRE" ;
DB "E"+&80
DM "LENGT" ;
DB "H"+&80
DM "ITE" ;
DB "M"+&80
DM "ATT" ;
DB "R"+&80
DM "F" ;
DB "N"+&80
DM "BI" ;
DB "N"+&80
DM "XMOUS" ;
DB "E"+&80
DM "YMOUS" ;
DB "E"+&80
DM "XPE" ;
DB "N"+&80
DM "YPE" ;
DB "N"+&80
DM "RAMTO" ;
DB "P"+&80
DB "-"+&80 ; UNUSED INARRAY
DM "INST" ;&4A
DB "R"+&80
DM "INKEY" ;&4B
DB "$"+&80
DM "SCREEN" ;
DB "$"+&80
DM "MEM" ;
DB "$"+&80
DB "-"+&80 ; UNUSED CHAR$
DM "PATH" ;
DB "$"+&80
DM "STRING" ;
DB "$"+&80
DB "-"+&80 ; UNUSED USING$
DB "-"+&80 ;&52 UNUSED SHIFT$
;FPC FUNCTIONS
FPCFNTL: DM "SI" ;&53
DB "N"+&80
DM "CO" ;
DB "S"+&80
DM "TA" ;
DB "N"+&80
DM "AS" ;
DB "N"+&80
DM "AC" ;
DB "S"+&80
DM "AT" ;
DB "N"+&80
DM "L" ;
DB "N"+&80
DM "EX" ;
DB "P"+&80
DM "AB" ;
DB "S"+&80
DM "SG" ;
DB "N"+&80
DM "SQ" ;
DB "R"+&80
DM "IN" ;
DB "T"+&80
DM "US" ;
DB "R"+&80
DM "I" ;
DB "N"+&80
DM "PEE" ;
DB "K"+&80
DM "DPEE" ;
DB "K"+&80
DM "DVA" ;
DB "R"+&80
DM "SVA" ;
DB "R"+&80
DM "BUTTO" ;
DB "N"+&80
DM "EO" ;
DB "F"+&80
DM "PT" ; DISC USE?
DB "R"+&80
DB "-"+&80
DM "UD" ;
DB "G"+&80
DB "-"+&80
DM "LE" ;
DB "N"+&80
DM "COD" ;
DB "E"+&80
DM "VAL" ;
DB "$"+&80
DM "VA" ;
DB "L"+&80
DM "TRUNC" ;
DB "$"+&80
DM "CHR" ;
DB "$"+&80
DM "STR" ;
DB "$"+&80
DM "BIN" ;
DB "$"+&80
DM "HEX" ;
DB "$"+&80
DM "USR" ;
DB "$"+&80
DB "-"+&80 ; CORRESPONDS TO INKEY$ FPC CODE
DM "NO" ;
DB "T"+&80
DB "-"+&80 ;
DB "-"+&80 ;
DB "-"+&80 ;&79
;BINARY OPERATORS
BINFNTL: DM "MO" ;&7A
DB "D"+&80
DM "DI" ;
DB "V"+&80
DM "BO" ;
DB "R"+&80
DB "-"+&80
DM "BAN" ;
DB "D"+&80
DM "O" ;
DB "R"+&80
DM "AN" ;
DB "D"+&80
DM "<" ;
DB ">"+&80
DM "<" ;
DB "="+&80
DM ">" ;&83
DB "="+&80
;QUALIFIERS - RANGE &85-&8F
KWDS85: DM "USIN" ;&85
DB "G"+&80
DM "WRIT" ;86
DB "E"+&80
DM "A" ;87
DB "T"+&80
DM "TA" ;88
DB "B"+&80
DM "OF" ;89
DB "F"+&80
DM "WHIL" ;8A
DB "E"+&80
DM "UNTI" ;8B
DB "L"+&80
DM "LIN" ;8C
DB "E"+&80
DM "THE" ;8D
DB "N"+&80
DM "T" ;8E
DB "O"+&80
DM "STE" ;8F
DB "P"+&80
;COMMANDS. RANGE &90-FEH
DM "DI" ;90
DB "R"+&80
DM "FORMA" ;91
DB "T"+&80
DM "ERAS" ;92
DB "E"+&80
DM "MOV" ;93
DB "E"+&80
DM "SAV" ;94
DB "E"+&80
DM "LOA" ;95
DB "D"+&80
DM "MERG" ;96
DB "E"+&80
DM "VERIF" ;97
DB "Y"+&80
DM "OPE" ;98
DB "N"+&80
DM "CLOS" ;99
DB "E"+&80
DM "CIRCL" ;9A
DB "E"+&80
DM "PLO" ;9B
DB "T"+&80
DM "LE" ;9C
DB "T"+&80
DM "BLIT" ;9D
DB "Z"+&80
DM "BORDE" ;9E
DB "R"+&80
DM "CL" ;9F
DB "S"+&80
KWDSA0: DM "PALETT" ;A0
DB "E"+&80
DM "PE" ;A1
DB "N"+&80
DM "PAPE" ;A2
DB "R"+&80
DM "FLAS" ;A3
DB "H"+&80
DM "BRIGH" ;A4
DB "T"+&80
DM "INVERS" ;A5
DB "E"+&80
DM "OVE" ;A6
DB "R"+&80
DM "FATPI" ;A7 0=THIN, 1=FAT
DB "X"+&80
DM "CSIZ" ;A8
DB "E"+&80
DM "BLOCK" ;A9
DB "S"+&80
DM "MOD" ;AA
DB "E"+&80
DM "GRA" ;AB
DB "B"+&80
DM "PU" ;AC
DB "T"+&80
DM "BEE" ;AD
DB "P"+&80
DM "SOUN" ;AE
DB "D"+&80
DM "NE" ;AF
DB "W"+&80
DM "RU" ;B0
DB "N"+&80
DM "STO" ;B1
DB "P"+&80
DM "CONTINU" ;B2
DB "E"+&80
DM "CLEA" ;B3
DB "R"+&80
DM "GO T" ;B4
DB "O"+&80
DM "GO SU" ;B5
DB "B"+&80
DM "RETUR" ;B6
DB "N"+&80
DM "RE" ;B7
DB "M"+&80
DM "REA" ;B8
DB "D"+&80
DM "DAT" ;B9
DB "A"+&80
DM "RESTOR" ;BA
DB "E"+&80
DM "PRIN" ;BB
DB "T"+&80
DM "LPRIN" ;BC
DB "T"+&80
DM "LIS" ;BD
DB "T"+&80
DM "LLIS" ;BE
DB "T"+&80
DM "DUM" ;BF
DB "P"+&80
KWDSC0: DM "FO" ;C0
DB "R"+&80
DM "NEX" ;C1
DB "T"+&80
DM "PAUS" ;C2
DB "E"+&80
DM "DRA" ;C3
DB "W"+&80
DM "DEFAUL" ;C4
DB "T"+&80
DM "DI" ;C5
DB "M"+&80
DM "INPU" ;C6
DB "T"+&80
DM "RANDOMIZ" ;C7
DB "E"+&80
DM "DEF F" ;C8
DB "N"+&80
DM "DEF KEYCOD" ;C9
DB "E"+&80
DM "DEF PRO" ;CA
DB "C"+&80
DM "END PRO" ;CB
DB "C"+&80
DM "RENU" ;CC
DB "M"+&80
DM "DELET" ;CD
DB "E"+&80
DM "RE" ;CE
DB "F"+&80
DM "COP" ;CF
DB "Y"+&80
DB "-"+&80 ;D0
DM "KEYI" ;D1
DB "N"+&80
DM "LOCA" ;D2
DB "L"+&80
DM "LOOP I" ;D3
DB "F"+&80
DM "D" ;D4
DB "O"+&80
DM "LOO" ;D5
DB "P"+&80
DM "EXIT I" ;D6
DB "F"+&80
DM "I" ;D7
DB "F"+&80
DM "I" ;D8
DB "F"+&80
DM "ELS" ;D9
DB "E"+&80
DM "ELS" ;DA
DB "E"+&80
DM "END I" ;DB
DB "F"+&80
DM "KE" ;DC
DB "Y"+&80
DM "ON ERRO" ;DD
DB "R"+&80
DM "O" ;DE
DB "N"+&80
DM "GE" ;DF
DB "T"+&80
KWDSE0: DM "OU" ;E0
DB "T"+&80
DM "POK" ;E1
DB "E"+&80
DM "DPOK" ;E2
DB "E"+&80
DM "RENAM" ;E3
DB "E"+&80
DM "CAL" ;E4
DB "L"+&80
DM "ROL" ;E5
DB "L"+&80
DM "SCROL" ;E6
DB "L"+&80
DM "SCREE" ;E7
DB "N"+&80
DM "DISPLA" ;E8
DB "Y"+&80
BTWD: DM "BOO" ;E9 USED BY BOOT TO CHECK FILE NAME
DB "T"+&80
DM "LABE" ;EA
DB "L"+&80
DM "FIL" ;EB
DB "L"+&80
DM "WINDO" ;EC
DB "W"+&80
DM "AUT" ;ED
DB "O"+&80
DM "PO" ;EE
DB "P"+&80
DM "RECOR" ;EF
DB "D"+&80
DM "DEVIC" ;F0
DB "E"+&80
DM "PROTEC" ;F1
DB "T"+&80
DM "HID" ;F2
DB "E"+&80
DM "ZA" ;F3
DB "P"+&80
DM "PO" ;F4
DB "W"+&80
DM "BOO" ;F5
DB "M"+&80
DM "ZOO" ;F6
DB "M"+&80
DB "-"+&80 ;F7
DB "-"+&80 ;F8
DB "-"+&80 ;F9
DB "-"+&80 ;FA
DB "-"+&80 ;FB
DB "-"+&80 ;FC
DB "-"+&80 ;FD
DB "-"+&80 ;FE
DM "IN" ;FF (FUNCTION PREFIX) AND TEMP "INK" TOKEN
DB "K"+&80
;DEF KEY INIT TABLE
DKSRC: DB 192,1,0,&BD ;F0 LIST