-
Notifications
You must be signed in to change notification settings - Fork 85
/
Copy pathtoken2
251 lines (251 loc) · 3.63 KB
/
token2
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
.PAG 'TOKEN2'
.BYT 'TAB',$A8
TABTK =@243
.BYT 'T',$CF
TOTK =@244
.BYT 'F',$CE
FNTK =@245
.BYT 'SPC',$A8
SPCTK =@246
.BYT 'THE',$CE
THENTK =@247
.BYT 'NO',$D4
NOTTK =@250
.BYT 'STE',$D0
STEPTK =@251
.BYT $AB
PLUSTK =@252
.BYT $AD
MINUTK =@253
.BYT $AA
.BYT $AF
.BYT $DE
.BYT 'AN',$C4
.BYT 'O',$D2
.BYT 190
GREATK =@261
.BYT $BD
EQULTK =@262
.BYT 188
LESSTK =@263
.BYT 'SG',$CE
ONEFUN =@264
.BYT 'IN',$D4
.BYT 'AB',$D3
.BYT 'US',$D2
.BYT 'FR',$C5
.BYT 'PO',$D3
.BYT 'SQ',$D2
.BYT 'RN',$C4
.BYT 'LO',$C7
.BYT 'EX',$D0
.BYT 'CO',$D3
.BYT 'SI',$CE
.BYT 'TA',$CE
.BYT 'AT',$CE
.BYT 'PEE',$CB
.BYT 'LE',$CE
.BYT 'STR',$A4
.BYT 'VA',$CC
.BYT 'AS',$C3
.BYT 'CHR',$A4
LASNUM =@307
.BYT 'LEFT',$A4
.BYT 'RIGHT',$A4
.BYT 'MID',$A4
.BYT 'G',$CF
GOTK =@313
.BYT 0
.PAG 'ERROR MESSAGES'
ERR01 .BYT 'TOO MANY FILE',$D3
ERR02 .BYT 'FILE OPE',$CE
ERR03 .BYT 'FILE NOT OPE',$CE
ERR04 .BYT 'FILE NOT FOUN',$C4
ERR05 .BYT 'DEVICE NOT PRESEN',$D4
ERR06 .BYT 'NOT INPUT FIL',$C5
ERR07 .BYT 'NOT OUTPUT FIL',$C5
ERR08 .BYT 'MISSING FILE NAM',$C5
ERR09 .BYT 'ILLEGAL DEVICE NUMBE',$D2
ERR10 .BYT 'NEXT WITHOUT FO',$D2
ERRNF =10
ERR11 .BYT 'SYNTA',$D8
ERRSN =11
ERR12 .BYT 'RETURN WITHOUT GOSU',$C2
ERRRG =12
ERR13 .BYT 'OUT OF DAT',$C1
ERROD =13
ERR14 .BYT 'ILLEGAL QUANTIT',$D9
ERRFC =14
ERR15 .BYT 'OVERFLO',$D7
ERROV =15
ERR16 .BYT 'OUT OF MEMOR',$D9
ERROM =16
ERR17 .BYT 'UNDEF',$27
.BYT 'D STATEMEN',$D4
ERRUS =17
ERR18 .BYT 'BAD SUBSCRIP',$D4
ERRBS =18
ERR19 .BYT 'REDIM',$27,'D ARRA',$D9
ERRDD =19
ERR20 .BYT 'DIVISION BY ZER',$CF
ERRDVO =20
ERR21 .BYT 'ILLEGAL DIREC',$D4
ERRID =21
ERR22 .BYT 'TYPE MISMATC',$C8
ERRTM =22
ERR23 .BYT 'STRING TOO LON',$C7
ERRLS =23
ERR24 .BYT 'FILE DAT',$C1
ERRBD =24
ERR25 .BYT 'FORMULA TOO COMPLE',$D8
ERRST =25
ERR26 .BYT 'CAN',$27,'T CONTINU',$C5
ERRCN =26
ERR27 .BYT 'UNDEF',$27,'D FUNCTIO',$CE
ERRUF =27
ERR28 .BYT 'VERIF',$D9
ERVFY =28
ERR29 .BYT 'LOA',$C4
ERLOAD =29
.PAG 'ERROR MESSAGES'
; TABLE TO TRANSLATE ERROR MESSAGE #
; TO ADDRESS OF STRING CONTAINING MESSAGE
;
ERRTAB .WOR ERR01
.WOR ERR02
.WOR ERR03
.WOR ERR04
.WOR ERR05
.WOR ERR06
.WOR ERR07
.WOR ERR08
.WOR ERR09
.WOR ERR10
.WOR ERR11
.WOR ERR12
.WOR ERR13
.WOR ERR14
.WOR ERR15
.WOR ERR16
.WOR ERR17
.WOR ERR18
.WOR ERR19
.WOR ERR20
.WOR ERR21
.WOR ERR22
.WOR ERR23
.WOR ERR24
.WOR ERR25
.WOR ERR26
.WOR ERR27
.WOR ERR28
.WOR ERR29
.WOR ERR30
OKMSG .BYT $D,'OK',$D,$0
ERR .BYT $D,' ERROR',0 ;ADD A C/R FOR VIXEN SCREEN
INTXT .BYT ' IN ',0
REDDY .BYT $D,$A,'READY.',$D,$A,0
ERBRK =30
BRKTXT .BYT $D,$A
ERR30 .BYT 'BREAK',0,$A0 ;SHIFTED SPACE
.PAG
FORSIZ =@22
FNDFOR TSX
INX
INX
INX
INX
FFLOOP LDA 257,X
CMP #FORTK
BNE FFRTS
LDA FORPNT+1
BNE CMPFOR
LDA 258,X
STA FORPNT
LDA 259,X
STA FORPNT+1
CMPFOR CMP 259,X
BNE ADDFRS
LDA FORPNT
CMP 258,X
BEQ FFRTS
ADDFRS TXA
CLC
ADC #FORSIZ
TAX
BNE FFLOOP
FFRTS RTS
BLTU JSR REASON
STA STREND
STY STREND+1
BLTUC SEC
LDA HIGHTR
SBC LOWTR
STA INDEX
TAY
LDA HIGHTR+1
SBC LOWTR+1
TAX
INX
TYA
BEQ DECBLT
LDA HIGHTR
SEC
SBC INDEX
STA HIGHTR
BCS BLT1
DEC HIGHTR+1
SEC
BLT1 LDA HIGHDS
SBC INDEX
STA HIGHDS
BCS MOREN1
DEC HIGHDS+1
BCC MOREN1
BLTLP LDA (HIGHTR)Y
STA (HIGHDS)Y
MOREN1 DEY
BNE BLTLP
LDA (HIGHTR),Y
STA (HIGHDS),Y
DECBLT DEC HIGHTR+1
DEC HIGHDS+1
DEX
BNE MOREN1
RTS
GETSTK ASL A
ADC #NUMLEV+NUMLEV+16
BCS OMERR
STA INDEX
TSX
CPX INDEX
BCC OMERR
RTS
REASON CPY FRETOP+1
BCC REARTS
BNE TRYMOR
CMP FRETOP
BCC REARTS
TRYMOR PHA
LDX #8+ADDPRC
TYA
REASAV PHA
LDA HIGHDS-1,X
DEX
BPL REASAV
JSR GARBA2
LDX #248-ADDPRC
REASTO PLA
STA HIGHDS+8+ADDPRC,X
INX
BMI REASTO
PLA
TAY
PLA
CPY FRETOP+1
BCC REARTS
BNE OMERR
CMP FRETOP
BCS OMERR
REARTS RTS
.END