comparison level1/cmds/tee.as @ 2783:03f26e88b809 lwtools-port

Renamed files and setup for lwasm/lwlink work
author Boisy Pitre <boisy.pitre@nuance.com>
date Sat, 26 Jan 2013 17:18:24 -0600
parents level1/cmds/tee.a@aaba193af04f
children 28b6ec8a14d5
comparison
equal deleted inserted replaced
2782:aaba193af04f 2783:03f26e88b809
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.
11
12 nam Tee
13 ttl Split output to multiple devices
14
15 * Disassembled 98/09/14 23:50:52 by Disasm v1.6 (C) 1988 by RML
16
17 use defsfile.d
18
19 rev set $00
20 edition set 2
21
22 section data
23 u0000 rmb 1
24 parray rmb 13
25 pcount rmb 1
26 buff rmb 200
27 endsect
28
29 * psect tee_a,Prgrm+Objct,ReEnt+rev,edition,200,start
30 section text
31
32 start clrb
33 clr pcount clear path counter
34 cmpy #$0000 any parameters?
35 lbeq exitok exit if none
36 leay parray else point Y to path array
37
38 * Walk the command line parameters
39 parse lda ,x+
40 cmpa #C$SPAC
41 beq parse
42 cmpa #C$COMA
43 beq parse
44 cmpa #C$CR
45 lbeq parsex
46 * We've found a file or device name
47 leax -1,x
48 lda #WRITE.
49 ldb #PREAD.+UPDAT.
50 os9 I$Create open a path to the device or file
51 bcs exit branch if error
52 ldb pcount else get path counter
53 sta b,y save new path in the array offset
54 incb increment counter
55 stb pcount and save
56 bra parse continue parsing command line
57 parsex stb pcount
58
59 * Devices on command line are open, start pumping data
60 L0044 clra
61 leax buff
62 ldy #256
63 os9 I$ReadLn
64 bcc L0057
65 cmpb #E$EOF
66 beq exitok
67 coma
68 bra exit
69 L0057 inca
70 os9 I$WritLn
71 tst pcount
72 beq L0044
73 clrb
74 L0060 leay parray
75 lda b,y
76 leax buff
77 ldy #256
78 os9 I$WritLn
79 bcs exit
80 incb
81 cmpb pcount
82 bne L0060
83 bra L0044
84 exitok clrb
85 exit os9 F$Exit
86
87 endsect