Mercurial > hg > Members > kono > nitros9-code
annotate level1/cmds/tee.as @ 2790:19517af71188 lwtools-port
Added __start
author | Boisy Pitre <boisy.pitre@nuance.com> |
---|---|
date | Sun, 27 Jan 2013 08:01:00 -0600 |
parents | 28b6ec8a14d5 |
children | a52a60c66f5a |
rev | line source |
---|---|
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 |
2782
aaba193af04f
Updated code to use lwasm/lwlink
Boisy Pitre <boisy.pitre@nuance.com>
parents:
1869
diff
changeset
|
22 section data |
1859 | 23 u0000 rmb 1 |
24 parray rmb 13 | |
25 pcount rmb 1 | |
1868 | 26 buff rmb 200 |
1859 | 27 endsect |
1758 | 28 |
2782
aaba193af04f
Updated code to use lwasm/lwlink
Boisy Pitre <boisy.pitre@nuance.com>
parents:
1869
diff
changeset
|
29 * psect tee_a,Prgrm+Objct,ReEnt+rev,edition,200,start |
2787
28b6ec8a14d5
Added 'extern' pragam, fixed up rules.mak, changed 'section text' to 'section code' in sources
Boisy Pitre <boisy.pitre@nuance.com>
parents:
2783
diff
changeset
|
30 section code |
2782
aaba193af04f
Updated code to use lwasm/lwlink
Boisy Pitre <boisy.pitre@nuance.com>
parents:
1869
diff
changeset
|
31 |
2790 | 32 __start clrb |
1868 | 33 clr pcount clear path counter |
1859 | 34 cmpy #$0000 any parameters? |
35 lbeq exitok exit if none | |
1868 | 36 leay parray else point Y to path array |
1755 | 37 |
1859 | 38 * Walk the command line parameters |
39 parse lda ,x+ | |
1755 | 40 cmpa #C$SPAC |
41 beq parse | |
42 cmpa #C$COMA | |
43 beq parse | |
44 cmpa #C$CR | |
45 lbeq parsex | |
1859 | 46 * We've found a file or device name |
1755 | 47 leax -1,x |
48 lda #WRITE. | |
49 ldb #PREAD.+UPDAT. | |
1859 | 50 os9 I$Create open a path to the device or file |
51 bcs exit branch if error | |
1868 | 52 ldb pcount else get path counter |
1859 | 53 sta b,y save new path in the array offset |
54 incb increment counter | |
1868 | 55 stb pcount and save |
1859 | 56 bra parse continue parsing command line |
1868 | 57 parsex stb pcount |
1755 | 58 |
1859 | 59 * Devices on command line are open, start pumping data |
60 L0044 clra | |
1868 | 61 leax buff |
1755 | 62 ldy #256 |
63 os9 I$ReadLn | |
64 bcc L0057 | |
65 cmpb #E$EOF | |
66 beq exitok | |
67 coma | |
68 bra exit | |
1859 | 69 L0057 inca |
1755 | 70 os9 I$WritLn |
1868 | 71 tst pcount |
1755 | 72 beq L0044 |
73 clrb | |
1868 | 74 L0060 leay parray |
1755 | 75 lda b,y |
1868 | 76 leax buff |
1755 | 77 ldy #256 |
78 os9 I$WritLn | |
79 bcs exit | |
80 incb | |
1868 | 81 cmpb pcount |
1755 | 82 bne L0060 |
83 bra L0044 | |
1859 | 84 exitok clrb |
85 exit os9 F$Exit | |
86 | |
87 endsect |