1859
|
1 ********************************************************************
|
|
2 * Tee - Split output to multiple devices
|
|
3 *
|
|
4 * $Id$
|
|
5 *
|
|
6 * Edt/Rev YYYY/MM/DD Modified by
|
|
7 * Comment
|
|
8 * ------------------------------------------------------------------
|
|
9 * 2 ????/??/??
|
|
10 * From Tandy OS-9 Level One VR 02.00.00.
|
1755
|
11
|
1859
|
12 nam Tee
|
|
13 ttl Split output to multiple devices
|
1755
|
14
|
1859
|
15 * Disassembled 98/09/14 23:50:52 by Disasm v1.6 (C) 1988 by RML
|
|
16
|
1862
|
17 use defsfile.d
|
1755
|
18
|
1859
|
19 rev set $00
|
|
20 edition set 2
|
1755
|
21
|
1859
|
22 psect tee_a,Prgrm+Objct,ReEnt+rev,edition,200,start
|
1755
|
23
|
1868
|
24 vsect dp
|
1859
|
25 u0000 rmb 1
|
|
26 parray rmb 13
|
|
27 pcount rmb 1
|
1868
|
28 buff rmb 200
|
1859
|
29 endsect
|
1758
|
30
|
1859
|
31 start clrb
|
1868
|
32 clr pcount clear path counter
|
1859
|
33 cmpy #$0000 any parameters?
|
|
34 lbeq exitok exit if none
|
1868
|
35 leay parray else point Y to path array
|
1755
|
36
|
1859
|
37 * Walk the command line parameters
|
|
38 parse lda ,x+
|
1755
|
39 cmpa #C$SPAC
|
|
40 beq parse
|
|
41 cmpa #C$COMA
|
|
42 beq parse
|
|
43 cmpa #C$CR
|
|
44 lbeq parsex
|
1859
|
45 * We've found a file or device name
|
1755
|
46 leax -1,x
|
|
47 lda #WRITE.
|
|
48 ldb #PREAD.+UPDAT.
|
1859
|
49 os9 I$Create open a path to the device or file
|
|
50 bcs exit branch if error
|
1868
|
51 ldb pcount else get path counter
|
1859
|
52 sta b,y save new path in the array offset
|
|
53 incb increment counter
|
1868
|
54 stb pcount and save
|
1859
|
55 bra parse continue parsing command line
|
1868
|
56 parsex stb pcount
|
1755
|
57
|
1859
|
58 * Devices on command line are open, start pumping data
|
|
59 L0044 clra
|
1868
|
60 leax buff
|
1755
|
61 ldy #256
|
|
62 os9 I$ReadLn
|
|
63 bcc L0057
|
|
64 cmpb #E$EOF
|
|
65 beq exitok
|
|
66 coma
|
|
67 bra exit
|
1859
|
68 L0057 inca
|
1755
|
69 os9 I$WritLn
|
1868
|
70 tst pcount
|
1755
|
71 beq L0044
|
|
72 clrb
|
1868
|
73 L0060 leay parray
|
1755
|
74 lda b,y
|
1868
|
75 leax buff
|
1755
|
76 ldy #256
|
|
77 os9 I$WritLn
|
|
78 bcs exit
|
|
79 incb
|
1868
|
80 cmpb pcount
|
1755
|
81 bne L0060
|
|
82 bra L0044
|
1859
|
83 exitok clrb
|
|
84 exit os9 F$Exit
|
|
85
|
|
86 endsect
|