-
Notifications
You must be signed in to change notification settings - Fork 482
Expand file tree
/
Copy patht2.s
More file actions
404 lines (362 loc) · 4.31 KB
/
t2.s
File metadata and controls
404 lines (362 loc) · 4.31 KB
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
" recognition stack frame advance
advance:0
lac frame
dac 8
lac advance i
dac 8 i
lac ii
dac 8 i
lac ignore
dac 8 i
lac j
dac 8 i
lac k
dac 8 i
lac frame
dac nframe i
lac nframe
dac frame
add dffrmsz
dac nframe
dac nframe
jms between; add rbot; add rtop
jms halt
isz advance
jmp advance i
retreat:
dzm junk
lac gflag
sza
jmp 1f
jms bundlep
dac junk
1:lac frame
dac nframe
lac frame i
dac frame
dac 8
lac 8 i
dac 3f "retrun address
lac 8 i
dac ii
lac 8 i
dac ignore
lac fflag
sna
jmp 2f
lac 8 i "restore j and k on failure
dac j
lac 8 i
dac k
2:lac junk
sna
jmp 3f
dac nframe i "stass reslts
isz nframe
3:jmp
" bundle up results and return single pointer to them in ac
" return 0 if no results
bundlep:0
lac fflag
sza
jmp 2f "no results on failure
jms nframe0
dac 9f+t
cma
tad nframe
cma
dac 9f+t+1
sma
jmp 2f
sad m1
jmp 3f "only one result, no bundling necessary
lac 9f+t
tad m1
dac 8
1:lac 8 i
jms kput
isz 9f+t+1
jmp 1b
lac k "make up result pointer
add l.gk
jmp bundlep i
2:cla
jmp bundlep i
3:lac 9f+t i
jmp bundlep i
t=t+1 "where to find results
t=t+1 "negative of result count
" the main interpreter loop
" locate original value of nframe for present stack level.
nframe0:0
jms s1get; add d.ii
dac junk
lac junk i
dac junk
lac junk i
and opmask
sad l.rw
jmp 1f
lac refrsz
jmp 2f
1:lac junk i
and o17777
2:add frame
jmp nframe0 i
halt:0
lac 1f
jms obuild
lac halt
jms putoct
lac onenl
jms obuild
xct rstack+1
1:.+1;012077;end
rinterp:
las "trace check
and d5
sna
jmp .+3
lac bugr
jms bug
lac fflag
ral
lac ii i
and opmask
sad l.ra
jmp rera
sad l.rb
jmp rerb
szl
jmp retreat
lrs 14
and o17
add rbranch
dac .+1
jmp
rbranch:
jmp .+1 i
reno
rerx
rerc
regc
rerf
rerw
rera
reuu
rero
rerm
rers
rerv
reuu
reuu
reuu
reuu
reuu:
jms halt
rerb:
cml
rera:
dzm fflag
snl
jmp goon
jms aget
dac ii
jmp rinterp
backup:
lac jsav
dac j
nuts:
law
dac fflag
reno:
goon:
lac ii i
isz ii
and exitmask
sza
jmp retreat
jmp rinterp
rerw:
jms aget
add frame
dac nframe
jmp goon
rerc:
jms advance; jmp goon
jms aget
dac ii
jmp rinterp
gegf:
rerf:
jms aget
add ljmp
dac .+1
jmp
rerx:
lac j
dac jsav
jms aget
1:dac 9f+t
jms lchar
sad o777
jmp goon
dac 9f+t+1
jms getj
sad 9f+t+1
jmp 2f
jmp backup
2:lac 9f+t
add o400000
jmp 1b
t=t+1 "address of next comparison char
t=t+1 "character itself
aget:0
lac ii i
and o17777
jmp aget i
regc:
lac ii i
and o757777
xor exitmask
dac nframe i
isz nframe
jmp goon
kput:0
isz k
dac junk1
lac k
jms between; add d0; add kmax
jms halt
add kbot
dac junk
lac junk1
dac junk i
jmp kput i
s0get:0
lac frame
xct s0get i
dac junk
lac junk i
isz s0get
jmp s0get i
s1get:0
lac frame i
xct s1get i
dac junk
lac junk i
isz s1get
jmp s1get i
s0put:0
lmq
lac frame
xct s0put i
dac junk
lacq
dac junk i
isz s0put
jmp s0put i
" here is the generaion interpreter
" the k table cant move while its active
geno:
ggoon:
lac ii i
isz ii
and exitmask
sza
jmp retreat
ginterp:
las "trace check
and d6
sna
jmp .+3
lac bugg
jms bug
lac ii i
lrss 14
and o7
add gbranch
dac .+1
jmp
gbranch:
jmp .+1 i
geno
gegx
geuu
gegc
gegf
gegk
gegp
gegq
geuu:
jms halt
gegx:
lac ii i
and o417777
jms obuild
jmp ggoon
gegq:
jms advance; jmp ggoon
lac env
add d.ii
dac junk
jms aget
add junk i
dac junk
lac junk i
dac ii
lac env
add d.env
dac junk
lac junk i
dac env
jmp ginterp
gegp:
jms advance; jmp ggoon
lac env
add d.ii
dac junk
lac frame i
dac env
jms aget
cma
add junk i
dac ii
jmp ginterp
gegk:
lac ii i
jms aget
add kbot
dac ii
jms s0put; add d.ii
lac frame
dac env
jmp ginterp
gegc:
jms advance; jmp ggoon
jms aget
dac ii
jmp ginterp
bug:0
dac 1f+2
lac onenl
jms obuild
lac ii
jms putoct
lac ii i
lrs 14
and o17
add 1f+2
dac 1f+2
lac 1f+2 i
dac 1f+2
lac 1f
jms obuild
lac ii i
jms putoct
las
and d4
sza
jms halt
jmp bug i
1:0400000 .+1; 040; 0; 040777