0
|
1 ********************************************************************
|
|
2 * Shell - OS-9 Command Interpreter
|
|
3 *
|
|
4 * $Id$
|
|
5 *
|
|
6 * Ed. Comments Who YY/MM/DD
|
|
7 * ------------------------------------------------------------------
|
|
8 * 20 Original Microware distribution version
|
|
9
|
|
10 nam Shell
|
|
11 ttl OS-9 Command Interpreter
|
|
12
|
|
13 * Disassembled 02/04/03 22:01:32 by Disasm v1.6 (C) 1988 by RML
|
|
14
|
|
15 ifp1
|
|
16 use os9defs
|
|
17 endc
|
|
18 tylg set Prgrm+Objct
|
|
19 atrv set ReEnt+rev
|
|
20 rev set $01
|
|
21 mod eom,name,tylg,atrv,start,size
|
|
22 u0000 rmb 1
|
|
23 u0001 rmb 2
|
|
24 u0003 rmb 1
|
|
25 u0004 rmb 1
|
|
26 u0005 rmb 1
|
|
27 u0006 rmb 2
|
|
28 u0008 rmb 2
|
|
29 u000A rmb 1
|
|
30 u000B rmb 1
|
|
31 u000C rmb 1
|
|
32 u000D rmb 1
|
|
33 u000E rmb 1
|
|
34 u000F rmb 1
|
|
35 u0010 rmb 1
|
|
36 u0011 rmb 1
|
|
37 u0012 rmb 1
|
|
38 u0013 rmb 4
|
|
39 u0017 rmb 14
|
|
40 u0025 rmb 1
|
|
41 u0026 rmb 7
|
|
42 u002D rmb 17
|
|
43 u003E rmb 5
|
|
44 u0043 rmb 8
|
|
45 u004B rmb 19
|
|
46 u005E rmb 46
|
|
47 u008C rmb 1
|
|
48 u008D rmb 25
|
|
49 u00A6 rmb 4
|
|
50 u00AA rmb 17
|
|
51 u00BB rmb 25
|
|
52 u00D4 rmb 3
|
|
53 u00D7 rmb 40
|
|
54 u00FF rmb 438
|
|
55 size equ .
|
|
56 name equ *
|
|
57 L000D fcs /Shell/
|
|
58 fcb $14
|
|
59 L0013 fcb $13
|
|
60 fcb $50 P
|
|
61 fcb $61 a
|
|
62 fcb $73 s
|
|
63 fcb $63 c
|
|
64 fcb $61 a
|
|
65 fcb $6C l
|
|
66 fcb $D3 S
|
|
67 fcb $25 %
|
|
68 fcb $52 R
|
|
69 fcb $75 u
|
|
70 fcb $6E n
|
|
71 fcb $C3 C
|
|
72 fcb $22 "
|
|
73 fcb $52 R
|
|
74 fcb $75 u
|
|
75 fcb $6E n
|
|
76 fcb $C2 B
|
|
77 fcb $00
|
|
78 fcb $00
|
|
79 fcb $00
|
|
80 fcb $00
|
|
81 fcb $00
|
|
82 fcb $00
|
|
83 fcb $00
|
|
84 fcb $00
|
|
85 fcb $00
|
|
86 L002E fcb $0A
|
|
87 fcb $53 S
|
|
88 fcb $68 h
|
|
89 fcb $65 e
|
|
90 fcb $6C l
|
|
91 fcb $6C l
|
|
92 fcb $0D
|
|
93 L0035 fcb $0A
|
|
94 L0036 fcb $4F O
|
|
95 fcb $53 S
|
|
96 fcb $39 9
|
|
97 fcb $3A :
|
|
98 L003A fcb $D7 W
|
|
99 fcb $0E
|
|
100 fcb $3B ;
|
|
101 start equ *
|
|
102 leas -$05,s
|
|
103 pshs y,x,b,a
|
|
104 ldb #$24
|
|
105 lbsr L00C9
|
|
106 leax <L003A,pcr
|
|
107 os9 F$Icpt
|
|
108 puls x,b,a
|
|
109 std <u0006
|
|
110 beq L005B
|
|
111 lbsr L0131
|
|
112 bcs L00BC
|
|
113 tst <u000C
|
|
114 bne L00BB
|
|
115 L005B lds ,s++
|
|
116 leax <L002E,pcr
|
|
117 tst <u000F
|
|
118 bne L0074
|
|
119 bsr L00BF
|
|
120 L0067 leax <L0035,pcr
|
|
121 ldy #$0005
|
|
122 L006E tst <u000F
|
|
123 bne L0074
|
|
124 bsr L00C3
|
|
125 L0074 clra
|
|
126 leax <u0025,u
|
|
127 ldy #$00C8
|
|
128 os9 I$ReadLn
|
|
129 bcc L008E
|
|
130 cmpb #$D3
|
|
131 beq L00B2
|
|
132 L0085 tst <u0011
|
|
133 bne L00BC
|
|
134 os9 F$PErr
|
|
135 bra L0067
|
|
136 L008E cmpy #$0001
|
|
137 bhi L009E
|
|
138 leax >L0036,pcr
|
|
139 ldy #$0004
|
|
140 bra L006E
|
|
141 L009E tst <u0010
|
|
142 beq L00A4
|
|
143 bsr L00BF
|
|
144 L00A4 lbsr L0131
|
|
145 bcc L0067
|
|
146 tstb
|
|
147 bne L0085
|
|
148 bra L0067
|
|
149 eim #$6F,$06,s
|
|
150 tst <u000D
|
|
151 clr <u0026
|
|
152 eim #$30,<u008C
|
|
153 bitb >$8D04
|
|
154 L00BB clrb
|
|
155 L00BC os9 F$Exit
|
|
156 L00BF ldy #$0050
|
|
157 L00C3 lda #$02
|
|
158 os9 I$WritLn
|
|
159 rts
|
|
160 L00C9 clr b,u
|
|
161 L00CB decb
|
|
162 bpl L00C9
|
|
163 rts
|
|
164 L00CF oim #$B7,<u00AA
|
|
165 aim #$89,<u00D7
|
|
166 oim #$93,<u0043
|
|
167 lsla
|
|
168 andb #$01
|
|
169 ora #$43
|
|
170 lsla
|
|
171 eorb <u0001
|
|
172 clrb
|
|
173 fcb $45 E
|
|
174 eorb <u0003
|
|
175 adcb <u004B
|
|
176 rola
|
|
177 inca
|
|
178 ldd #$0195
|
|
179 eorb <u0001
|
|
180 lda <u002D
|
|
181 eorb <u0001
|
|
182 jmp >$D001
|
|
183 jmp >$2DD0
|
|
184 oim #$7F,<u00D4
|
|
185 oim #$80,<u002D
|
|
186 andb <u0003
|
|
187 orb -u000D,u
|
|
188 fcb $45 E
|
|
189 lsrb
|
|
190 negb
|
|
191 sbcb <u0001
|
|
192 lsr <u00BB
|
|
193 neg <u0000
|
|
194 L010A com <u005E
|
|
195 cmpa $02,x
|
|
196 beq L00CB
|
|
197 aim #$3D,<u00A6
|
|
198 aim #$1A,<u008D
|
|
199 L0116 oim #$B8,<u003E
|
|
200 ldx >$01AF
|
|
201 cmpx >$01B8
|
|
202 ldx >$01EF
|
|
203 subd $00,x
|
|
204 neg <u000D
|
|
205 bvc L0151
|
|
206 stu >$0D21
|
|
207 bls L0153
|
|
208 rti
|
|
209 cwai #$3E
|
|
210 stu >$C60E
|
|
211 bsr L00C9
|
|
212 L0135 clr <u0003
|
|
213 clr <u000E
|
|
214 leay <L00CF,pcr
|
|
215 lbsr L01C3
|
|
216 bcs L0192
|
|
217 cmpa #$0D
|
|
218 beq L0192
|
|
219 sta <u000C
|
|
220 cmpa #$28
|
|
221 bne L016F
|
|
222 leay >L000D,pcr
|
|
223 sty <u0004
|
|
224 leax $01,x
|
|
225 stx <u0008
|
|
226 L0156 inc <u000D
|
|
227 L0158 leay <L0125,pcr
|
|
228 bsr L01DB
|
|
229 cmpa #$28
|
|
230 beq L0156
|
|
231 cmpa #$29
|
|
232 bne L018A
|
|
233 dec <u000D
|
|
234 bne L0158
|
|
235 lda #$0D
|
|
236 sta -$01,x
|
|
237 bra L0173
|
|
238 L016F bsr L0195
|
|
239 bcs L0192
|
|
240 L0173 leay <L0129,pcr
|
|
241 bsr L01DB
|
|
242 tfr x,d
|
|
243 subd <u0008
|
|
244 std <u0006
|
|
245 leax -$01,x
|
|
246 leay <L010A,pcr
|
|
247 bsr L01C3
|
|
248 bcs L0192
|
|
249 ldy <u0004
|
|
250 L018A lbne L02BE
|
|
251 cmpa #$0D
|
|
252 bne L0135
|
|
253 L0192 lbra L028F
|
|
254 L0195 stx <u0004
|
|
255 bsr L01A8
|
|
256 bcs L01A7
|
|
257 L019B bsr L01A8
|
|
258 bcc L019B
|
|
259 leay >L0116,pcr
|
|
260 bsr L01C3
|
|
261 stx <u0008
|
|
262 L01A7 rts
|
|
263 L01A8 os9 F$PrsNam
|
|
264 bcc L01B9
|
|
265 lda ,x+
|
|
266 cmpa #$2E
|
|
267 bne L01BD
|
|
268 cmpa ,x+
|
|
269 beq L01BB
|
|
270 leay -$01,x
|
|
271 L01B9 leax ,y
|
|
272 L01BB clra
|
|
273 rts
|
|
274 L01BD comb
|
|
275 leax -$01,x
|
|
276 ldb #$D7
|
|
277 rts
|
|
278 L01C3 bsr L01E9
|
|
279 pshs y
|
|
280 bsr L020C
|
|
281 bcs L01D4
|
|
282 ldd ,y
|
|
283 jsr d,y
|
|
284 puls y
|
|
285 bcc L01C3
|
|
286 rts
|
|
287 L01D4 clra
|
|
288 lda ,x
|
|
289 puls pc,y
|
|
290 L01D9 puls y
|
|
291 L01DB pshs y
|
|
292 lda ,x+
|
|
293 L01DF tst ,y
|
|
294 bmi L01D9
|
|
295 cmpa ,y+
|
|
296 bne L01DF
|
|
297 puls pc,y
|
|
298 L01E9 pshs x
|
|
299 lda ,x+
|
|
300 cmpa #$20
|
|
301 beq L01FF
|
|
302 cmpa #$2C
|
|
303 beq L01FF
|
|
304 leax >L0129,pcr
|
|
305 L01F9 cmpa ,x+
|
|
306 bhi L01F9
|
|
307 puls pc,x
|
|
308 L01FF leas $02,s
|
|
309 lda #$20
|
|
310 L0203 cmpa ,x+
|
|
311 beq L0203
|
|
312 leax -$01,x
|
|
313 andcc #$FE
|
|
314 rts
|
|
315 L020C pshs y,x
|
|
316 leay $02,y
|
|
317 L0210 ldx ,s
|
|
318 L0212 lda ,x+
|
|
319 cmpa #$61
|
|
320 bcs L021A
|
|
321 suba #$20
|
|
322 L021A eora ,y+
|
|
323 lsla
|
|
324 bne L022E
|
|
325 bcc L0212
|
|
326 lda -$01,y
|
|
327 cmpa #$C1
|
|
328 bcs L022B
|
|
329 bsr L01E9
|
|
330 bcs L022E
|
|
331 L022B clra
|
|
332 puls pc,y,b,a
|
|
333 L022E leay -$01,y
|
|
334 L0230 lda ,y+
|
|
335 bpl L0230
|
|
336 sty $02,s
|
|
337 ldd ,y++
|
|
338 bne L0210
|
|
339 comb
|
|
340 puls pc,y,x
|
|
341 lbsr L0195
|
|
342 clra
|
|
343 bsr L0260
|
|
344 bsr L025F
|
|
345 bsr L025F
|
|
346 bsr L0286
|
|
347 leax $01,x
|
|
348 tfr x,d
|
|
349 subd <u0008
|
|
350 std <u0006
|
|
351 leas >u00FF,u
|
|
352 lbsr L0394
|
|
353 os9 F$Chain
|
|
354 os9 F$Exit
|
|
355 L025F inca
|
|
356 L0260 pshs a
|
|
357 bra L02AB
|
|
358 lda #$84
|
|
359 bra L026A
|
|
360 lda #$83
|
|
361 L026A os9 I$ChgDir
|
|
362 rts
|
|
363 clra
|
|
364 bra L0273
|
|
365 lda #$01
|
|
366 L0273 sta <u000F
|
|
367 rts
|
|
368 lda #$01
|
|
369 bra L027B
|
|
370 clra
|
|
371 L027B sta <u0010
|
|
372 rts
|
|
373 lda #$01
|
|
374 bra L0283
|
|
375 clra
|
|
376 L0283 sta <u0011
|
|
377 rts
|
|
378 L0286 lda #$0D
|
|
379 L0288 cmpa ,x+
|
|
380 bne L0288
|
|
381 cmpa ,-x
|
|
382 rts
|
|
383 L028F pshs b,a,cc
|
|
384 clra
|
|
385 L0292 bsr L029D
|
|
386 inca
|
|
387 cmpa #$02
|
|
388 bls L0292
|
|
389 ror ,s+
|
|
390 puls pc,b,a
|
|
391 L029D pshs a
|
|
392 tst a,u
|
|
393 beq L02B6
|
|
394 os9 I$Close
|
|
395 lda a,u
|
|
396 os9 I$Dup
|
|
397 L02AB ldb ,s
|
|
398 lda b,u
|
|
399 beq L02B6
|
|
400 clr b,u
|
|
401 os9 I$Close
|
|
402 L02B6 puls pc,a
|
|
403 L02B8 asrb
|
|
404 lsla
|
|
405 fcb $41 A
|
|
406 lsrb
|
|
407 swi
|
|
408 fcb $0D
|
|
409 L02BE bsr L028F
|
|
410 leax <L02B8,pcr
|
|
411 lbsr L00BF
|
|
412 clrb
|
|
413 coma
|
|
414 rts
|
|
415 L02C9 ldd #$0001
|
|
416 bra L02E3
|
|
417 ldd #$020D
|
|
418 stb -$02,x
|
|
419 bra L02D7
|
|
420 lda #$01
|
|
421 L02D7 ldb #$02
|
|
422 bra L02E3
|
|
423 tst a,u
|
|
424 bne L02BE
|
|
425 pshs b,a
|
|
426 bra L02ED
|
|
427 L02E3 tst a,u
|
|
428 bne L02BE
|
|
429 pshs b,a
|
|
430 ldb #$0D
|
|
431 stb -$01,x
|
|
432 L02ED os9 I$Dup
|
|
433 bcs L030D
|
|
434 ldb ,s
|
|
435 sta b,u
|
|
436 lda ,s
|
|
437 os9 I$Close
|
|
438 lda $01,s
|
|
439 bita #$02
|
|
440 bne L0306
|
|
441 os9 I$Open
|
|
442 bra L030B
|
|
443 L0306 ldb #$0B
|
|
444 os9 I$Create
|
|
445 L030B stb $01,s
|
|
446 L030D puls pc,b,a
|
|
447 ldb #$0D
|
|
448 stb -$01,x
|
|
449 ldb <u0003
|
|
450 bne L02BE
|
|
451 lbsr L04CA
|
|
452 eora #$4B
|
|
453 anda #$DF
|
|
454 bne L0328
|
|
455 leax $01,x
|
|
456 lda #$04
|
|
457 mul
|
|
458 tsta
|
|
459 bne L02BE
|
|
460 L0328 stb <u0003
|
|
461 lbra L01E9
|
|
462 leax -$01,x
|
|
463 lbsr L03C7
|
|
464 bra L0337
|
|
465 lbsr L03C3
|
|
466 L0337 bcs L034A
|
|
467 lbsr L028F
|
|
468 bsr L035C
|
|
469 L033E bcs L034A
|
|
470 lbsr L01E9
|
|
471 cmpa #$0D
|
|
472 bne L0349
|
|
473 leas $04,s
|
|
474 L0349 clrb
|
|
475 L034A lbra L028F
|
|
476 lbsr L03C3
|
|
477 bcs L034A
|
|
478 bsr L034A
|
|
479 ldb #$26
|
|
480 lbsr L0495
|
|
481 bra L033E
|
|
482 clra
|
|
483 L035C pshs a
|
|
484 L035E os9 F$Wait
|
|
485 tst <u000E
|
|
486 beq L0376
|
|
487 ldb <u000E
|
|
488 cmpb #$02
|
|
489 bne L038E
|
|
490 lda ,s
|
|
491 beq L038E
|
|
492 os9 F$Send
|
|
493 clr ,s
|
|
494 bra L035E
|
|
495 L0376 bcs L0392
|
|
496 cmpa ,s
|
|
497 beq L038E
|
|
498 tst ,s
|
|
499 beq L0383
|
|
500 tstb
|
|
501 beq L035E
|
|
502 L0383 pshs b
|
|
503 bsr L034A
|
|
504 ldb #$2D
|
|
505 lbsr L0495
|
|
506 puls b
|
|
507 L038E tstb
|
|
508 beq L0392
|
|
509 coma
|
|
510 L0392 puls pc,a
|
|
511 L0394 lda #$11
|
|
512 ldb <u0003
|
|
513 ldx <u0004
|
|
514 ldy <u0006
|
|
515 ldu <u0008
|
|
516 rts
|
|
517 L03A0 lda #$04
|
|
518 os9 I$Open
|
|
519 bcs L03FE
|
|
520 leax <u0013,u
|
|
521 ldy #$000D
|
|
522 os9 I$Read
|
|
523 pshs b,cc
|
|
524 os9 I$Close
|
|
525 puls b,cc
|
|
526 lbcs L045F
|
|
527 lda $06,x
|
|
528 ldy $0B,x
|
|
529 bra L03D7
|
|
530 L03C3 lda #$0D
|
|
531 sta -$01,x
|
|
532 L03C7 pshs u,y,x
|
|
533 clra
|
|
534 ldx <u0004
|
|
535 os9 F$Link
|
|
536 bcs L03A0
|
|
537 ldy u000B,u
|
|
538 os9 F$UnLink
|
|
539 L03D7 cmpa #$11
|
|
540 beq L0425
|
|
541 sty <u000A
|
|
542 leax >L0013,pcr
|
|
543 L03E2 tst ,x
|
|
544 beq L045D
|
|
545 cmpa ,x+
|
|
546 beq L03F0
|
|
547 L03EA tst ,x+
|
|
548 bpl L03EA
|
|
549 bra L03E2
|
|
550 L03F0 ldd <u0008
|
|
551 subd <u0004
|
|
552 addd <u0006
|
|
553 std <u0006
|
|
554 ldd <u0004
|
|
555 std <u0008
|
|
556 bra L0423
|
|
557 L03FE ldx <u0006
|
|
558 leax $05,x
|
|
559 stx <u0006
|
|
560 ldx <u0004
|
|
561 ldu $04,s
|
|
562 lbsr L02C9
|
|
563 bcs L045F
|
|
564 ldu <u0008
|
|
565 ldd #$5820
|
|
566 std ,--u
|
|
567 ldd #$5020
|
|
568 std ,--u
|
|
569 ldb #$2D
|
|
570 stb ,-u
|
|
571 stu <u0008
|
|
572 leax >L000D,pcr
|
|
573 L0423 stx <u0004
|
|
574 L0425 ldx <u0004
|
|
575 lda #$11
|
|
576 os9 F$Link
|
|
577 bcc L0433
|
|
578 os9 F$Load
|
|
579 bcs L045F
|
|
580 L0433 pshs u
|
|
581 tst <u0003
|
|
582 bne L0442
|
|
583 ldd u000B,u
|
|
584 addd <u000A
|
|
585 addd #$00FF
|
|
586 sta <u0003
|
|
587 L0442 lbsr L0394
|
|
588 os9 F$Fork
|
|
589 puls u
|
|
590 pshs b,cc
|
|
591 bcs L0454
|
|
592 ldx #$0001
|
|
593 os9 F$Sleep
|
|
594 L0454 clr <u0004
|
|
595 clr <u0005
|
|
596 os9 F$UnLink
|
|
597 puls pc,u,y,x,b,cc
|
|
598 L045D ldb #$EA
|
|
599 L045F coma
|
|
600 puls pc,u,y,x
|
|
601 ble L04D4
|
|
602 rol -$10,s
|
|
603 eim #$0D,-$0C,y
|
|
604 addr a,0
|
|
605 bitb >$CC01
|
|
606 com <u0017
|
|
607 ldu >$6835
|
|
608 lbcs L568F
|
|
609 stu >$4925
|
|
610 tsta
|
|
611 lda ,u
|
|
612 bne L0487
|
|
613 os9 I$Dup
|
|
614 bcs L04C9
|
|
615 sta ,u
|
|
616 L0487 clra
|
|
617 os9 I$Close
|
|
618 lda #$01
|
|
619 os9 I$Dup
|
|
620 lda #$01
|
|
621 lbra L029D
|
|
622 L0495 pshs y,x,b,a
|
|
623 pshs y,x,b
|
|
624 leax $01,s
|
|
625 ldb #$2F
|
|
626 L049D incb
|
|
627 suba #$64
|
|
628 bcc L049D
|
|
629 stb ,x+
|
|
630 ldb #$3A
|
|
631 L04A6 decb
|
|
632 adda #$0A
|
|
633 bcc L04A6
|
|
634 stb ,x+
|
|
635 adda #$30
|
|
636 ldb #$0D
|
|
637 std ,x
|
|
638 leax ,s
|
|
639 lbsr L00BF
|
|
640 leas $05,s
|
|
641 puls pc,y,x,b,a
|
|
642 bsr L04CA
|
|
643 cmpb #$02
|
|
644 bcs L04E5
|
|
645 tfr b,a
|
|
646 ldb #$00
|
|
647 os9 F$Send
|
|
648 L04C9 rts
|
|
649 L04CA clrb
|
|
650 L04CB lda ,x+
|
|
651 suba #$30
|
|
652 cmpa #$09
|
|
653 bhi L04DC
|
|
654 pshs a
|
|
655 lda #$0A
|
|
656 mul
|
|
657 addb ,s+
|
|
658 bcc L04CB
|
|
659 L04DC lda ,-x
|
|
660 bcs L04E3
|
|
661 tstb
|
|
662 bne L04C9
|
|
663 L04E3 leas $02,s
|
|
664 L04E5 lbra L02BE
|
|
665 bsr L04CA
|
|
666 stb <u0012
|
|
667 lbsr L01E9
|
|
668 bsr L04CA
|
|
669 lda <u0012
|
|
670 os9 F$SPrior
|
|
671 rts
|
|
672 emod
|
|
673 eom equ *
|