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
|
1863
|
19 Prgrm set $10
|
|
20 Objct set $01
|
|
21 ReEnt set $80
|
1859
|
22 rev set $00
|
|
23 edition set 2
|
1755
|
24
|
1859
|
25 psect tee_a,Prgrm+Objct,ReEnt+rev,edition,200,start
|
1755
|
26
|
1859
|
27 vsect
|
|
28 u0000 rmb 1
|
|
29 parray rmb 13
|
|
30 pcount rmb 1
|
|
31 buff rmb 256
|
|
32 endsect
|
1758
|
33
|
1859
|
34 start clrb
|
|
35 clr <pcount,u clear path counter
|
|
36 cmpy #$0000 any parameters?
|
|
37 lbeq exitok exit if none
|
|
38 leay <parray,u else point Y to path array
|
1755
|
39
|
1859
|
40 * Walk the command line parameters
|
|
41 parse lda ,x+
|
1755
|
42 cmpa #C$SPAC
|
|
43 beq parse
|
|
44 cmpa #C$COMA
|
|
45 beq parse
|
|
46 cmpa #C$CR
|
|
47 lbeq parsex
|
1859
|
48 * We've found a file or device name
|
1755
|
49 leax -1,x
|
|
50 lda #WRITE.
|
|
51 ldb #PREAD.+UPDAT.
|
1859
|
52 os9 I$Create open a path to the device or file
|
|
53 bcs exit branch if error
|
|
54 ldb <pcount,u else get path counter
|
|
55 sta b,y save new path in the array offset
|
|
56 incb increment counter
|
|
57 stb <pcount,u and save
|
|
58 bra parse continue parsing command line
|
|
59 parsex stb <pcount,u
|
1755
|
60
|
1859
|
61 * Devices on command line are open, start pumping data
|
|
62 L0044 clra
|
|
63 leax <buff,u
|
1755
|
64 ldy #256
|
|
65 os9 I$ReadLn
|
|
66 bcc L0057
|
|
67 cmpb #E$EOF
|
|
68 beq exitok
|
|
69 coma
|
|
70 bra exit
|
1859
|
71 L0057 inca
|
1755
|
72 os9 I$WritLn
|
1859
|
73 tst <pcount,u
|
1755
|
74 beq L0044
|
|
75 clrb
|
1859
|
76 L0060 leay <parray,u
|
1755
|
77 lda b,y
|
1859
|
78 leax <buff,u
|
1755
|
79 ldy #256
|
|
80 os9 I$WritLn
|
|
81 bcs exit
|
|
82 incb
|
1859
|
83 cmpb <pcount,u
|
1755
|
84 bne L0060
|
|
85 bra L0044
|
1859
|
86 exitok clrb
|
|
87 exit os9 F$Exit
|
|
88
|
|
89 endsect
|