home *** CD-ROM | disk | FTP | other *** search
- ;
- ; set user (a)
- ; a,f,e
- usrset: mov e,a
- sta actusr; record for other uses
- mvi a,setusr
- jmp dos
- ;
- ; set disk (a)
- ; a,f,e
- dskset: mov e,a
- sta actdrv; record for other uses
- mvi a,seldsk
- jmp dos
- ;
- ; set general receive area if remon and NOT whlbit and enabled
- ; else return 0 and z flag
- ; a,f,b
- setgrv: call qwheel
- mvi a,grdrv
- mvi b,grusr
- jz setrcv; else try to set it up
- xra a
- ret; with z, signal not done
- ;
- ; set private if enabled, else return z flag
- ; a,f,b
- setpvt: mvi a,gprdrv
- mvi b,gprusr
- ; " "
- ; set receive area according to a and b rsxcalls for drv/usr
- ; return zero and z flag if inhibited, else 0ffh and nz
- ; a,f
- setrcv: call dorsx
- sui '@'
- rz; disabled
- dcr a
- call dskset
- mov a,b; appropriate user query
- call dorsx
- call usrset
- ori 0ffh; signal done
- ret
- ;
- ; IF private AND (prvdisk <> '@') THEN rcvarea(private)
- ; ELSE IF remon AND NOT whlbit AND (rcvdisk <> '@') THEN
- ; rcvarea(receive)
- ; ELSE (* nothing, unrestricted *)
- ;
- ; Set access (drive/user) area, and see if file exists.
- ; If so, abort the remote and ask for a different name.
- ; a,f,b (if no file exists)
- chekfil:
- lda prvtfl; Receiving in private area?
- ora a
- cnz setpvt; If yes, set drive and user area
- cz setgrv; else, or if disabled, set genl rcv
- mvi a,srchf
- call fileop
- inr a
- rz; Not found, return
- call send3can; Tell the remote we are aborting
- chekf1: mvi b,1
- call recv
- jnc chekf1; Wait until no more chars
- lda bchflg; Using batch mode now?
- sta remoff; If not, send message to modem also
- ora a
- jz chekf2; If not, exit
- call send3can
- mvi a,bs
- call send3x
- chekf2: call erxit; Exit, print error message
- db '++ File exists, use a different name ++','$'
- ;
- ; Makes the file to be received
- ;
- makefil:
- xra a; Set extent and record number to 0
- sta fcbext
- sta fcbrno
- mvi a,make
- call fileop; create the file
- inr a; 0FFH=bad?
- push psw
- call dskstp; Stop disks, won't need for a while
- pop psw
- rnz; Open ok
- ; " "
- ; Directory full - can't make file
- call erxit
- db '++ Error: can''t make file -'
- db ' directory may be full? ++','$'
- ;
- ;
- ; Computes record count, and saves it until a successful file-open.
- ;
- cnrec: mvi a,filsiz; Computes file size
- call fileop; Read first
- lhld random; Get the file size
- shld rcnt; Save total record count
- ret
- ;
- ;
- ; -------------------------------------------------------------------
- ; opens file to send
- ;
- ; Opens the file to be sent
- ;
- opnfil: xra a; Set extent and rec number to 0
- sta fcbext; For proper open
- sta fcbrno
- mvi a,open
- call fileop; Open it
- inr a
- jz badopn; failed
- call qwheel
- jnz opnf1; no restrictions
- call qtags; check for restriction tags
- jnz nosend; tagged to not send
- call qtyp; check types if not wheel
- jc nosend; a restricted type
- opnf1: lda bchflg; Requesting batch mode?
- ora a
- jnz fisopen; If yes, skip library stuff
- lda optsav; Get the primary option back
- cpi 'L'
- jnz fisopen; not asking for library member, exit
- lxi d,tbuf
- mvi a,stdma
- call dos
- mvi a,read
- call fileop
- lhld tbuf+14
- shld dirsiz
- lxi h,tbuf
- mov a,m
- ora a
- jnz notlbr; not valid library
- ; " "
- ; Check to see if there is a .LBR file directory with that name
- ; and complain if not.
- mvi b,11; Max. length of file name
- mvi a,' '; 1st entry must be all blanks
- inx h
- opnf2: cmp m
- jnz notlbr; not valid library
- dcr b
- inx h
- jnz opnf2
- ; " "
- ; The first entry in the .LBR directory is indeed blank.
- ; Now see if the directory size is more than 0.
- mov d,m; Get directory starting location
- inx h; Which must be 0000H...
- mov a,m
- ora d
- jnz notlbr; Directory does not start in record 0
- inx h
- mov a,m; Get size of directory
- inx h
- ora m
- jz notlbr; Directory must be >0 records!
- lxi h,tbuf; Point to directory
- ; " "
- ; The next routine checks the .LBR directory for
- ; the specified member name one sector at a time.
- opnf3: mov a,m; Get member active flag
- ora a; 00=active, anything else can be...
- mvi b,11; Regarded as invalid (erased or blank)
- inx h; Point to member name
- jnz opnf5; No match if inactive entry
- opnf4: ldax d; Now compare the file name specified...
- cmp m; Against the member file name
- jnz opnf5; Exit loop if no match found
- inx h
- inx d
- dcr b
- jnz opnf4; Check all 11 char
- mov e,m; Got the file - get file address
- inx h
- mov d,m
- xchg
- shld index; Save file address in .LBR
- xchg
- inx h
- mov e,m; Get the file size
- inx h
- mov d,m
- xchg
- shld rcnt; Save size a # of records
- lhld index; Get file address
- shld random; Place it into random field
- xra a
- sta random+2; Must zero the 3rd byte
- sta fcbrno; Also zero FCB record #
- mvi a,rrdm; Read random
- call fileop
- jmp fisopen; No need to error check
- ;
- ; Come here if no file name match and another sector is needed
- opnf5: inx h; Skip past the end of the file entry
- dcr b
- jnz opnf5
- lxi b,20; Point to next file entry
- dad b
- lxi d,memfcb; Point to member name again
- mov a,h; See if we checked all 4 entries
- ora a
- jz opnf3; No, check next
- lhld dirsiz; Get directory size
- mov a,h
- ora l
- jz notinlbr; Can't find in library
- dcx h; Decrement dirctory size
- shld dirsiz
- mvi a,read; Read next sector of directory
- call fileop
- lxi h,tbuf; Set our pointers for compare
- lxi d,memfcb
- jmp opnf3; Check next sector
- ;
- ; File is open. Report size, xfr time, etc.
- fisopen:
- call ilprt; Print the message
- db cr,lf,'File open: ',0
- lhld rcnt; Get record count
- call decout; Print dec. number of records
- push h
- call ilprt
- db ' records (',0
- pop h; Get # of 128 byte records
- mov a,h
- ora l
- jz zeroln; Can't send 0-length files
- call decoutk; Show # of kilobytes
- lda sndflg; Receiving batch mode now?
- ora a
- rnz; If yes, all done
- ; " "
- ; Show transfer time, first for 1k blocks, then for 128 (skip the 1k
- ; times for slower than 1200 bps.)for 1200 bps
- call ilprt
- db 'k)',cr,lf,'Send time: ',0
- ; " "
- call mspeed
- cpi 5; 1200 bps
- jc fisop1; Skip 1k speed if less than 1200 bps
- call ktim; Get file xfr time in BC (minutes)
- call stortim; Store for comparing time remaining
- call showtime
- call ilprt
- db ' - 1k size',cr,lf,'Send time: ',0
- ; " "
- fisop1: call xtim; Get file xfr time in BC (minutes)
- lda kflg; If 'SK' set, 1k time already stored
- ora a
- cz stortim
- call showtime
- call ilprt
- db ' - 128 size',cr,lf,0
- lda bchflg
- ora a
- cnz cumsts; Show how many files remain after this
- lda fstflg
- ora a
- rnz
- call ilprt
- db cr,lf,'File open - ready to send',cr,lf
- db 'Aborts with several CTL-X',cr,lf,0
- ret
- ;
- ; Show time for file (bc mins, hl secs) and check for excess
- showtime:
- push h; Save seconds in 'L'
- mov l,c
- mov h,b
- call decout; print decimal number of minutes
- inx h; advance to next full minute
- xthl; save, get seconds
- call ilprt
- db ':',0
- mov a,l
- cpi 9+1
- mvi a,'0'
- cc ctype; if < 10 insert a '0'
- call decout; print seconds portion
- lda fstflg
- ora a
- jnz showt1
- call ilprt
- db ' at ',0
- lxi h,sptbl; Start of baud rate speeds
- call mspeed; Get speed indicator
- push psw
- add a; baud rate table in units of 4 bytes
- call indexw; into baud rate table
- xchg; Put address in 'DE' regs.
- mvi a,print; Show the baud
- call dos
- pop psw; recall mspeed
- cpi 5
- mvi a,'0'
- cnc ctype; Add '0' for 1200..9600 bps
- call ilprt
- db ' bps',0
- showt1: pop h; restore minutes, incremented
- lda tlimit; Check for special user or user with
- ora a; unlimited time
- rz
- mov a,h; Get minute count high byte
- ora a; Check if zero
- jnz overtm; If not, is over 255 minutes!
- lda tlimit; Mxtime allowed
- inr a; Plus 1
- sub l; Subtract file time from MXTIME
- rnc; If less, it's ok to continue
- ; " "
- overtm: call ilprt
- db cr,lf,cr,lf,'++ RXMD ABORTED - send time exceeds the ',0
- lda tlimit
- call decouta
- call erxit1
- db ' minutes allowed ++','$'
- ;
- badopn: lda optsav; Get command line option
- cpi 'L'; Want to send a library file?
- jnz noname; Exit, if not
- call erxit
- db cr,lf,'++ No library file with that name ++','$'
- ;
- noname: call erxit
- db cr,lf,'++ No file with that name ++','$'
- ;
- zeroln: call erxit
- db cr,lf,'++ Can''t send a 0-length file ++','$'
- ; " "
- notlbr: call erxit
- db cr,lf,'++ Library directory invalid? ++','$'
- ;
- notinlbr:
- call erxit
- db cr,lf,'++ Library does not have that file ++','$'
- ;
- nosend: call erxit
- db cr,lf,'++ That file not for distribution ++','$'
- ;
- sptbl: db '110$','300$','450$','600$','710$'
- db '120$','240$','480$','960$','1920$'
- ;
- stortim:
- ret
- ;
- <%