-
Notifications
You must be signed in to change notification settings - Fork 85
/
Copy pathoa1src
429 lines (429 loc) · 4.29 KB
/
oa1src
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
.PAG 'SCREEN EDITOR & I/O'
*=LASTWR
;*** SOFT MACHINE ******
CINT LDA #$7F
STA IER
STA 6
STA 6+1
LDX #0
TXA
PX1 STA TIME,X
LE1F0 DEX
BNE PX1
DEX
LDA #<KEY
STA CINV
LDA #>KEY
STA CINV+1
LDA #3
STA DFLTO
LDA #$F
STA PIAL
ASL A
STA PIA
STA P2DB
STX IEEO
STX TIH
LDA #$3D
STA PIAS
BIT PIAK
LDA #$3C
STA IEEIS
STA IEEOS
STA PIAL1
STX IEEO
LDA #$C
STA PCR
STA BLNCT
STA BLNSW
CLSR LDY #0
STY RVS
STY PNT
LDA #$84
STA PNT+1
LE241 LDA #'
DEC PNT+1
LPS4 STA (PNT)Y
DEY
BNE LPS4
LDA PNT+1
CMP #$80
BNE LE241
LDA #$80
LDX #25
LPS1 STA LDTB1-1,X
LPS3 DEX
BNE LPS1
LDY #18
JSR LE273
LDY #12
JSR LE273
LDY #5
JSR LE273
NXTD LDY #0
STY PNTR
STY TBLX
JSR STUPT
RTS
LE273 LDX #24
LE275 INC LDTB1,X
DEX
DEY
BNE LE275
RTS
LP2 LDY KEYD
LDX #0
LP1 LDA KEYD+1,X
STA KEYD,X
INX
CPX NDX
BNE LP1
DEC NDX
TYA
CLI
RTS
LOOP4 JSR PRT
LOOP3 LDA NDX
STA BLNSW
BEQ LOOP3
SEI
LDA BLNON
BEQ LP21
LDA GDBLN
LDY #0
STY BLNON
JSR DSPP
LP21 JSR LP2
CMP #$83
BNE LP22
SEI
LDX #9
STX NDX
LP23 LDA RUNTB-1,X
STA KEYD-1,X
DEX
BNE LP23
BEQ LOOP3
LP22 CMP #$D
BNE LOOP4
LDY LNMX
STY CRSW
CLP5 LDA (PNT)Y
CMP #'
BNE CLP6
DEY
BNE CLP5
CLP6 INY
STY INDX
LDY #0
STY PNTR
STY QTSW
LDA LSXP
BMI LOP5
CMP TBLX
BNE LOP5
LDA LSTP
STA PNTR
CMP INDX
BCC LOP5
JMP CLP2
LOOP5 TYA
PHA
TXA
PHA
LDA CRSW
BEQ LOOP3
LOP5 LDY PNTR
LDA (PNT)Y
STA DATA
LOP51 AND #$3F
ASL DATA
BIT DATA
BPL LOP54
ORA #$80
LOP54 BCC LOP52
LDX QTSW
BNE LOP53
LOP52 BVS LOP53
ORA #$40
LOP53 INC PNTR
JSR QTSWC
CPY INDX
BNE CLP1
CLP2 LDA #0
STA CRSW
LDA #$D
LDX DFLTO
CPX #3
BEQ CLP21
CLP2A JSR PRT
CLP21 LDA #$D
CLP1 STA DATA
PLA
TAX
PLA
TAY
LDA DATA
CMP #$DE
BNE CLP7
LDA #$FF
CLP7 RTS
QTSWC CMP #$22
BNE QTSWL
LDA QTSW
EOR #$1
STA QTSW
LDA #$22
QTSWL RTS
NXT33 ORA #$40
NXT3 LDX RVS
BEQ NVS
NC3 ORA #$80
NVS LDX INSRT
BEQ NVS1
DEC INSRT
NVS1 JSR DSPP
JSTS INC PNTR
LDY LNMX
CPY PNTR
BCS LOOP2
LDX TBLX
CPY #79
BNE JSTS1
JSR JSTSX
JSR NXLN
LDA #0
STA PNTR
JMP LOOP2
JSTS1 CPX #24
BNE JTS2
JSR SCRL
LOOP2 PLA
TAY
LDA INSRT
BEQ LOP2
LSR QTSW
LOP2 PLA
TAX
PLA
CLI
RTS
JSTSX CPX #23
BCS JSXB
LDA LDTB1+2,X
ORA #$80
STA LDTB1+2,X
JSXB RTS
JTS2 JSR JSTS2
JMP LOOP2
SCRL JSR SCROL
DEC TBLX
LDX TBLX
JSTS2 ASL LDTB1+1,X
LSR LDTB1+1,X
JSR JSTSX
LDA PNTR
PHA
JSR STUPT
PLA
STA PNTR
RTS
BKLN LDY #39
LDX TBLX
BNE BKLN1
STX PNTR
PLA
PLA
BNE LOOP2
BKLN1 LDA LDTB1-1,X
BMI NTCN2
DEX
LDA LDTB1-1,X
LDY #79
NTCN2 DEX
STX TBLX
STA POINT
LDA LDTB2,X
STA PNT
STY PNTR
STY LNMX
RTS
PRT PHA
STA DATA
TXA
PHA
TYA
PHA
LDA #0
STA CRSW
LDY PNTR
LDA DATA
BPL *+5
JMP NXTX
CMP #$D
BNE NJT1
JMP NXT1
NJT1 CMP #'
BCC NTCN
AND #$3F
JSR QTSWC
JMP NXT3
NTCN LDX INSRT
BEQ CNC3X
JMP NC3
CNC3X CMP #$14
BNE NTCN1
DEY
STY PNTR
BPL BK1
JSR BKLN
JMP BK2
BK1 INY
LDA (PNT)Y
DEY
STA (PNT)Y
INY
CPY LNMX
BNE BK1
BK2 LDA #'
STA (PNT)Y
BNE JPL3
NTCN1 LDX QTSW
BEQ NC3W
CNC3 JMP NC3
NC3W CMP #$12
BNE NC1
STA RVS
NC1 CMP #$13
BNE NC2
JSR NXTD
NC2 CMP #$1D
BNE NCX2
INY
STY PNTR
DEY
CPY LNMX
BCC NCZ2
JSR NXLN
LDY #0
JPL4 STY PNTR
NCZ2 JMP LOOP2
NCX2 CMP #$11
BNE JPL3
CLC
TYA
ADC #40
TAY
CMP LNMX
BCC JPL4
BEQ JPL4
JSR NXLN
JPL3 JMP LOOP2
PRT1 INX
STA TBLX
TYA
SBC #40
STA PNTR
PRT2 INC TBLX
LDA LDTB2
STA PNT
LDA LDTB1
STA POINT
BNE JPL3
NXTX AND #$7F
CMP #$7F
BNE NXTX1
LDA #$5E
NXTX1 CMP #'
BCC *+5
JMP NXT33
CMP #$D
BNE UP5
JMP NXT1
UP5 LDX QTSW
BNE UP6
CMP #$14
BNE UP9
LDY LNMX
LDA (PNT)Y
CMP #'
BNE INS3
CPY PNTR
BNE INS1
INS3 CPY #79
BEQ JPL3
JSR NEWLN
INS1 LDY LNMX
INS2 DEY
LDA (PNT)Y
INY
STA (PNT)Y
DEY
CPY PNTR
BNE INS2
LDA #$20
STA (PNT)Y
INC INSRT
BNE JLP2
UP9 LDX INSRT
BEQ UP2
UP6 ORA #$40
JMP NC3
UP2 CMP #$11
BNE NXT2
LDA PNTR
CMP #40
BCC UP1
SBC #40
STA PNTR
BCS JLP2
UP1 LDX TBLX
BEQ JLP2
LDA LDTB1-1,X
BPL UP3
DEC TBLX
JSR STUPT
BCC JLP2
UP3 DEX
DEX
STX TBLX
JSR STUPT
LDA PNTR
CLC
ADC #40
STA PNTR
BNE JLP2
NXT2 CMP #$12
BNE NXT6
LDA #0
STA RVS
NXT6 CMP #$1D
BNE NXT61
DEY
STY PNTR
BPL JLP2
JSR BKLN
JMP LOOP2
NXT61 CMP #$13
BNE JLP2
JSR CLSR
JLP2 JMP LOOP2
NXLN SEC
LSR LSXP
LDX TBLX
NXLN2 INX
CPX #25
BNE NXLN1
JSR SCROL
NXLN1 LDA LDTB1,X
BPL NXLN2
STX TBLX
JMP STUPT
NXT1 LDA #0
STA INSRT
STA RVS
STA QTSW
STA PNTR
JSR NXLN
JMP LOOP2
.FILE OA2SRC