comparison level1/cmds/shell_21.asm @ 1506:9f3ff1c25f05

Back-ported from Level 2
author boisy
date Wed, 14 Jan 2004 05:27:24 +0000
parents 84ea83668304
children 34f1e3e66aef
comparison
equal deleted inserted replaced
1505:5d726c0e6238 1506:9f3ff1c25f05
1 ******************************************************************** 1 ********************************************************************
2 * Shell - OS-9 Command Interpreter 2 * Shell - OS-9 command line interpreter
3 * 3 *
4 * $Id$ 4 * $Id$
5 * 5 *
6 * Edt/Rev YYYY/MM/DD Modified by 6 * Edt/Rev YYYY/MM/DD Modified by
7 * Comment 7 * Comment
8 * ------------------------------------------------------------------ 8 * ------------------------------------------------------------------
9 * 20 ????/??/?? 9 * 21 ????/??/??
10 * From Tandy OS-9 Level One VR 02.00.00. 10 * Original Tandy/Microware version.
11 * 11 *
12 * 21 2002/04/05 Boisy G. Pitre 12 * 21/2 2003/01/22 Boisy Pitre
13 * CHD no longer requires WRITE permission. 13 * CHD no longer sets WRITE. permission.
14 14
15 nam Shell 15 nam Shell
16 ttl OS-9 Command Interpreter 16 ttl OS-9 command line interpreter
17 17
18 * Disassembled 02/04/03 22:01:32 by Disasm v1.6 (C) 1988 by RML 18 * Disassembled 99/04/18 22:59:49 by Disasm v1.6 (C) 1988 by RML
19 19
20 ifp1 20 ifp1
21 use defsfile 21 use defsfile
22 endc 22 endc
23 23
24 tylg set Prgrm+Objct 24 tylg set Prgrm+Objct
25 atrv set ReEnt+rev 25 atrv set ReEnt+rev
26 rev set $00 26 rev set $02
27 edition set 21 27 edition set 21
28 28
29 mod eom,name,tylg,atrv,start,size 29 mod eom,name,tylg,atrv,start,size
30 30
31 org 0 31 org 0
33 u0001 rmb 2 33 u0001 rmb 2
34 u0003 rmb 1 34 u0003 rmb 1
35 u0004 rmb 1 35 u0004 rmb 1
36 u0005 rmb 1 36 u0005 rmb 1
37 u0006 rmb 2 37 u0006 rmb 2
38 u0008 rmb 2 38 u0008 rmb 1
39 u0009 rmb 1
39 u000A rmb 1 40 u000A rmb 1
40 u000B rmb 1 41 u000B rmb 1
41 u000C rmb 1 42 u000C rmb 1
42 u000D rmb 1 43 u000D rmb 1
43 u000E rmb 1 44 kbdsignl rmb 1
44 u000F rmb 1 45 u000F rmb 1
45 u0010 rmb 1 46 u0010 rmb 1
46 u0011 rmb 1 47 u0011 rmb 1
47 u0012 rmb 1 48 u0012 rmb 1
48 u0013 rmb 4 49 u0013 rmb 1
49 u0017 rmb 14 50 u0014 rmb 1
50 u0025 rmb 1 51 u0015 rmb 1
51 u0026 rmb 7 52 u0016 rmb 1
52 u002D rmb 17 53 u0017 rmb 22
53 u003E rmb 5 54 u002D rmb 3
54 u0043 rmb 8 55 u0030 rmb 14
55 u004B rmb 19 56 u003E rmb 32
56 u005E rmb 46 57 u005E rmb 2
57 u008C rmb 1 58 u0060 rmb 16
58 u008D rmb 25 59 u0070 rmb 58
59 u00A6 rmb 4 60 u00AA rmb 85
60 u00AA rmb 17 61 u00FF rmb 513
61 u00BB rmb 25
62 u00D4 rmb 3
63 u00D7 rmb 40
64 u00FF rmb 438
65 size equ . 62 size equ .
66 63 name equ *
67 name fcs /Shell/ 64
65 L000D fcs /Shell/
68 fcb edition 66 fcb edition
69 67
70 L0013 fcb $13 68 L0013 fcb $13
71 fcs "PascalS" 69 fcs "PascalS"
72 fcb $25 % 70 fcb $25 %
80 fcb $00 78 fcb $00
81 fcb $00 79 fcb $00
82 fcb $00 80 fcb $00
83 fcb $00 81 fcb $00
84 fcb $00 82 fcb $00
85 L002E fcb C$LF 83 Intro fcb C$LF
86 fcc "Shell" 84 fcc "Shell"
87 fcb C$CR 85 fcb C$CR
88 L0035 fcb C$LF 86 DefPrmpt fcb C$LF
89 L0036 fcc "OS9:" 87 OS9Prmpt fcc "OS9:"
90 88 OS9PrmL equ *-OS9Prmpt
91 L003A stb <u000E 89 DefPrmL equ *-DefPrmpt
90
91 IcptRtn stb <kbdsignl
92 rti 92 rti
93 93
94 start leas -$05,s 94 start leas -$05,s
95 pshs y,x,b,a 95 pshs y,x,b,a
96 ldb #$24 96 ldb #$6F
97 lbsr L00C9 97 lbsr L0175
98 leax <L003A,pcr 98 leax <IcptRtn,pcr
99 os9 F$Icpt 99 os9 F$Icpt
100 puls x,b,a 100 puls x,b,a
101 std <u0006 101 std <u0006
102 beq L005B 102 beq L005B
103 lbsr L0131 103 lbsr L017B
104 bcs L00BC 104 bcs L00C2
105 tst <u000C 105 tst <u000C
106 bne L00BB 106 bne L00C1
107 L005B lds ,s++ 107 L005B lds ,s++
108 leax <L002E,pcr 108 L005E leax <Intro,pcr
109 tst <u000F 109 tst <u0012
110 bne L0074 110 bne L0076
111 bsr L00BF 111 bsr WriteLin
112 L0067 leax <L0035,pcr 112 bcs Exit
113 ldy #$0005 113 L0069 leax <DefPrmpt,pcr
114 L006E tst <u000F 114 ldy #DefPrmL
115 bne L0074 115 L0070 tst <u0012
116 bsr L00C3 116 bne L0076
117 L0074 clra 117 bsr WritLin2
118 leax <u0025,u 118 L0076 clra
119 leax <u0070,u
119 ldy #$00C8 120 ldy #$00C8
120 os9 I$ReadLn 121 os9 I$ReadLn
121 bcc L008E 122 bcc L0094
122 cmpb #E$EOF 123 cmpb #E$EOF
123 beq L00B2 124 beq L00B8
124 L0085 tst <u0011 125 L0087 tst <u000F
125 bne L00BC 126 bne L008F
126 os9 F$PErr 127 tst <u0014
127 bra L0067 128 bne L00C2
128 L008E cmpy #$0001 129 L008F os9 F$PErr
129 bhi L009E 130 bra L0069
130 leax >L0036,pcr 131 L0094 cmpy #$0001
131 ldy #$0004 132 bhi L00A4
132 bra L006E 133 leax >OS9Prmpt,pcr
133 L009E tst <u0010 134 ldy #OS9PrmL
134 beq L00A4 135 bra L0070
135 bsr L00BF 136 L00A4 tst <u0013
136 L00A4 lbsr L0131 137 beq L00AA
137 bcc L0067 138 bsr WriteLin
139 L00AA lbsr L017B
140 bcc L0069
138 tstb 141 tstb
139 bne L0085 142 bne L0087
140 bra L0067 143 bra L0069
141 L00AE fcc "eof" 144
145 eofmsg fcc "eof"
142 fcb C$CR 146 fcb C$CR
143 L00B2 tst <u000F 147
144 bne L00BB 148 L00B8 tst <u0012
145 leax <L00AE,pcr 149 bne L00C1
146 bsr L00BF 150 leax <eofmsg,pcr
147 L00BB clrb 151 bsr WriteLin
148 L00BC os9 F$Exit 152 L00C1 clrb
149 L00BF ldy #80 153 L00C2 lda <u000F
150 L00C3 lda #$02 154 lbne L0331
151 os9 I$WritLn 155 Exit os9 F$Exit
152 rts 156
153 L00C9 clr b,u 157 WriteLin ldy #80
154 L00CB decb 158 WritLin2 lda #$02 stderr
155 bpl L00C9 159 os9 I$WritLn write line
156 rts 160 rts
157 L00CF fdb Comment-* 161
162 * I=...
163 Immortal lbsr L03B3
164 lbcs L02ED
165 pshs x
166 ldb #SS.DevNm
167 leax <u0016,u
168 lda #PDELIM
169 sta ,x+
170 clra stdin
171 os9 I$GetStt get device name
172 puls x
173 lbcs L02ED
174 inc <u000F
175 inc <u0010
176 lbsr L02ED
177 clr <u0010
178 rts
179
180 L00FB fdb Comment-*
158 fcs "*" 181 fcs "*"
159 fdb Wait-* 182 fdb Wait-*
160 fcs "W" 183 fcs "W"
161 fdb Chd-* 184 fdb Chd-*
162 fcs "CHD" 185 fcs "CHD"
163 fdb Chx-* 186 fdb Chx-*
164 fcs "CHX" 187 fcs "CHX"
165 fdb Ex-* 188 fdb Ex-*
166 fcs "EX" 189 fcs "EX"
167 fdb Kill-* 190 fdb Kill-*
168 fcs "KILL" 191 fcs "KILL"
169 fdb X-* 192 fdb X-*
170 fcs "X" 193 fcs "X"
171 fdb NOX-* 194 fdb NOX-*
172 fcs "-X" 195 fcs "-X"
178 fcs "T" 201 fcs "T"
179 fdb NoEcho-* 202 fdb NoEcho-*
180 fcs "-T" 203 fcs "-T"
181 fdb SetPr-* 204 fdb SetPr-*
182 fcs "SETPR" 205 fcs "SETPR"
206 fdb Immortal-*
207 fcs "I="
183 fdb NextCmd-* 208 fdb NextCmd-*
184 fcs ";" 209 fcs ";"
185 fdb $0000 210 fdb $0000
186 L010A fdb Pipe-* 211 L013A fdb Pipe-*
187 fcs "!" 212 fcs "!"
188 fdb NextCmd2-* 213 fdb NextCmd2-*
189 fcs ";" 214 fcs ";"
190 fdb Backgrnd-* 215 fdb Backgrnd-*
191 fcs "&" 216 fcs "&"
192 fdb Return-* 217 fdb Return-*
193 fcb $80+C$CR 218 fcb $8D
194 L0116 fdb ErrRedir-* 219 L0146 fdb AllRedir-*
220 fcs "<>>>"
221 fdb IERedir-*
222 fcs "<>>"
223 fdb IORedir-*
224 fcs "<>"
225 fdb OERedir-*
226 fcs ">>>"
227 fdb ErrRedir-*
195 fcs ">>" 228 fcs ">>"
196 fdb InRedir-* 229 fdb InRedir-*
197 fcs "<" 230 fcs "<"
198 fdb OutRedir-* 231 fdb OutRedir-*
199 fcs ">" 232 fcs ">"
200 fdb StkSiz-* 233 fdb StkSize-*
201 fcs "#" 234 fcs "#"
202 fdb $0000 235 fdb $0000
203 L0125 fcb $0d 236
237 L0169 fcb $0d
204 fcc "()" 238 fcc "()"
205 fcb $FF 239 fcb $ff
206 L0129 fcb $0D 240 L016D fcb $0d
207 fcb $21,$23,$26,$3b,$3c,$3e,$ff 241 fcc "!#&;<>"
208 L0131 fcb $c6,$0E,$8d,$94 242 fcb $ff
209 L0135 clr <u0003 243
210 clr <u000E 244 L0175 clr b,u
211 leay <L00CF,pcr 245 decb
212 lbsr L01C3 246 bpl L0175
213 bcs L0192 247 rts
248 L017B ldb #$0E
249 bsr L0175
250 L017F clr <u0003
251 clr <kbdsignl
252 leay >L00FB,pcr
253 lbsr L020F
254 bcs L01DE
214 cmpa #C$CR 255 cmpa #C$CR
215 beq L0192 256 beq L01DE
216 sta <u000C 257 sta <u000C
217 cmpa #'( 258 cmpa #'(
218 bne L016F 259 bne L01BA
219 leay >name,pcr 260 leay >L000D,pcr
220 sty <u0004 261 sty <u0004
221 leax $01,x 262 leax $01,x
222 stx <u0008 263 stx <u0008
223 L0156 inc <u000D 264 L01A1 inc <u000D
224 L0158 leay <L0125,pcr 265 L01A3 leay <L0169,pcr
225 bsr L01DB 266 bsr L0227
226 cmpa #'( 267 cmpa #'(
227 beq L0156 268 beq L01A1
228 cmpa #') 269 cmpa #')
229 bne L018A 270 bne L01D6
230 dec <u000D 271 dec <u000D
231 bne L0158 272 bne L01A3
232 lda #$0D 273 lda #$0D
233 sta -$01,x 274 sta -$01,x
234 bra L0173 275 bra L01BE
235 L016F bsr L0195 276 L01BA bsr L01E1
236 bcs L0192 277 bcs L01DE
237 L0173 leay <L0129,pcr 278 L01BE leay <L016D,pcr
238 bsr L01DB 279 bsr L0227
239 tfr x,d 280 tfr x,d
240 subd <u0008 281 subd <u0008
241 std <u0006 282 std <u0006
242 leax -$01,x 283 leax -$01,x
243 leay <L010A,pcr 284 leay >L013A,pcr
244 bsr L01C3 285 bsr L020F
245 bcs L0192 286 bcs L01DE
246 ldy <u0004 287 ldy <u0004
247 L018A lbne L02BE 288 L01D6 lbne L0326
248 cmpa #C$CR 289 cmpa #C$CR
249 bne L0135 290 bne L017F
250 L0192 lbra L028F 291 L01DE lbra L02ED
251 L0195 stx <u0004 292 L01E1 stx <u0004
252 bsr L01A8 293 bsr L01F4
253 bcs L01A7 294 bcs L01F3
254 L019B bsr L01A8 295 L01E7 bsr L01F4
255 bcc L019B 296 bcc L01E7
256 leay >L0116,pcr 297 leay >L0146,pcr
257 bsr L01C3 298 bsr L020F
258 stx <u0008 299 stx <u0008
259 L01A7 rts 300 L01F3 rts
260 L01A8 os9 F$PrsNam 301 L01F4 os9 F$PrsNam
261 bcc L01B9 302 bcc L0205
262 lda ,x+ 303 lda ,x+
263 cmpa #C$PERD 304 cmpa #C$PERD
264 bne L01BD 305 bne L0209
265 cmpa ,x+ 306 cmpa ,x+
266 beq L01BB 307 beq L0207
267 leay -$01,x 308 leay -$01,x
268 L01B9 leax ,y 309 L0205 leax ,y
269 L01BB clra 310 L0207 clra
270 rts 311 rts
271 L01BD comb 312 L0209 comb
272 leax -$01,x 313 leax -$01,x
273 ldb #E$BPNAM 314 ldb #E$BPNam
274 rts 315 rts
275 L01C3 bsr L01E9 316 L020F bsr L0241
276 pshs y 317 pshs y
277 bsr L020C 318 bsr L0264
278 bcs L01D4 319 bcs L0220
279 ldd ,y 320 ldd ,y
280 jsr d,y 321 jsr d,y
281 puls y 322 puls y
282 bcc L01C3 323 bcc L020F
283 rts 324 rts
284 L01D4 clra 325 L0220 clra
285 lda ,x 326 lda ,x
286 puls pc,y 327 puls pc,y
287 L01D9 puls y 328 L0225 puls y
288 L01DB pshs y 329 L0227 pshs y
289 lda ,x+ 330 lda ,x+
290 L01DF tst ,y 331 L022B tst ,y
291 bmi L01D9 332 bmi L0225
292 cmpa ,y+ 333 cmpa #$22
293 bne L01DF 334 bne L023B
335 L0233 lda ,x+
336 cmpa #$22
337 bne L0233
338 lda ,x+
339 L023B cmpa ,y+
340 bne L022B
294 puls pc,y 341 puls pc,y
295 L01E9 pshs x 342 L0241 pshs x
296 lda ,x+ 343 lda ,x+
297 cmpa #C$SPAC 344 cmpa #C$SPAC
298 beq L01FF 345 beq L0257
299 cmpa #C$COMA 346 cmpa #C$COMA
300 beq L01FF 347 beq L0257
301 leax >L0129,pcr 348 leax >L016D,pcr
302 L01F9 cmpa ,x+ 349 L0251 cmpa ,x+
303 bhi L01F9 350 bhi L0251
304 puls pc,x 351 puls pc,x
305 L01FF leas $02,s 352 L0257 leas $02,s
306 lda #C$SPAC 353 lda #C$SPAC
307 L0203 cmpa ,x+ 354 L025B cmpa ,x+
308 beq L0203 355 beq L025B
309 leax -$01,x 356 leax -$01,x
310 NextCmd andcc #^Carry 357 NextCmd andcc #^Carry
311 rts 358 rts
312 L020C pshs y,x 359 L0264 pshs y,x
313 leay $02,y 360 leay $02,y
314 L0210 ldx ,s 361 L0268 ldx ,s
315 L0212 lda ,x+ 362 L026A lda ,x+
316 cmpa #$61 363 cmpa #$61
317 bcs L021A 364 bcs L0272
318 suba #$20 365 suba #$20
319 L021A eora ,y+ 366 L0272 eora ,y+
320 lsla 367 lsla
321 bne L022E 368 bne L0286
322 bcc L0212 369 bcc L026A
323 lda -$01,y 370 lda -$01,y
324 cmpa #$C1 371 cmpa #$C1
325 bcs L022B 372 bcs L0283
326 bsr L01E9 373 bsr L0241
327 bcs L022E 374 bcs L0286
328 L022B clra 375 L0283 clra
329 puls pc,y,b,a 376 puls pc,y,b,a
330 L022E leay -$01,y 377 L0286 leay -$01,y
331 L0230 lda ,y+ 378 L0288 lda ,y+
332 bpl L0230 379 bpl L0288
333 sty $02,s 380 sty $02,s
334 ldd ,y++ 381 ldd ,y++
335 bne L0210 382 bne L0268
336 comb 383 comb
337 puls pc,y,x 384 puls pc,y,x
338 385
339 Ex lbsr L0195 386 Ex lbsr L01E1
340 clra 387 clra
341 bsr L0260 388 bsr L02B8
342 bsr L025F 389 bsr L02B7
343 bsr L025F 390 bsr L02B7
344 bsr Comment 391 bsr Comment
345 leax $01,x 392 leax $01,x
346 tfr x,d 393 tfr x,d
347 subd <u0008 394 subd <u0008
348 std <u0006 395 std <u0006
349 leas >u00FF,u 396 leas >u00FF,u
350 lbsr L0394 397 lbsr L0497
351 os9 F$Chain 398 os9 F$Chain
352 os9 F$Exit 399 lbra L00C2
353 L025F inca 400 L02B7 inca
354 L0260 pshs a 401 L02B8 pshs a
355 bra L02AB 402 bra L0313
356 403
357 Chx lda #DIR.+EXEC. 404 Chx lda #DIR.+EXEC.
358 bra L026A 405 bra L02C2
359 *Chd lda #DIR.+UPDAT. 406 *Chd lda #DIR.+UPDAT. note write mode!!
360 * Removed WRITE. requirement above (some devices are read only) 407 * Removed WRITE. requirement above (some devices are read only)
361 Chd lda #DIR.+READ. 408 Chd lda #DIR.+READ. note write mode!!
362 L026A os9 I$ChgDir 409 L02C2 os9 I$ChgDir
363 rts 410 rts
411
364 Prompt clra 412 Prompt clra
365 bra L0273 413 bra L02CB
414
366 NoPrompt lda #$01 415 NoPrompt lda #$01
367 L0273 sta <u000F 416 L02CB sta <u0012
368 rts 417 rts
418
369 Echo lda #$01 419 Echo lda #$01
370 bra L027B 420 bra L02D3
371 NoEcho clra 421 NoEcho clra
372 L027B sta <u0010 422 L02D3 sta <u0013
373 rts 423 rts
424
374 X lda #$01 425 X lda #$01
375 bra L0283 426 bra L02DB
376 427
377 NOX clra 428 NOX clra
378 L0283 sta <u0011 429 L02DB sta <u0014
379 rts 430 rts
380 Comment lda #C$CR 431 Comment lda #$0D
381 L0288 cmpa ,x+ 432 L02E0 cmpa ,x+
382 bne L0288 433 bne L02E0
383 cmpa ,-x 434 cmpa ,-x
384 rts 435 rts
385 L028F pshs b,a,cc 436 L02E7 pshs b,a,cc
437
438 lda #$01
439 bra L02F1
440 L02ED pshs b,a,cc
441 lda #$02
442 L02F1 sta <u0011
386 clra 443 clra
387 L0292 bsr L029D 444 L02F4 bsr L02FF
388 inca 445 inca
389 cmpa #$02 446 cmpa <u0011
390 bls L0292 447 bls L02F4
391 ror ,s+ 448 ror ,s+
392 puls pc,b,a 449 puls pc,b,a
393 L029D pshs a 450 L02FF pshs a
451 tst <u0010
452 bmi L031B
453 bne L0313
394 tst a,u 454 tst a,u
395 beq L02B6 455 beq L031E
396 os9 I$Close 456 os9 I$Close
397 lda a,u 457 lda a,u
398 os9 I$Dup 458 os9 I$Dup
399 L02AB ldb ,s 459 L0313 ldb ,s
400 lda b,u 460 lda b,u
401 beq L02B6 461 beq L031E
402 clr b,u 462 clr b,u
403 os9 I$Close 463 L031B os9 I$Close
404 L02B6 puls pc,a 464 L031E puls pc,a
405 L02B8 fcc "WHAT?" 465
466 L0320 fcc "WHAT?"
406 fcb C$CR 467 fcb C$CR
407 L02BE bsr L028F 468
408 leax <L02B8,pcr 469 L0326 bsr L02ED
409 lbsr L00BF 470 leax <L0320,pcr
471 lbsr WriteLin
410 clrb 472 clrb
411 coma 473 coma
412 rts 474 rts
475
476 L0331 inc <u0010
477 bsr L02ED
478 lda #$FF
479 sta <u0010
480 bsr L02E7
481 leax <u0016,u
482 bsr L03BC
483 lbcs Exit
484 lda #$02
485 bsr L02FF
486 lbsr L03DC
487 clr <u0010
488 lbra L005E
413 InRedir ldd #$0001 489 InRedir ldd #$0001
414 bra L02E3 490 bra L036E
415 ErrRedir ldd #$020D 491 ErrRedir ldd #$020D
416 stb -$02,x 492 stb -$02,x
417 bra L02D7 493 bra L035E
418 494
419 OutRedir lda #$01 495 OutRedir lda #$01
420 L02D7 ldb #$02 496 L035E ldb #$02
421 bra L02E3 497 bra L036E
422 L02DB tst a,u 498 L0362 tst a,u
423 bne L02BE 499 bne L0326
424 pshs b,a 500 pshs b,a
425 bra L02ED 501 tst <u0010
426 L02E3 tst a,u 502 bmi L0386
427 bne L02BE 503 bra L0378
504 L036E tst a,u
505 bne L0326
428 pshs b,a 506 pshs b,a
429 ldb #$0D 507 ldb #$0D
430 stb -$01,x 508 stb -$01,x
431 L02ED os9 I$Dup 509 L0378 os9 I$Dup
432 bcs L030D 510 bcs L03A8
433 ldb ,s 511 ldb ,s
434 sta b,u 512 sta b,u
435 lda ,s 513 lda ,s
436 os9 I$Close 514 os9 I$Close
437 lda $01,s 515 L0386 lda $01,s
438 bita #$02 516 bmi L0391
439 bne L0306 517 ldb ,s
518 bsr L03E1
519 tsta
520 bpl L0398
521 L0391 anda #$0F
522 os9 I$Dup
523 bra L03A6
524 L0398 bita #$02
525 bne L03A1
440 os9 I$Open 526 os9 I$Open
441 bra L030B 527 bra L03A6
442 L0306 ldb #PREAD.+READ.+WRITE. 528 L03A1 ldb #PREAD.+READ.+WRITE.
443 os9 I$Create 529 os9 I$Create
444 L030B stb $01,s 530 L03A6 stb $01,s
445 L030D puls pc,b,a 531 L03A8 puls pc,b,a
446 532 L03AA clra
447 StkSiz ldb #$0D 533 L03AB ldb #$03
534 bra L0362
535
536 AllRedir lda #$0D
537 L03B1 sta -$04,x
538 L03B3 bsr L03BC
539 bcc L03DC
540 L03B7 rts
541 IORedir lda #$0D
542 sta -$02,x
543 L03BC bsr L03AA
544 bcs L03B7
545 ldd #$0180
546 bra L0362
547 IERedir lda #$0D
548 sta -$03,x
549 bsr L03AA
550 bcs L03B7
551 ldd #$0280
552 bra L0362
553 OERedir lda #$0D
554 sta -$03,x
555 lda #$01
556 bsr L03AB
557 bcs L03B7
558 L03DC ldd #$0281
559 bra L0362
560 L03E1 pshs x,b,a
561 ldd ,x++
562 cmpd #$2F30
563 bcs L040D
564 cmpd #$2F32
565 bhi L040D
566 pshs x,b,a
567 lbsr L0241
568 puls x,b,a
569 bcs L040D
570 andb #$03
571 cmpb $01,s
572 bne L0404
573 ldb $01,s
574 ldb b,u
575 L0404 orb #$80
576 stb ,s
577 puls b,a
578 leas $02,s
579 rts
580 L040D puls pc,x,b,a
581
582 StkSize ldb #$0D
448 stb -$01,x 583 stb -$01,x
449 ldb <u0003 584 ldb <u0003
450 bne L02BE 585 lbne L0326
451 lbsr L04CA 586 lbsr ASC2Int
452 eora #'K 587 eora #'K
453 anda #$DF 588 anda #$DF
454 bne L0328 589 bne L042C
455 leax $01,x 590 leax $01,x
456 lda #$04 591 lda #$04
457 mul 592 mul
458 tsta 593 tsta
459 bne L02BE 594 lbne L0326
460 L0328 stb <u0003 595 L042C stb <u0003
461 lbra L01E9 596 lbra L0241
597
462 Return leax -$01,x 598 Return leax -$01,x
463 lbsr L03C7 599 lbsr L04CA
464 bra L0337 600 bra L043B
465 NextCmd2 lbsr L03C3 601
466 L0337 bcs L034A 602 NextCmd2 lbsr L04C6
467 lbsr L028F 603 L043B bcs L044E
468 bsr L035C 604 lbsr L02ED
469 L033E bcs L034A 605 bsr L045F
470 lbsr L01E9 606 L0442 bcs L044E
607 lbsr L0241
471 cmpa #$0D 608 cmpa #$0D
472 bne L0349 609 bne L044D
473 leas $04,s 610 leas $04,s
474 L0349 clrb 611 L044D clrb
475 L034A lbra L028F 612 L044E lbra L02ED
476 Backgrnd lbsr L03C3 613
477 bcs L034A 614 Backgrnd bsr L04C6
478 bsr L034A 615 bcs L044E
616 bsr L044E
479 ldb #$26 617 ldb #$26
480 lbsr L0495 618 lbsr L0597
481 bra L033E 619 bra L0442
620
482 Wait clra 621 Wait clra
483 L035C pshs a 622 L045F pshs a
484 L035E os9 F$Wait 623 L0461 os9 F$Wait
485 tst <u000E 624 tst <kbdsignl
486 beq L0376 625 beq L0479
487 ldb <u000E 626 ldb <kbdsignl
488 cmpb #S$Abort 627 cmpb #$02
489 bne L038E 628 bne L0491
490 lda ,s 629 lda ,s
491 beq L038E 630 beq L0491
492 os9 F$Send 631 os9 F$Send
493 clr ,s 632 clr ,s
494 bra L035E 633 bra L0461
495 L0376 bcs L0392 634 L0479 bcs L0495
496 cmpa ,s 635 cmpa ,s
497 beq L038E 636 beq L0491
498 tst ,s 637 tst ,s
499 beq L0383 638 beq L0486
500 tstb 639 tstb
501 beq L035E 640 beq L0461
502 L0383 pshs b 641 L0486 pshs b
503 bsr L034A 642 bsr L044E
504 ldb #$2D 643 ldb #$2D
505 lbsr L0495 644 lbsr L0597
506 puls b 645 puls b
507 L038E tstb 646 L0491 tstb
508 beq L0392 647 beq L0495
509 coma 648 coma
510 L0392 puls pc,a 649 L0495 puls pc,a
511 L0394 lda #Prgrm+Objct 650 L0497 lda #Prgrm+Objct
512 ldb <u0003 651 ldb <u0003
513 ldx <u0004 652 ldx <u0004
514 ldy <u0006 653 ldy <u0006
515 ldu <u0008 654 ldu <u0008
516 rts 655 rts
517 L03A0 lda #EXEC. 656 L04A3 lda #EXEC.
518 os9 I$Open 657 os9 I$Open
519 bcs L03FE 658 bcs L0500
520 leax <u0013,u 659 leax <u005E,u
521 ldy #$000D 660 ldy #$000D
522 os9 I$Read 661 os9 I$Read
523 pshs b,cc 662 pshs b,cc
524 os9 I$Close 663 os9 I$Close
525 puls b,cc 664 puls b,cc
526 lbcs L045F 665 lbcs L0561
527 lda $06,x 666 lda $06,x
528 ldy $0B,x 667 ldy $0B,x
529 bra L03D7 668 bra L04D9
530 L03C3 lda #$0D 669 L04C6 lda #$0D
531 sta -$01,x 670 sta -$01,x
532 L03C7 pshs u,y,x 671 L04CA pshs u,y,x
533 clra 672 clra
534 ldx <u0004 673 ldx <u0004
535 os9 F$Link 674 IFGT Level-1
536 bcs L03A0 675 os9 F$NMLink
537 ldy u000B,u 676 ELSE
538 os9 F$UnLink 677 pshs u
539 L03D7 cmpa #Prgrm+Objct 678 os9 F$Link
540 beq L0425 679 puls u
680 ENDC
681 bcs L04A3
682 ldx <u0004
683 IFGT Level-1
684 os9 F$UnLoad
685 ELSE
686 pshs a,b,x,y,u
687 os9 F$Link
688 os9 F$UnLink
689 os9 F$UnLink
690 puls a,b,x,y,u
691 ENDC
692 L04D9 cmpa #Prgrm+Objct
693 beq L0527
541 sty <u000A 694 sty <u000A
542 leax >L0013,pcr 695 leax >L0013,pcr
543 L03E2 tst ,x 696 L04E4 tst ,x
544 beq L045D 697 IFGT Level-1
698 beq L055F
699 ELSE
700 lbeq L055F
701 ENDC
545 cmpa ,x+ 702 cmpa ,x+
546 beq L03F0 703 beq L04F2
547 L03EA tst ,x+ 704 L04EC tst ,x+
548 bpl L03EA 705 bpl L04EC
549 bra L03E2 706 bra L04E4
550 L03F0 ldd <u0008 707 L04F2 ldd <u0008
551 subd <u0004 708 subd <u0004
552 addd <u0006 709 addd <u0006
553 std <u0006 710 std <u0006
554 ldd <u0004 711 ldd <u0004
555 std <u0008 712 std <u0008
556 bra L0423 713 bra L0525
557 L03FE ldx <u0006 714 L0500 ldx <u0006
558 leax $05,x 715 leax $05,x
559 stx <u0006 716 stx <u0006
560 ldx <u0004 717 ldx <u0004
561 ldu $04,s 718 ldu $04,s
562 lbsr InRedir 719 lbsr InRedir
563 bcs L045F 720 bcs L0561
564 ldu <u0008 721 ldu <u0008
565 ldd #$5820 722 ldd #$5820
566 std ,--u 723 std ,--u
567 ldd #$5020 724 ldd #$5020
568 std ,--u 725 std ,--u
569 ldb #$2D 726 ldb #$2D
570 stb ,-u 727 stb ,-u
571 stu <u0008 728 stu <u0008
572 leax >name,pcr 729 leax >L000D,pcr
573 L0423 stx <u0004 730 L0525 stx <u0004
574 L0425 ldx <u0004 731 L0527 ldx <u0004
575 lda #Prgrm+Objct 732 lda #Prgrm+Objct
576 os9 F$Link 733 IFGT Level-1
577 bcc L0433 734 os9 F$NMLink
578 os9 F$Load 735 ELSE
579 bcs L045F 736 pshs u
580 L0433 pshs u 737 os9 F$Link
581 tst <u0003 738 puls u
582 bne L0442 739 ENDC
583 ldd u000B,u 740 bcc L0535
741 IFGT Level-1
742 os9 F$NMLoad
743 ELSE
744 pshs u
745 os9 F$Load
746 puls u
747 ENDC
748 bcs L0561
749 L0535 tst <u0003
750 bne L0542
751 tfr y,d
584 addd <u000A 752 addd <u000A
585 addd #$00FF 753 addd #$00FF
586 sta <u0003 754 sta <u0003
587 L0442 lbsr L0394 755 L0542 lbsr L0497
588 os9 F$Fork 756 os9 F$Fork
589 puls u 757 pshs b,a,cc
590 pshs b,cc 758 bcs L0552
591 bcs L0454
592 ldx #$0001 759 ldx #$0001
593 os9 F$Sleep 760 os9 F$Sleep
594 L0454 clr <u0004 761 L0552 lda #Prgrm+Objct
762 ldx <u0004
763 clr <u0004
595 clr <u0005 764 clr <u0005
596 os9 F$UnLink 765 IFGT Level-1
597 puls pc,u,y,x,b,cc 766 os9 F$UnLoad
598 767 ELSE
599 L045D ldb #E$NEMod 768 os9 F$Link
600 L045F coma 769 os9 F$UnLink
770 os9 F$UnLink
771 ENDC
772 puls pc,u,y,x,b,a,cc
773
774 L055F ldb #E$NEMod
775 L0561 coma
601 puls pc,u,y,x 776 puls pc,u,y,x
602 777
603 L0462 fcc "/pipe" 778 PipeName fcc "/pipe"
604 fcb C$CR 779 fcb C$CR
780
605 Pipe pshs x 781 Pipe pshs x
606 leax <L0462,pcr 782 leax <PipeName,pcr
607 ldd #$0103 783 ldd #$0103
608 lbsr L02DB 784 lbsr L0362
609 puls x 785 puls x
610 bcs L04C9 786 bcs L05CB
611 lbsr L03C3 787 lbsr L04C6
612 bcs L04C9 788 bcs L05CB
613 lda ,u 789 lda ,u
614 bne L0487 790 bne L0589
615 os9 I$Dup 791 os9 I$Dup
616 bcs L04C9 792 bcs L05CB
617 sta ,u 793 sta ,u
618 L0487 clra 794 L0589 clra
619 os9 I$Close 795 os9 I$Close
620 lda #$01 796 lda #$01
621 os9 I$Dup 797 os9 I$Dup
622 lda #$01 798 lda #$01
623 lbra L029D 799 lbra L02FF
624 800 L0597 pshs y,x,b,a
625 L0495 pshs y,x,b,a
626 pshs y,x,b 801 pshs y,x,b
627 leax $01,s 802 leax $01,s
628 ldb #$2F 803 ldb #$2F
629 L049D incb 804 L059F incb
630 suba #$64 805 suba #100
631 bcc L049D 806 bcc L059F
632 stb ,x+ 807 stb ,x+
633 ldb #$3A 808 ldb #$3A
634 L04A6 decb 809 L05A8 decb
635 adda #$0A 810 adda #$0A
636 bcc L04A6 811 bcc L05A8
637 stb ,x+ 812 stb ,x+
638 adda #$30 813 adda #$30
639 ldb #$0D 814 ldb #$0D
640 std ,x 815 std ,x
641 leax ,s 816 leax ,s
642 lbsr L00BF 817 lbsr WriteLin
643 leas $05,s 818 leas $05,s
644 puls pc,y,x,b,a 819 puls pc,y,x,b,a
645 820
646 Kill bsr L04CA 821 * Kill a process
647 cmpb #$02 822 Kill bsr ASC2Int
648 bcs L04E5 823 cmpb #$02 compare against first user process ID
649 tfr b,a 824 bls L05E7 if lower or same,
650 ldb #S$Kill 825 tfr b,a transfer process ID to A
651 os9 F$Send 826 ldb #S$Kill load B with kill signal
652 L04C9 rts 827 os9 F$Send and send to process in A
653 L04CA clrb 828 L05CB rts
654 829
655 L04CB lda ,x+ 830 * Entry: X = ASCII representation of number
831 * Exit : B = decimal value of ASCII number
832 ASC2Int clrb
833 L05CD lda ,x+
656 suba #$30 834 suba #$30
657 cmpa #$09 835 cmpa #$09
658 bhi L04DC 836 bhi L05DE
659 pshs a 837 pshs a
660 lda #$0A 838 lda #10
661 mul 839 mul
662 addb ,s+ 840 addb ,s+
663 bcc L04CB 841 bcc L05CD
664 L04DC lda ,-x 842 L05DE lda ,-x
665 bcs L04E3 843 bcs L05E5
666 tstb 844 tstb
667 bne L04C9 845 bne L05CB
668 L04E3 leas $02,s 846 L05E5 leas $02,s
669 L04E5 lbra L02BE 847 L05E7 lbra L0326
670 SetPr bsr L04CA 848
671 stb <u0012 849 SetPr bsr ASC2Int
672 lbsr L01E9 850 stb <u0015
673 bsr L04CA 851 lbsr L0241
674 lda <u0012 852 bsr ASC2Int
853 lda <u0015
675 os9 F$SPrior 854 os9 F$SPrior
676 rts 855 rts
677 856
678 emod 857 emod
679 eom equ * 858 eom equ *