home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Columbia Kermit
/
kermit.zip
/
archives
/
computervision.tar.gz
/
computervision.tar
/
kermit.bufill
< prev
next >
Wrap
Text File
|
1987-02-19
|
2KB
|
52 lines
; 23 jly esj on cr, add lf
; 18 jly 85 esj converted
;;;;;;;;;;;;;; BUFILL ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
E'F A:S(NWLS)
E'O BUFILL.(BUFFER)
; fill up the buffer with character byte from the sending disk file
; BUFFER is used to stored the data from the sending disk file
/INCLUDE BYU.PROG.KERMIT.SYM.EQU.KERCOM
/INCLUDE BYU.PROG.KERMIT.SYM.EQU.KERDEF
I'R I,BUFFER(132)
I=0
R'T
E'E DGETCH.(T,FD) ;keep reading byte from the d
W'R T .E. -1 , B'K ;file until we reach an EOF,o
;we have enough byte to fill
;buffer, return from within t
;directly
W'R ((T.LT.BLANK).OR.(T.EQ.DEL).OR.(T.EQ.QUOTE))
W'R (T.EQ.CR) ;it is the line delimiter of
BUFFER(I)=QUOTE ;this system, insert the CR
I=I+1 ;before the LF
BUFFER(I)=CTL.(CR)
I=I+1
T = LF ; and put lf in buffer
E'L
BUFFER(I)=QUOTE ;we got a character that
I=I+1 ;quoting
W'R (T.NE.QUOTE),T=CTL.(T)
E'L
BUFFER(I)=T
I=I+1
W'R (I.GT.(SPSIZ-8)) ;read up to spsiz-8 byte from disk
LCLSTATE=I ;I byte was read
F'N LCLSTATE
E'L
F'R
W'R (I.EQ.0)
LCLSTATE=EOF ;zero byte was read
F'N LCLSTATE
O'E
LCLSTATE=I ;partial EOF was detected
F'N LCLSTATE
E'L
F'N LCLSTATE
E'N