0
|
1 ********************************************************************
|
|
2 * SCF - Sequential Character file manager
|
|
3 *
|
|
4 * $Id$
|
|
5 *
|
|
6 * This contains an added SetStat call to allow placing prearranged
|
|
7 * data into the keyboard buffer of ANY SCF related device.
|
|
8 *
|
|
9 * This also includes Kevin Darlings SCF Editor patches.
|
|
10 * This means windows, VDG screens, terminals, etc.
|
|
11 *
|
|
12 * Remember to have a Carriage Return ($0D) at the end of the buffer
|
|
13 * to terminate it without having trailing garbage (this will be fixed
|
|
14 * to be automatic in a future version).
|
|
15 *
|
|
16 * ENTRY PARAMETERS:
|
|
17 * x = Address of string to place in buffer
|
|
18 * y = Length of the string to place in buffer
|
|
19 * a = Path number (usually 0)
|
|
20 * b = $A0 (syscall SETSTAT function call number)
|
|
21 *
|
|
22 * Ed. Comments Who YY/MM/DD
|
|
23 * ------------------------------------------------------------------
|
|
24 * 13 Obtained from L2 Upgrade archive
|
|
25 * 16 Updated to Curtis Boyle's version, contains BGP 98/10/20
|
|
26 * several optimizations and new SetStat to
|
|
27 * stuff any string in the input buffer.
|
|
28
|
|
29 nam SCF
|
|
30 ttl Sequential Character file manager
|
|
31
|
|
32 * Disassembled 98/08/24 22:11:42 by Disasm v1.6 (C) 1988 by RML
|
|
33
|
|
34 ifp1
|
|
35 use defsfile
|
|
36 use scfdefs
|
|
37 endc
|
|
38
|
|
39 tylg set FlMgr+Objct
|
|
40 atrv set ReEnt+rev
|
|
41 rev set $00
|
|
42 edition set 16
|
|
43
|
|
44 mod eom,name,tylg,atrv,start,size
|
|
45
|
|
46 u0000 rmb 0
|
|
47 size equ .
|
|
48
|
|
49 name fcs /SCF/
|
|
50 fcb edition
|
|
51
|
|
52 start lbra Create
|
|
53 lbra Open
|
|
54 lbra MakDir
|
|
55 lbra ChgDir
|
|
56 lbra Delete
|
|
57 lbra Seek
|
|
58 lbra Read
|
|
59 lbra Write
|
|
60 lbra ReadLn
|
|
61 lbra WriteLn
|
|
62 lbra GetStat
|
|
63 lbra SetStat
|
|
64 lbra Term
|
|
65
|
|
66 L0038 puls y
|
|
67
|
|
68 * ChgDir/Makdir entry
|
|
69 ChgDir
|
|
70 MakDir comb
|
|
71 ldb #E$BPNam
|
|
72 L003D rts
|
|
73
|
|
74
|
|
75 ******************************
|
|
76 *
|
|
77 * Create or open a path to device
|
|
78 *
|
|
79 * Entry: Y = Path descriptor pointer
|
|
80 * U = Callers register stack pointer
|
|
81
|
|
82 * Check for pathname legality
|
|
83 Open
|
|
84 Create ldx PD.DEV,y get device table entry pointer
|
|
85 stx <PD.TBL,y save copy of pointer in path desc
|
|
86 ldu PD.RGS,y get caller's regs
|
|
87 pshs y save pointer to path desc
|
|
88 ldx R$X,u get caller's X (device name)
|
|
89 os9 F$PrsNam parse name
|
|
90 bcs L0038 branch if error
|
|
91 tsta end of pathname?
|
|
92 bmi L0058 yes, go on
|
|
93
|
|
94 * We're not at the end of the pathname parse it again
|
|
95
|
|
96 leax ,y point to actual device name
|
|
97 os9 F$PrsNam get next pathlist element
|
|
98 bcc L0038 if valid, branch to error
|
|
99
|
|
100 * Legal pathname detected let's keep going
|
|
101
|
|
102 L0058 sty R$X,u save updated pathlist pointer
|
|
103 puls y retrieve path desc pointer
|
|
104
|
|
105 * Allocate input buffer
|
|
106
|
|
107 ldd #256 get size of input buffer in bytes
|
|
108 os9 F$SRqMem allocate path desc buffer
|
|
109 bcs L003D can't allocate it, return with error
|
|
110 stu PD.BUF,y save off in path desc
|
|
111
|
|
112 * Preload buffer with string & CR's
|
|
113
|
|
114 clrb
|
|
115 bsr FillBuf
|
|
116
|
|
117 * cute message
|
|
118 fcc /by K.Kaplan, L.Crane, R.Doggett/
|
|
119 fcb C$CR
|
|
120
|
|
121 * put cute message into our newly allocated PD buffer
|
|
122 FillBuf puls x get PC into X (points to cute message)
|
|
123 L008D lda ,x+ get byte of string, XOR it
|
|
124 sta ,u+ store it in buffer
|
|
125 decb dec count
|
|
126 cmpa #C$CR carriage return?
|
|
127 bne L008D nope, continue
|
|
128 putcr sta ,u+ continue putting C$CRs...
|
|
129 decb in buffer
|
|
130 bne putcr until we've reached end
|
|
131
|
|
132 * Set up lines per page
|
|
133
|
|
134 ldu PD.DEV,y get device table entry ptr
|
|
135 beq MakDir if none, branch to error
|
|
136 ldx V$STAT,u X = static storage ptr
|
|
137 lda <PD.PAG,y get page len from dev desc
|
|
138 sta V.LINE,x store in static
|
|
139
|
|
140 * Attach to device by name
|
|
141
|
|
142 ldx V$DESC,u get pointer to dev desc
|
|
143 ldd <PD.D2P,y get pointer to dev2 name
|
|
144 beq L00CF branch if none
|
|
145 leax d,x else X = addr of name
|
|
146 lda PD.MOD,y get dev mode
|
|
147 lsra
|
|
148 rorb
|
|
149 lsra
|
|
150 rolb
|
|
151 rola
|
|
152 rorb
|
|
153 rola
|
|
154 pshs y save path desc
|
|
155 ldy <D.Proc get current proc desc
|
|
156 ldu <D.SysPrc get system proc desc
|
|
157 stu <D.Proc make system current process
|
|
158 os9 I$Attach attach to dev2 on behalf of system
|
|
159 sty <D.Proc restore old current proc desc
|
|
160 puls y restore path desc ptr
|
|
161 bcs L0111 branch if error
|
|
162
|
|
163 * Device attached update pointers
|
|
164
|
|
165 stu PD.DV2,y else save dev tbl ptr to dev2 in path desc
|
|
166 ldu PD.DEV,y get our dev's dev table addr
|
|
167 L00CF ldu V$STAT,u get static storage pointer
|
|
168 clra
|
|
169 clrb
|
|
170 std <PD.PLP,y clear path desc list ptr
|
|
171 sta <PD.PST,y and path status
|
|
172 pshs b,a
|
|
173 ldx <V.PDLHd,u get pointer to path desc head ptr
|
|
174 bne L00E8 branch if not zero
|
|
175 sty <V.PDLHd,u else save our path desc ptr
|
|
176 bra L00F8 and branch
|
|
177
|
|
178 L00E6 tfr d,x
|
|
179 L00E8 ldb <PD.PST,x get path status
|
|
180 bne L00EF branch if not zero
|
|
181 inc 1,s else inc b on stack
|
|
182 L00EF ldd <PD.PLP,x get path desc list ptr
|
|
183 bne L00E6 branch if not zero
|
|
184 sty <PD.PLP,x
|
|
185 L00F8 lda #$29
|
|
186 pshs a
|
|
187 inc $02,s inc B on stack
|
|
188 lbsr L025B
|
|
189 lda $02,s
|
|
190 leas $03,s clean up stack
|
|
191 deca
|
|
192 bcs L010F
|
|
193 bne L010D
|
|
194 lbra L0250
|
|
195
|
|
196 L010D clrb
|
|
197 rts
|
|
198
|
|
199 L010F bsr L0149
|
|
200 L0111 pshs b,cc
|
|
201 bsr L0136
|
|
202 puls pc,b,cc
|
|
203
|
|
204 Term pshs cc
|
|
205 orcc #IntMasks
|
|
206 ldx PD.DEV,y get dev table entry addr
|
|
207 bsr L0182
|
|
208 ldx $0A,y
|
|
209 bsr L0182
|
|
210 puls cc
|
|
211 tst $02,y
|
|
212 beq L012B
|
|
213
|
|
214 Delete
|
|
215 Seek clra
|
|
216 rts
|
|
217
|
|
218 L012B bsr L0149
|
|
219 lda #$2A
|
|
220 pshs x,a
|
|
221 lbsr L025B
|
|
222 leas $03,s
|
|
223 L0136 ldu $0A,y
|
|
224 beq L013D
|
|
225 os9 I$Detach
|
|
226 L013D ldu $08,y
|
|
227 beq L0147
|
|
228 ldd #$0100
|
|
229 os9 F$SRtMem
|
|
230 L0147 clra
|
|
231 rts
|
|
232
|
|
233 L0149 ldx #$0001
|
|
234 pshs u,y,x,b,a,cc
|
|
235 ldu $03,y
|
|
236 beq L017B
|
|
237 ldu $02,u
|
|
238 beq L017B
|
|
239 ldx <$16,u
|
|
240 beq L017B
|
|
241 ldd <$3D,y
|
|
242 cmpy <$16,u
|
|
243 bne L0172
|
|
244 std <$16,u
|
|
245 bne L017B
|
|
246 clr $04,s
|
|
247 bra L017B
|
|
248 L016D ldx <$3D,x
|
|
249 beq L0180
|
|
250 L0172 cmpy <$3D,x
|
|
251 bne L016D
|
|
252 std <$3D,x
|
|
253 L017B clra
|
|
254 clrb
|
|
255 std <$3D,y
|
|
256 L0180 puls pc,u,y,x,b,a,cc
|
|
257
|
|
258 L0182 leax V$DRIV,x
|
|
259 beq Delete
|
|
260 ldx $02,x
|
|
261 ldb PD.PD,y
|
|
262 lda PD.CPR,y
|
|
263 pshs y,x,b,a
|
|
264 cmpa $03,x
|
|
265 bne L01CA
|
|
266 ldx <D.Proc
|
|
267 leax <P$Path,x
|
|
268 clra
|
|
269 L0198 cmpb a,x
|
|
270 beq L01CA
|
|
271 inca
|
|
272 cmpa #$10
|
|
273 bcs L0198
|
|
274 pshs y
|
|
275 ldd #$1B0C
|
|
276 bsr L01FA
|
|
277 puls y
|
|
278 ldx <D.Proc
|
|
279 lda P$PID,x
|
|
280 sta ,s
|
|
281 os9 F$GProcP
|
|
282 leax <$30,y
|
|
283 ldb $01,s
|
|
284 clra
|
|
285 L01B9 cmpb a,x
|
|
286 beq L01C4
|
|
287 inca
|
|
288 cmpa #$10
|
|
289 bcs L01B9
|
|
290 clr ,s
|
|
291 L01C4 lda ,s
|
|
292 ldx $02,s
|
|
293 sta $03,x
|
|
294 L01CA puls pc,y,x,b,a
|
|
295
|
|
296 GetStat lda <$3F,y
|
|
297 lbne L04C6
|
|
298 ldx PD.RGS,y
|
|
299 lda R$B,x
|
|
300 bne L01F8
|
|
301 pshs y,x,a
|
|
302 lda #$28
|
|
303 sta R$B,x
|
|
304 ldu R$Y,x
|
|
305 pshs u
|
|
306 bsr L01F8
|
|
307 puls u
|
|
308 puls y,x,a
|
|
309 sta R$B,x
|
|
310 ldd R$Y,x
|
|
311 stu R$Y,x
|
|
312 bcs L01F6
|
|
313 std <$34,y
|
|
314 L01F6 clrb
|
|
315 L01F7 rts
|
|
316
|
|
317 L01F8 ldb #$09
|
|
318 L01FA pshs a
|
|
319 clra
|
|
320 ldx PD.DEV,y
|
|
321 ldu V$STAT,x
|
|
322 ldx V$DRIV,x
|
|
323 addd $09,x
|
|
324 leax d,x
|
|
325 puls a
|
|
326 pshs u,y,x
|
|
327 jsr ,x
|
|
328 puls pc,u,y,x
|
|
329
|
|
330 SetStat lbsr L04A2
|
|
331 L0212 bsr L021B
|
|
332 pshs b,cc
|
|
333 lbsr L0453
|
|
334 puls pc,b,cc
|
|
335
|
|
336 * Place data in keyboard buffer
|
|
337
|
|
338 putkey cmpa #$A0
|
|
339 bne L01FA
|
|
340 pshs x,y,u
|
|
341 ldx <D.Proc
|
|
342 lda P$Task,x
|
|
343 ldb <D.SysTsk
|
|
344 ldx R$X,u
|
|
345 pshs x
|
|
346 ldx R$Y,u
|
|
347 ldu PD.BUF,y
|
|
348 tfr x,y
|
|
349 puls x
|
|
350 os9 F$Move
|
|
351 tfr y,d
|
|
352 leau d,u
|
|
353 lda #C$CR
|
|
354 sta ,u
|
|
355 puls x,y,u
|
|
356 bcs L01F7
|
|
357 rts
|
|
358
|
|
359 L021B ldb #$0C
|
|
360 lda $02,u
|
|
361 bne putkey
|
|
362 ldx <$27,y
|
|
363 pshs y,x
|
|
364 ldx <D.Proc
|
|
365 lda P$Task,x
|
|
366 ldb <D.SysTsk
|
|
367 ldx $04,u
|
|
368 leau <$20,y
|
|
369 ldy #$001A
|
|
370 os9 F$Move
|
|
371 puls y,x
|
|
372 bcs L01F7
|
|
373 pshs x
|
|
374 ldd <$27,y
|
|
375 cmpd ,s++
|
|
376 beq L0250
|
|
377 ldu $03,y
|
|
378 ldu $02,u
|
|
379 beq L0250
|
|
380 stb $07,u
|
|
381 L0250 ldx <$34,y
|
|
382 lda #$28
|
|
383 pshs x,a
|
|
384 bsr L025B
|
|
385 puls pc,x,a
|
|
386
|
|
387 L025B pshs u,y,x
|
|
388 ldx PD.RGS,y
|
|
389 ldu R$Y,x
|
|
390 lda R$B,x
|
|
391 pshs u,y,x,a
|
|
392 ldd <$10,s
|
|
393 std R$Y,x
|
|
394 lda $0F,s
|
|
395 sta R$B,x
|
|
396 ldb #$0C
|
|
397 lbsr L04A7
|
|
398 lbsr L0212
|
|
399 puls u,y,x,a
|
|
400 stu $06,x
|
|
401 sta $02,x
|
|
402 bcc L0282
|
|
403 cmpb #$D0
|
|
404 beq L0282
|
|
405 coma
|
|
406 L0282 puls pc,u,y,x
|
|
407
|
|
408 * Device Read routine
|
|
409
|
|
410 Read lbsr L04A2
|
|
411 bcc L028A
|
|
412 L0289 rts
|
|
413
|
|
414 L028A inc PD.RAW,y
|
|
415 ldx R$Y,u get character count from callers Y register
|
|
416 beq L02DC
|
|
417 pshs x
|
|
418 lbsr L03B5 get buffer address
|
|
419 lbsr L03E2
|
|
420 bcs L02A4
|
|
421 tsta
|
|
422 beq L02C4
|
|
423 cmpa <PD.EOF,y end of file character?
|
|
424 bne L02BC
|
|
425 L02A2 ldb #E$EOF
|
|
426 L02A4 leas 2,s
|
|
427 pshs b
|
|
428 bsr L02D5
|
|
429 comb
|
|
430 puls pc,b
|
|
431
|
|
432 L02AD tfr x,d
|
|
433 tstb
|
|
434 bne L02B7
|
|
435 lbsr L042B
|
|
436 ldu $08,y
|
|
437 L02B7 lbsr L03E2
|
|
438 bcs L02A4
|
|
439 L02BC tst <PD.EKO,y echo turned on?
|
|
440 beq L02C4
|
|
441 lbsr L0565
|
|
442 L02C4 leax $01,x
|
|
443 sta ,u+
|
|
444 beq L02CF
|
|
445 cmpa <PD.EOR,y end of record character?
|
|
446 beq L02D3
|
|
447 L02CF cmpx ,s
|
|
448 bcs L02AD
|
|
449 L02D3 leas $02,s
|
|
450 L02D5 lbsr L042B
|
|
451 ldu $06,y
|
|
452 stx $06,u
|
|
453 L02DC lbra L0453
|
|
454
|
|
455 ReadLn lbsr L04A2
|
|
456 bcs L0289
|
|
457 ldx $06,u
|
|
458 beq L02D5
|
|
459 tst $06,u
|
|
460 beq L02EF
|
|
461 ldx #$0100
|
|
462 L02EF pshs x
|
|
463 ldd #$FFFF
|
|
464 std $0D,y
|
|
465 lbsr L03B5
|
|
466 L02F9 lbra L05F8
|
|
467 bcs L0370
|
|
468 L02FE tsta
|
|
469 beq L030C
|
|
470 ldb #$29
|
|
471 L0303 cmpa b,y
|
|
472 beq L032C
|
|
473 incb
|
|
474 cmpb #$31
|
|
475 bls L0303
|
|
476 L030C cmpx $0D,y
|
|
477 bls L0312
|
|
478 stx $0D,y
|
|
479 L0312 leax $01,x
|
|
480 cmpx ,s
|
|
481 bcs L0322
|
|
482 lda <$33,y
|
|
483 lbsr L0565
|
|
484 leax -$01,x
|
|
485 bra L02F9
|
|
486 L0322 lbsr L0403
|
|
487 sta ,u+
|
|
488 lbsr L0413
|
|
489 bra L02F9
|
|
490 L032C pshs pc,x
|
|
491 leax >L033F,pcr
|
|
492 subb #$29
|
|
493 lslb
|
|
494 leax b,x
|
|
495 stx $02,s
|
|
496 puls x
|
|
497 jsr [,s++]
|
|
498 bra L02F9
|
|
499 L033F bra L03BB
|
|
500 bra L03A5
|
|
501 bra L0351
|
|
502 bra L0366
|
|
503 bra L0381
|
|
504 bra L038B
|
|
505 puls pc
|
|
506 bra L03A5
|
|
507 bra L03A5
|
|
508 L0351 leas $02,s
|
|
509 sta ,u
|
|
510 lbsr L0413
|
|
511 ldu $06,y
|
|
512 leax $01,x
|
|
513 stx $06,u
|
|
514 lbsr L042B
|
|
515 leas $02,s
|
|
516 lbra L0453
|
|
517 L0366 leas $02,s
|
|
518 leax ,x
|
|
519 lbeq L02A2
|
|
520 bra L030C
|
|
521 L0370 pshs b
|
|
522 lda #$0D
|
|
523 sta ,u
|
|
524 bsr L037D
|
|
525 puls b
|
|
526 lbra L02A4
|
|
527 L037D lda #$0D
|
|
528 bra L03D7
|
|
529 L0381 lda <$2B,y
|
|
530 sta ,u
|
|
531 bsr L03B5
|
|
532 L0388 lbsr L0418
|
|
533 L038B cmpx $0D,y
|
|
534 beq L03A2
|
|
535 leax $01,x
|
|
536 cmpx $02,s
|
|
537 bcc L03A0
|
|
538 lda ,u+
|
|
539 beq L0388
|
|
540 cmpa <$2B,y
|
|
541 bne L0388
|
|
542 leau -$01,u
|
|
543 L03A0 leax -$01,x
|
|
544 L03A2 rts
|
|
545
|
|
546 L03A3 bsr L03BF
|
|
547 L03A5 leax ,x
|
|
548 beq L03B5
|
|
549 tst <$23,y
|
|
550 beq L03A3
|
|
551 tst <$24,y
|
|
552 beq L03B5
|
|
553 bsr L037D
|
|
554 L03B5 ldx #$0000
|
|
555 ldu $08,y
|
|
556 L03BA rts
|
|
557 L03BB leax ,x
|
|
558 beq L03A2
|
|
559 L03BF leau -$01,u
|
|
560 leax -$01,x
|
|
561 tst <$24,y
|
|
562 beq L03BA
|
|
563 tst <$22,y
|
|
564 beq L03D4
|
|
565 bsr L03D4
|
|
566 lda #$20
|
|
567 lbsr L0565
|
|
568 L03D4 lda <$32,y
|
|
569 L03D7 lbra L0565
|
|
570 L03DA pshs u,y,x
|
|
571 ldx $0A,y
|
|
572 ldu $03,y
|
|
573 bra L03EA
|
|
574
|
|
575 L03E2 pshs u,y,x
|
|
576 ldx PD.DEV,y
|
|
577 ldu PD.DV2,y
|
|
578 beq L03F1
|
|
579 L03EA ldu V$STAT,u
|
|
580 ldb <PD.PAG,y
|
|
581 stb V.LINE,u
|
|
582 L03F1 leax ,x
|
|
583 beq L0401
|
|
584 tfr u,d
|
|
585 ldu V$STAT,x
|
|
586 std V.DEV2,u
|
|
587 ldu #$0003
|
|
588 lbsr L05CC
|
|
589 L0401 puls pc,u,y,x
|
|
590
|
|
591 L0403 tst <$21,y
|
|
592 beq L0412
|
|
593 cmpa #$61
|
|
594 bcs L0412
|
|
595 cmpa #$7A
|
|
596 bhi L0412
|
|
597 suba #$20
|
|
598 L0412 rts
|
|
599
|
|
600 L0413 tst <$24,y
|
|
601 beq L0412
|
|
602 L0418 cmpa #$20
|
|
603 bcc L0420
|
|
604 cmpa #$0D
|
|
605 bne L0423
|
|
606 L0420 lbra L0565
|
|
607 L0423 pshs a
|
|
608 lda #$2E
|
|
609 bsr L0420
|
|
610 puls pc,a
|
|
611
|
|
612 L042B pshs y,x
|
|
613 ldd ,s
|
|
614 beq L0451
|
|
615 tstb
|
|
616 bne L0435
|
|
617 deca
|
|
618 L0435 clrb
|
|
619 ldu $06,y
|
|
620 ldu $04,u
|
|
621 leau d,u
|
|
622 clra
|
|
623 ldb $01,s
|
|
624 bne L0442
|
|
625 inca
|
|
626 L0442 pshs b,a
|
|
627 lda <D.SysTsk
|
|
628 ldx <D.Proc
|
|
629 ldb P$Task,x
|
|
630 ldx P$User,y
|
|
631 puls y
|
|
632 os9 F$Move
|
|
633 L0451 puls pc,y,x
|
|
634
|
|
635 L0453 ldx <D.Proc
|
|
636 lda P$ID,x
|
|
637 ldx PD.DEV,y
|
|
638 bsr L045D
|
|
639 ldx PD.FST,y
|
|
640 L045D beq L0467
|
|
641 ldx V$STAT,x
|
|
642 cmpa V.BUSY,x
|
|
643 bne L0467
|
|
644 clr V.BUSY,x
|
|
645 L0467 rts
|
|
646
|
|
647 L0468 pshs x,a
|
|
648 ldx V$STAT,x get dev static storage addr
|
|
649 lda V.BUSY,x get active proc ID
|
|
650 beq L048A it's not busy, go on
|
|
651 cmpa ,s same process?
|
|
652 beq L049F yes...
|
|
653 pshs a
|
|
654 bsr L0453
|
|
655 puls a
|
|
656 os9 F$IOQu
|
|
657 inc PD.MIN,y
|
|
658 ldx <D.Proc
|
|
659 ldb <P$Signal,x
|
|
660 puls x,a
|
|
661 beq L0468
|
|
662 coma
|
|
663 rts
|
|
664
|
|
665 L048A lda ,s
|
|
666 sta V.BUSY,x
|
|
667 sta V.LPRC,x
|
|
668 lda <PD.PSC,y
|
|
669 sta V.PCHR,x
|
|
670 ldd <PD.INT,y
|
|
671 std V.INTR,x
|
|
672 ldd <PD.XON,y
|
|
673 std V.XON,x
|
|
674 L049F clra
|
|
675 puls pc,x,a
|
|
676
|
|
677 L04A2 lda <PD.PST,y get path status
|
|
678 bne L04C4 exit if anything there
|
|
679 L04A7 ldx <D.Proc get process ID
|
|
680 lda P$ID,x
|
|
681 clr PD.MIN,y
|
|
682 ldx PD.DEV,y
|
|
683 bsr L0468
|
|
684 bcs L04C1
|
|
685 ldx PD.DV2,y
|
|
686 beq L04BB
|
|
687 bsr L0468
|
|
688 bcs L04C1
|
|
689 L04BB tst PD.MIN,y
|
|
690 bne L04A2
|
|
691 clr PD.RAW,y
|
|
692 L04C1 ldu PD.RGS,y
|
|
693 rts
|
|
694
|
|
695 L04C4 leas $02,s purge return address
|
|
696 L04C6 ldb #E$HangUp
|
|
697 cmpa #S$Abort
|
|
698 bcs L04D3
|
|
699 lda PD.CPR,y
|
|
700 ldb #S$Kill
|
|
701 os9 F$Send
|
|
702 L04D3 inc <PD.PST,y
|
|
703 orcc #Carry
|
|
704 rts
|
|
705
|
|
706 WriteLn bsr L04A2
|
|
707 bra L04E1
|
|
708 Write bsr L04A2
|
|
709 inc $0C,y
|
|
710 L04E1 ldx $06,u
|
|
711 beq L055A
|
|
712 pshs x
|
|
713 ldx #$0000
|
|
714 bra L04F1
|
|
715 L04EC tfr u,d
|
|
716 tstb
|
|
717 bne L0523
|
|
718 L04F1 pshs y,x
|
|
719 ldd ,s
|
|
720 ldu $06,y
|
|
721 ldx $04,u
|
|
722 leax d,x
|
|
723 ldd $06,u
|
|
724 subd ,s
|
|
725 cmpd #$0020
|
|
726 bls L0508
|
|
727 ldd #$0020
|
|
728 L0508 pshs b,a
|
|
729 ldd $08,y
|
|
730 inca
|
|
731 subd ,s
|
|
732 tfr d,u
|
|
733 lda #$0D
|
|
734 sta -$01,u
|
|
735 ldy <D.Proc
|
|
736 lda P$Task,y
|
|
737 ldb <D.SysTsk
|
|
738 puls y
|
|
739 os9 F$Move
|
|
740 puls y,x
|
|
741 L0523 lda ,u+
|
|
742 tst $0C,y
|
|
743 bne L053D
|
|
744 lbsr L0403
|
|
745 cmpa #$0A
|
|
746 bne L053D
|
|
747 lda #$0D
|
|
748 tst <$25,y
|
|
749 bne L053D
|
|
750 bsr L0573
|
|
751 bcs L055D
|
|
752 lda #$0A
|
|
753 L053D bsr L0573
|
|
754 bcs L055D
|
|
755 leax $01,x
|
|
756 cmpx ,s
|
|
757 bcc L0554
|
|
758 lda -$01,u
|
|
759 beq L04EC
|
|
760 cmpa <$2B,y
|
|
761 bne L04EC
|
|
762 tst $0C,y
|
|
763 bne L04EC
|
|
764 L0554 leas $02,s
|
|
765 L0556 ldu $06,y
|
|
766 stx $06,u
|
|
767 L055A lbra L0453
|
|
768 L055D leas $02,s
|
|
769 pshs b,cc
|
|
770 bsr L0556
|
|
771 puls pc,b,cc
|
|
772
|
|
773 L0565 pshs u,x,a
|
|
774 ldx $0A,y
|
|
775 beq L0571
|
|
776 cmpa #$0D
|
|
777 beq L05A2
|
|
778 L056F bsr L05C9
|
|
779 L0571 puls pc,u,x,a
|
|
780
|
|
781 L0573 pshs u,x,a
|
|
782 ldx $03,y
|
|
783 cmpa #$0D
|
|
784 bne L056F
|
|
785 ldu $02,x
|
|
786 tst $08,u
|
|
787 bne L0590
|
|
788 tst $0C,y
|
|
789 bne L05A2
|
|
790 tst <$27,y
|
|
791 beq L05A2
|
|
792 dec $07,u
|
|
793 bne L05A2
|
|
794 bra L059A
|
|
795 L0590 lbsr L03DA
|
|
796 bcs L059A
|
|
797 cmpa <$2F,y
|
|
798 bne L0590
|
|
799 L059A lbsr L03DA
|
|
800 cmpa <$2F,y
|
|
801 beq L059A
|
|
802 L05A2 ldu $02,x
|
|
803 clr $08,u
|
|
804 lda #$0D
|
|
805 bsr L05C9
|
|
806 tst $0C,y
|
|
807 bne L05C7
|
|
808 ldb <$26,y
|
|
809 pshs b
|
|
810 tst <$25,y
|
|
811 beq L05BE
|
|
812 lda #$0A
|
|
813 L05BA bsr L05C9
|
|
814 bcs L05C5
|
|
815 L05BE lda #$00
|
|
816 dec ,s
|
|
817 bpl L05BA
|
|
818 clra
|
|
819 L05C5 leas $01,s
|
|
820 L05C7 puls pc,u,x,a
|
|
821
|
|
822 L05C9 ldu #$0006
|
|
823 L05CC pshs u,y,x,a
|
|
824 ldu $02,x
|
|
825 clr $05,u
|
|
826 ldx ,x
|
|
827 ldd $09,x
|
|
828 addd $05,s
|
|
829 leax d,x
|
|
830 lda ,s+
|
|
831 jsr ,x
|
|
832 puls pc,u,y,x
|
|
833 nop
|
|
834 nop
|
|
835 nop
|
|
836
|
|
837 L05E3 lbra L02FE
|
|
838 L05E6 lbra L03E2
|
|
839 L05E9 lbra L0370
|
|
840 L05EC lbra L038B
|
|
841 L05EF lbra L0565
|
|
842 L05F2 lbra L0418
|
|
843 lbra L030C
|
|
844
|
|
845 L05F8 bsr L05E6
|
|
846 bcs L05E9
|
|
847 tsta
|
|
848 beq L05E3
|
|
849 ldb <$2D,y
|
|
850 cmpb #$04
|
|
851 beq L05E3
|
|
852 cmpa <$2D,y
|
|
853 bne L0629
|
|
854 cmpx $0D,y
|
|
855 beq L0622
|
|
856 leax $01,x
|
|
857 cmpx ,s
|
|
858 bcc L0620
|
|
859 lda ,u+
|
|
860 beq L0624
|
|
861 cmpa <$2B,y
|
|
862 bne L0624
|
|
863 leau -$01,u
|
|
864 L0620 leax -$01,x
|
|
865 L0622 bra L05F8
|
|
866 L0624 lbsr L05F2
|
|
867 bra L05F8
|
|
868
|
|
869 * Line editor functions
|
|
870
|
|
871 L0629 cmpa #$13 cntrl-up arrow? (print rest of line)
|
|
872 bne L0647
|
|
873 L062D pshs u
|
|
874 bsr L05EC
|
|
875 lda <$32,y
|
|
876 L0634 cmpu ,s
|
|
877 beq L0642
|
|
878 leau -$01,u
|
|
879 leax -$01,x
|
|
880 lbsr L05EF
|
|
881 bra L0634
|
|
882 L0642 leas $02,s
|
|
883 lbra L05F8
|
|
884
|
|
885 L0647 cmpa #$11 cntrl-right arrow? (insert character)
|
|
886 bne L0664
|
|
887 pshs u
|
|
888 tfr u,d
|
|
889 ldb #$FF
|
|
890 tfr d,u
|
|
891 L0653 lda ,-u
|
|
892 sta $01,u
|
|
893 cmpu ,s
|
|
894 bne L0653
|
|
895 lda #$20
|
|
896 sta ,u
|
|
897 leas $02,s
|
|
898 bra L062D
|
|
899
|
|
900 L0664 cmpa #$10 cntrl-left arrow? (Delete character)
|
|
901 bne L068B
|
|
902 pshs u
|
|
903 lda ,u
|
|
904 cmpa <$2B,y
|
|
905 beq L0687
|
|
906 L0671 lda $01,u
|
|
907 cmpa <$2B,y
|
|
908 beq L067C
|
|
909 sta ,u+
|
|
910 bra L0671
|
|
911 L067C lda #$20
|
|
912 cmpa ,u
|
|
913 bne L0685
|
|
914 lda <$2B,y
|
|
915 L0685 sta ,u
|
|
916 L0687 puls u
|
|
917 bra L062D
|
|
918 L068B cmpa <$2B,y
|
|
919 lbne L05E3
|
|
920 pshs u
|
|
921 bra L069F
|
|
922 L0696 pshs a
|
|
923 lda #$20
|
|
924 lbsr L05EF
|
|
925 puls a
|
|
926 L069F cmpa ,u+
|
|
927 bne L0696
|
|
928 puls u
|
|
929 lbra L05E3
|
|
930
|
|
931 emod
|
|
932 eom equ *
|
|
933 end
|