home *** CD-ROM | disk | FTP | other *** search
- ;
- ; ======================================
- ;
- ; SUBROUTINES
- ;
- ; ======================================
- ;
- ; Is (a) an Ascii digit. Carry if not
- ; f
- qnum: cpi '0'
- rc; not digit
- cpi '9'+1
- cmc
- ret
- ;
- ; Check next character to see if a space or non-space,
- ; file name error if not ASCII character.
- ;
- chkfsp: lda bchflg; Requesting batch mode now?
- ora a
- jz chkfsp2; Exit if not
- lda sndflg; Sending batch?
- ora a
- jz chkfsp2; If yes, exit
- dcr b; next char
- jz chkfsp1; eol and batch receive
- inr b
- chkfsp2:
- dcr b
- jz nfn; Error if end of chars.
- mov a,m
- cpi ' '+1
- rnc; Ok if valid char so return
- inx h
- jmp chkfsp
- chkfsp1:
- pop h; Do not return to GETDU
- ret; return instead to SNDFL
- ;
- ; Get Disk and User from DUSAVE and log in if valid.
- ;
- getdu: lda bchflg
- ora a
- jz getdu1; not requesting batch mode
- lda sndflg
- ora a
- jnz getdu2; not sending batch, exit
- getdu1: call chkfsp; See if a file name is included
- shld savehl; Save location of filename
- getdu2: lda prvtfl
- ora a
- jnz trap; uploading to a private area
- lxi h,dusave; Point to drive/user
- lda olddrv; Get current drive
- sta dud
- adi 'A'
- sta rcvdrv
- mov a,m; Get 1st char
- call qnum
- jnc getdu4
- sta rcvdrv; Allows SYSOP to upload to any drive
- cpi 'A'-1
- jc getdu3; Satisfied with current drive
- sui 'A'
- sta dud
- mvi a,sgmaxdrv
- call sysquery
- push h
- lxi h,dud
- cmp m
- pop h
- jc illdu
- inx h; Get 2nd char
- ; " "
- getdu3: mov a,m
- cpi ':'
- jz getdu8; Colon for drive only, no user number
- call cknum; Check if numeric
- mov b,a; Save char
- lda bchflg
- ora a
- jz getdu4; not in batch mode
- lda sndflg
- ora a
- jz nobat; batch send from current du only
- getdu4: mov a,b; Get the value back
- sui '0'; Convert ASCII to binary
- sta duu; Save it
- inx h; Get 3rd char., if any
- mov a,m
- cpi ':'
- jz getdu5
- lda duu
- cpi 1; Is first number a '1'?
- jnz illdu
- mov a,m
- call cknum
- sui '0'-10
- sta duu
- inx h; Get 4th (and last char) if any
- mov a,m
- cpi ':'
- jnz illdu
- getdu5: lda optsav; Get the option back
- cpi 'R'; Receiving a file?
- lda duu; Get desired user area
- jz getdu6; Yes, can not use special download area
- mvi a,gpsdrv
- call dorsx
- push h
- lxi h,dud; was special download drive requested
- sub m
- sui 'A'
- pop h
- lda duu; Get user area requested
- jnz getdu6; If not special, exit
- mvi a,gpsusr
- call dorsx
- push h
- lxi h,duu; If special download area requested
- cmp a
- mov a,m
- pop h
- jz getdu7; then process request
- getdu6: push h
- mvi a,sgmaxusr
- call sysquery
- lxi h,duu; Check for max user download area
- cmp m
- mov a,m
- pop h
- jc illdu; Error if more (and not special area)
- ; " "
- getdu7: call usrset; Set to requested user area
- getdu8: lda dud; Get drive
- call dskset; Set to requested drive
- jmp trap; Now find file selected
- ;
- ;
- ; Check next character to see if a space or non-space,
- ; No carry for eoln reached in batch send. Z flag for space
- ; a,f,h,l
- chksp: lda bchflg; Requesting batch mode?
- ora a
- jz chksp2; Exit if not
- lda sndflg; Sending in batch mode now?
- ora a
- jz chksp2; If yes, exit
- dcr b
- rz; with no carry for eoln in batch send
- inr b
- chksp2: dcr b
- jz opterr
- inx h
- mov a,m; Get the char there
- cpi ' '
- stc; signal NOT eoln in batch send
- ret; JZ = space, JNZ = non-space
- ;
- ; Log into drive and user (if specified). If none mentioned,
- ; it falls through to 'TRAP' routine for normal use.
- ;
- logdu: lxi h,tbuf; Point to default buffer command line
- mov b,m; Store number of characters in command
- inr b; Add in current location
- logdu1: call chksp; Skip spaces to find 1st command
- rnc; eoln found
- jz logdu1
- logdu2: call chksp; Skip 1st command (non-spaces)
- rnc; eoln found
- jnz logdu2
- inx h
- call chkfsp; Skip spaces to find 2nd command
- shld savehl; Save start address of the 2nd command
- ; " "
- ; Now point to the first byte in the argument, i.e., if it was of format
- ; similar to: B6:HELLO.DOC then we point at the drive character 'B'.
- lxi d,dusave
- mvi c,4; Drive/user is 4 chars maximum
- logdu3: mov a,m
- cpi ' '+1
- jc trap; Space or return, finished
- stax d
- inx h
- inx d
- cpi ':'
- jz getdu; If colon, get drive/user and log in
- dcr b; One less position to check
- dcr c; One less to go
- jnz logdu3
- ; " "
- ; Check for no file name or ambiguous name
- trap: call movefcb; Move filename into file block
- lxi h,fcb+1; Point to file name
- mov a,m; Get first char of file name
- cpi ' '; Any there?
- jz nfn; no name present
- ; " "
- ; check for ambiguous file name
- mvi b,11; 11 chars to check
- trap1: mov a,m; Get char from FCB
- cpi '?'; Ambiguous?
- jz trerr; Yes, exit with error message
- cpi '*'; Even more ambiguous?
- jz trerr; Yes, exit with error message
- inx h; Point to next char
- dcr b; One less to go
- jnz trap1; more
- ret
- ;
- trerr: lda bchflg
- ora a
- rnz; Wildcards are ok in batch mode
- call erxit; Print message, exit
- db cr,lf,'++ Wild-card options are not valid ++','$'
- ;
- cknum: call qnum
- rnc; ok if '0'..'9'
- ; " "
- illdu: call erxit
- db cr,lf,'++ Improper drive/user combination ++','$'
- ;
- nfn: call erxit; Print message, exit
- db cr,lf,'++ No file name requested ++','$'
- ;
- nobat: call erxit
- db cr,lf,'++ Batch files sent only from current D/U ++$'
- ▐s