Mercurial > hg > Members > kono > nitros9-code
annotate level1/cmds/tee.asm @ 337:17ba481eb565
Added SYS as a target
author | boisy |
---|---|
date | Wed, 24 Jul 2002 06:03:36 +0000 |
parents | e9ce43cc215e |
children | c155aac72190 |
rev | line source |
---|---|
0 | 1 ******************************************************************** |
2 * Tee - Split output to multiple devices | |
3 * | |
4 * $Id$ | |
5 * | |
6 * Ed. Comments Who YY/MM/DD | |
7 * ------------------------------------------------------------------ | |
200
e9ce43cc215e
Made major changes to headers for consistency and identification
boisy
parents:
15
diff
changeset
|
8 * 2 From Tandy OS-9 Level One VR 02.00.00 |
0 | 9 |
10 nam Tee | |
11 ttl Split output to multiple devices | |
12 | |
13 * Disassembled 98/09/14 23:50:52 by Disasm v1.6 (C) 1988 by RML | |
14 | |
15 ifp1 | |
16 use defsfile | |
17 endc | |
18 | |
19 tylg set Prgrm+Objct | |
20 atrv set ReEnt+rev | |
21 rev set $01 | |
22 edition set 2 | |
23 | |
24 mod eom,name,tylg,atrv,start,size | |
25 | |
26 u0000 rmb 1 | |
27 u0001 rmb 13 | |
28 u000E rmb 1 | |
29 u000F rmb 706 | |
30 size equ . | |
31 | |
32 name fcs /Tee/ | |
33 fcb edition | |
34 | |
35 start clrb | |
13 | 36 clr u000E,u clear path counter |
0 | 37 cmpy #$0000 |
38 lbeq L0076 | |
39 leay u0001,u | |
13 | 40 |
41 * Walk the command line parameters | |
0 | 42 L001E lda ,x+ |
13 | 43 cmpa #C$SPAC |
0 | 44 beq L001E |
13 | 45 cmpa #C$COMA |
0 | 46 beq L001E |
13 | 47 cmpa #C$CR |
0 | 48 lbeq L0042 |
13 | 49 * We've found a file or device name |
50 leax -1,x | |
51 lda #WRITE. | |
52 ldb #PREAD.+UPDAT. | |
0 | 53 os9 I$Create |
54 bcs L0077 | |
55 ldb u000E,u | |
56 sta b,y | |
57 incb | |
58 stb u000E,u | |
59 bra L001E | |
60 L0042 stb u000E,u | |
13 | 61 |
62 * Devices on command line are open, start pumping data | |
0 | 63 L0044 clra |
64 leax u000F,u | |
13 | 65 ldy #256 |
0 | 66 os9 I$ReadLn |
67 bcc L0057 | |
13 | 68 cmpb #E$EOF |
0 | 69 beq L0076 |
70 coma | |
71 bra L0077 | |
72 L0057 inca | |
73 os9 I$WritLn | |
74 tst u000E,u | |
75 beq L0044 | |
76 clrb | |
77 L0060 leay u0001,u | |
78 lda b,y | |
79 leax u000F,u | |
13 | 80 ldy #256 |
0 | 81 os9 I$WritLn |
82 bcs L0077 | |
83 incb | |
84 cmpb u000E,u | |
85 bne L0060 | |
86 bra L0044 | |
87 L0076 clrb | |
88 L0077 os9 F$Exit | |
89 | |
90 emod | |
91 eom equ * | |
92 end |