Mercurial > hg > Members > kono > nitros9-code
annotate level1/cmds/tee.asm @ 1891:5f8822fb42e0
shortened H6309L2 code to fit within $1D0 bytes
author | robert |
---|---|
date | Fri, 14 Oct 2005 01:53:05 +0000 |
parents | 585e04f3959d |
children |
rev | line source |
---|---|
0 | 1 ******************************************************************** |
2 * Tee - Split output to multiple devices | |
3 * | |
4 * $Id$ | |
5 * | |
1325
84ea83668304
Redid comments, reset all rev nibbles that weren't explictly set to 0
boisy
parents:
924
diff
changeset
|
6 * Edt/Rev YYYY/MM/DD Modified by |
84ea83668304
Redid comments, reset all rev nibbles that weren't explictly set to 0
boisy
parents:
924
diff
changeset
|
7 * Comment |
0 | 8 * ------------------------------------------------------------------ |
1325
84ea83668304
Redid comments, reset all rev nibbles that weren't explictly set to 0
boisy
parents:
924
diff
changeset
|
9 * 2 ????/??/?? |
84ea83668304
Redid comments, reset all rev nibbles that weren't explictly set to 0
boisy
parents:
924
diff
changeset
|
10 * From Tandy OS-9 Level One VR 02.00.00. |
0 | 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 ifp1 | |
18 use defsfile | |
19 endc | |
20 | |
21 tylg set Prgrm+Objct | |
22 atrv set ReEnt+rev | |
1325
84ea83668304
Redid comments, reset all rev nibbles that weren't explictly set to 0
boisy
parents:
924
diff
changeset
|
23 rev set $00 |
0 | 24 edition set 2 |
25 | |
26 mod eom,name,tylg,atrv,start,size | |
27 | |
924 | 28 org 0 |
0 | 29 u0000 rmb 1 |
1752 | 30 parray rmb 13 |
31 pcount rmb 1 | |
32 buff rmb 256 | |
33 rmb 450 | |
0 | 34 size equ . |
35 | |
36 name fcs /Tee/ | |
37 fcb edition | |
38 | |
39 start clrb | |
1752 | 40 clr pcount,u clear path counter |
41 cmpy #$0000 any parameters? | |
42 lbeq exitok exit if none | |
43 leay parray,u else point Y to path array | |
13 | 44 |
45 * Walk the command line parameters | |
1752 | 46 parse lda ,x+ |
13 | 47 cmpa #C$SPAC |
1752 | 48 beq parse |
13 | 49 cmpa #C$COMA |
1752 | 50 beq parse |
13 | 51 cmpa #C$CR |
1752 | 52 lbeq parsex |
13 | 53 * We've found a file or device name |
54 leax -1,x | |
55 lda #WRITE. | |
56 ldb #PREAD.+UPDAT. | |
1752 | 57 os9 I$Create open a path to the device or file |
58 bcs exit branch if error | |
59 ldb pcount,u else get path counter | |
60 sta b,y save new path in the array offset | |
61 incb increment counter | |
62 stb pcount,u and save | |
63 bra parse continue parsing command line | |
64 parsex stb pcount,u | |
13 | 65 |
66 * Devices on command line are open, start pumping data | |
0 | 67 L0044 clra |
1752 | 68 leax buff,u |
13 | 69 ldy #256 |
0 | 70 os9 I$ReadLn |
71 bcc L0057 | |
13 | 72 cmpb #E$EOF |
1752 | 73 beq exitok |
0 | 74 coma |
1752 | 75 bra exit |
0 | 76 L0057 inca |
77 os9 I$WritLn | |
1752 | 78 tst pcount,u |
0 | 79 beq L0044 |
80 clrb | |
1752 | 81 L0060 leay parray,u |
0 | 82 lda b,y |
1752 | 83 leax buff,u |
13 | 84 ldy #256 |
0 | 85 os9 I$WritLn |
1752 | 86 bcs exit |
0 | 87 incb |
1752 | 88 cmpb pcount,u |
0 | 89 bne L0060 |
90 bra L0044 | |
1752 | 91 exitok clrb |
92 exit os9 F$Exit | |
0 | 93 |
94 emod | |
95 eom equ * | |
96 end |