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