diff 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
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/level1/cmds/tee.as	Sat Jan 26 17:18:24 2013 -0600
@@ -0,0 +1,87 @@
+********************************************************************
+* Tee - Split output to multiple devices
+*
+* $Id$
+*
+* Edt/Rev  YYYY/MM/DD  Modified by
+* Comment
+* ------------------------------------------------------------------
+*   2      ????/??/??
+* From Tandy OS-9 Level One VR 02.00.00.
+
+         nam   Tee
+         ttl   Split output to multiple devices
+
+* Disassembled 98/09/14 23:50:52 by Disasm v1.6 (C) 1988 by RML
+
+         use   defsfile.d
+
+rev      set   $00
+edition  set   2
+
+         section data
+u0000    rmb   1
+parray   rmb   13
+pcount   rmb   1
+buff     rmb   200
+         endsect
+
+*         psect tee_a,Prgrm+Objct,ReEnt+rev,edition,200,start
+         section text
+
+start    clrb  
+         clr   pcount		clear path counter
+         cmpy  #$0000		any parameters?
+         lbeq  exitok		exit if none
+         leay  parray		else point Y to path array
+
+* Walk the command line parameters
+parse    lda   ,x+
+         cmpa  #C$SPAC
+         beq   parse
+         cmpa  #C$COMA
+         beq   parse
+         cmpa  #C$CR
+         lbeq  parsex
+* We've found a file or device name
+         leax  -1,x
+         lda   #WRITE.
+         ldb   #PREAD.+UPDAT.
+         os9   I$Create 	open a path to the device or file
+         bcs   exit		branch if error
+         ldb   pcount		else get path counter
+         sta   b,y		save new path in the array offset
+         incb  			increment counter
+         stb   pcount		and save
+         bra   parse		continue parsing command line
+parsex   stb   pcount
+
+* Devices on command line are open, start pumping data
+L0044    clra  
+         leax  buff
+         ldy   #256
+         os9   I$ReadLn 
+         bcc   L0057
+         cmpb  #E$EOF
+         beq   exitok
+         coma  
+         bra   exit
+L0057    inca  
+         os9   I$WritLn 
+         tst   pcount
+         beq   L0044
+         clrb  
+L0060    leay  parray
+         lda   b,y
+         leax  buff
+         ldy   #256
+         os9   I$WritLn 
+         bcs   exit
+         incb  
+         cmpb  pcount
+         bne   L0060
+         bra   L0044
+exitok   clrb  
+exit     os9   F$Exit   
+
+         endsect