> BLib.Net 1.02 12Feb1992 : $ Network Communication Routines ($ ============================== 2: <; Net_TxCount - Transmit with specified count and delay F9 Net_Tx - Transmit with default count and delay P7 If a broadcast, fetches data from memory at Addr% Z) Returns Net_Tx success value - 0=Ok d: ---------------------------------------------------- n: xJݤNet_TxCount(Stn%,Ctrl%,Port%,Addr%,Len%,RAddr%,Try%,Delay%): TxErr% WݤNet_Tx(Stn%,Ctrl%,Port%,Addr%,Len%,RAddr%): TxErr%,Try%,Delay%:Try%=10:Delay%=50 @X%?1=Port%:X%!2=Stn%:X%!4=Addr%:X%!8=Addr%+Len%:X%!12=RAddr% MStn%=&FFFF:X%!4=Addr%!0:X%!8=Addr%!4 : Set broadcast data ?::X%?0=Ctrl%:A%=&10: &FFF1:X%?0 : Loop until Tx starts E:TxErr%=byte(&32,0,0):TxErr%<&80 : Loop until complete ATxErr%=&41 TxErr%=&42:Try%:A%=+Delay%:>A%:Try%=Try%-1 0(TxErr%=&41 TxErr%=&42) Try%<1:=TxErr% : : ' Net_RxOpen - Open a receive block  Returns Rx block number ' --------------------------------- : 'ݤNet_RxOpen(Stn%,Port%,Addr%,Len%) CX%?0=0:X%?1=&7F:X%?2=Port%:X%!3=Stn%:X%!5=Addr%:X%!9=Addr%+Len% A%=&11: &FFF1:=X%?0 ": ,: 6! Net_Rx - Poll receive block @' Returns TRUE if reception occured J' --------------------------------- T: ^2ݤNet_Rx(RxNum%):=(byte(&33,RxNum%,0)&80)<>0 h: r: |+ Net_RxRead - Read and delete Rx block * Returns the number of bytes received + ------------------------------------- : ݤNet_RxRead(RxNum%) 6X%?0=RxNum%:A%=&11: &FFF1:A%=X%!9-X%!5:X%!5=0:=A% : : # Net_RxKill - Kill an Rx block # ----------------------------- : 1Net_RxKill(RxNum%):A%=byte(&34,RxNum%,0): : : ; Net_Err - Return error string for network status code ; ----------------------------------------------------- : &ݤNet_Err(A%):A%=0:="" 0="Line jammedNet errorNot listeningNo clockBad Tx blockNo reply","011221344254",(A%-&40)*2+1,2),"110913081208",(A%-&40)*2+1,2)) :: D: NC Net_StnFixed - Returns fixed-length dotted net&station number XF Net_Stn - If net=0, returns string stn else returns net.stn bF ---------------------------------------------------------------- l: v9ݤNet_Stn(A%):A%<256:=d0(A%,3) =Net_StnFixed(A%) 0ݤNet_StnFixed(A%): B%: B%-1:!B%=A%:B%!4=0 ,B%!2=0:=d0(A%256,3)+"."+d0(A%255,3) 4=Net_StnFixed(B%!2)+"."+Net_StnFixed(A%&FFFF) : : D Net_StnNum - Convert dotted station string into station number D -------------------------------------------------------------- : 3ݤNet_StnNum(A$): B%: B%-1:!B%=0:!B%=!B%+A$ /A%=A$,"."):A%:A$=A$,A%+1):B%!1=!B%:?B%=0 A%=0:=!B% : : - Net_Info - Read/Set Network information  - --------------------------------------- :  8ݤNet_Info(A%,D%):?X%=A%:X%!1=D%:A%=&13:&FFF1:=X%!1 *: 4: >)ݤbyte(A%,X%,Y%)=((&FFF4)&FF00)256 H#ݤd0(A%,N%)="00000000"+A%,N%) R: \: