1	.byt "TAB",$a8
2tabtk	=$a3
3	.byt "T",$cf
4totk	=$a4
5	.byt "F",$ce
6fntk	=$a5
7	.byt "SPC",$a8
8spctk	=$a6
9	.byt "THE",$ce
10thentk	=$a7
11	.byt "NO",$d4
12nottk	=$a8
13	.byt "STE",$d0
14steptk	=$a9
15	.byt $ab
16plustk	=$aa
17	.byt $ad
18minutk	=$ab
19	.byt $aa
20	.byt $af
21	.byt $de
22	.byt "AN",$c4
23	.byt "O",$d2
24	.byt 190
25greatk	=$b1
26	.byt $bd
27equltk	=$b2
28	.byt 188
29lesstk	=$b3
30	.byt "SG",$ce
31onefun	=$b4
32	.byt "IN",$d4
33	.byt "AB",$d3
34	.byt "US",$d2
35	.byt "FR",$c5
36	.byt "PO",$d3
37	.byt "SQ",$d2
38	.byt "RN",$c4
39	.byt "LO",$c7
40	.byt "EX",$d0
41	.byt "CO",$d3
42	.byt "SI",$ce
43	.byt "TA",$ce
44	.byt "AT",$ce
45	.byt "PEE",$cb
46	.byt "LE",$ce
47	.byt "STR",$a4
48	.byt "VA",$cc
49	.byt "AS",$c3
50	.byt "CHR",$a4
51lasnum	=$c7
52	.byt "LEFT",$a4
53	.byt "RIGHT",$a4
54	.byt "MID",$a4
55	.byt "G",$cf
56gotk	=$cb
57	.byt 0
58
59;**************************************
60reslst2	.byt "MO", 'N' + $80
61	.byt "DO", 'S' + $80
62	.byt "OL", 'D' + $80
63	.byt "GEO", 'S' + $80
64	.byt "VPOK", 'E' + $80
65	.byt "VLOA", 'D' + $80
66	.byt "SCREE", 'N' + $80
67	.byt "PSE", 'T' + $80
68	.byt "LIN", 'E' + $80
69	.byt "FRAM", 'E' + $80
70	.byt "REC", 'T' + $80
71	.byt "CHA", 'R' + $80
72	.byt "MOUS", 'E' + $80
73	.byt "COLO", 'R' + $80
74	.byt "TES", 'T' + $80
75	.byt "RESE", 'T' + $80
76	.byt "CL", 'S' + $80
77	.byt "VPEE", 'K' + $80
78	.byt "M", 'X' + $80
79	.byt "M", 'Y' + $80
80	.byt "M", 'B' + $80
81	.byt "JO", 'Y' + $80
82	.byt 0
83num_esc_statements = 17
84num_esc_functions = 5
85;**************************************
86
87err01	.byt "TOO MANY FILE",$d3
88err02	.byt "FILE OPE",$ce
89err03	.byt "FILE NOT OPE",$ce
90err04	.byt "FILE NOT FOUN",$c4
91err05	.byt "DEVICE NOT PRESEN",$d4
92err06	.byt "NOT INPUT FIL",$c5
93err07	.byt "NOT OUTPUT FIL",$c5
94err08	.byt "MISSING FILE NAM",$c5
95err09	.byt "ILLEGAL DEVICE NUMBE",$d2
96err10	.byt "NEXT WITHOUT FO",$d2
97errnf	=10
98err11	.byt "SYNTA",$d8
99errsn	=11
100err12	.byt "RETURN WITHOUT GOSU",$c2
101errrg	=12
102err13	.byt "OUT OF DAT",$c1
103errod	=13
104err14	.byt "ILLEGAL QUANTIT",$d9
105errfc	=14
106err15	.byt "OVERFLO",$d7
107errov	=15
108err16	.byt "OUT OF MEMOR",$d9
109errom	=16
110err17	.byt "UNDEF",$27
111	.byt "D STATEMEN",$d4
112errus	=17
113err18	.byt "BAD SUBSCRIP",$d4
114errbs	=18
115err19	.byt "REDIM",$27,"D ARRA",$d9
116errdd	=19
117err20	.byt "DIVISION BY ZER",$cf
118errdvo	=20
119err21	.byt "ILLEGAL DIREC",$d4
120errid	=21
121err22	.byt "TYPE MISMATC",$c8
122errtm	=22
123err23	.byt "STRING TOO LON",$c7
124errls	=23
125err24	.byt "FILE DAT",$c1
126errbd	=24
127err25	.byt "FORMULA TOO COMPLE",$d8
128errst	=25
129err26	.byt "CAN",$27,"T CONTINU",$c5
130errcn	=26
131err27	.byt "UNDEF",$27,"D FUNCTIO",$ce
132erruf	=27
133err28	.byt "VERIF",$d9
134ervfy	=28
135err29	.byt "LOA",$c4
136erload	=29
137
138; table to translate error message #
139; to address of string containing message
140;
141errtab	.word err01
142	.word err02
143	.word err03
144	.word err04
145	.word err05
146	.word err06
147	.word err07
148	.word err08
149	.word err09
150	.word err10
151	.word err11
152	.word err12
153	.word err13
154	.word err14
155	.word err15
156	.word err16
157	.word err17
158	.word err18
159	.word err19
160	.word err20
161	.word err21
162	.word err22
163	.word err23
164	.word err24
165	.word err25
166	.word err26
167	.word err27
168	.word err28
169	.word err29
170	.word err30
171
172okmsg	.byt $d,"OK",$d,$0
173err	.byt $20," ERROR",0 ;add a space for vic-40 screen
174intxt	.byt " IN ",0
175reddy	.byt $d,"READY.",$d,0
176erbrk	=30
177brktxt	.byt $d
178err30	.byt "BREAK",0,$a0 ;shifted space
179
180forsiz	=$12
181fndfor	tsx
182	inx
183	inx
184	inx
185	inx
186ffloop	lda 257,x
187	cmp #fortk
188	bne ffrts
189	lda forpnt+1
190	bne cmpfor
191	lda 258,x
192	sta forpnt
193	lda 259,x
194	sta forpnt+1
195cmpfor	cmp 259,x
196	bne addfrs
197	lda forpnt
198	cmp 258,x
199	beq ffrts
200addfrs	txa
201	clc
202	adc #forsiz
203	tax
204	bne ffloop
205ffrts	rts
206bltu	jsr reason
207	sta strend
208	sty strend+1
209bltuc	sec
210	lda hightr
211	sbc lowtr
212	sta index
213	tay
214	lda hightr+1
215	sbc lowtr+1
216	tax
217	inx
218	tya
219	beq decblt
220	lda hightr
221	sec
222	sbc index
223	sta hightr
224	bcs blt1
225	dec hightr+1
226	sec
227blt1	lda highds
228	sbc index
229	sta highds
230	bcs moren1
231	dec highds+1
232	bcc moren1
233bltlp	lda (hightr),y
234	sta (highds),y
235moren1	dey
236	bne bltlp
237	lda (hightr),y
238	sta (highds),y
239decblt	dec hightr+1
240	dec highds+1
241	dex
242	bne moren1
243	rts
244getstk	asl a
245	adc #numlev+numlev+16
246	bcs omerr
247	sta index
248	tsx
249	cpx index
250	bcc omerr
251	rts
252reason	cpy fretop+1
253	bcc rearts
254	bne trymor
255	cmp fretop
256	bcc rearts
257trymor	pha
258	ldx #8+addprc
259	tya
260reasav	pha
261	lda highds-1,x
262	dex
263	bpl reasav
264	jsr garba2
265	ldx #248-addprc
266reasto	pla
267	sta highds+8+addprc,x
268	inx
269	bmi reasto
270	pla
271	tay
272	pla
273	cpy fretop+1
274	bcc rearts
275	bne omerr
276	cmp fretop
277	bcs omerr
278rearts	rts
279
280