home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Columbia Kermit
/
kermit.zip
/
computervision
/
kermit.ibmgetln
< prev
next >
Wrap
Text File
|
2020-01-01
|
2KB
|
43 lines
;;;;;;;;;;;;;;;; IBMGETLN ;;;;;;;;;;;;;;;;;;;;;;;;
E'F A:S(NWLS)
E'O IBMGETLN.(BUFFER,CH)
; read a packet with a SOH in it and wait for the prompt
; before returning it
; BUFFER is an integer array that will hold the incoming packet
; CH tells this routine which channel to read the packet from
/INCLUDE BYU.PROG.KERMIT.SYM.EQU.KERCOM
/INCLUDE BYU.PROG.KERMIT.SYM.EQU.KERDEF
I'R BUFFER(132),CH,STATUS,GASOH,COUNT,T,IBYTE
I'R X
STATUS=YES
GASOH=NO ;we have not gotten a packet yet
COUNT=1
W'E (STATUS.EQ.YES)
W'E (GASOH.EQ.NO) ;keep reading one byte at a tim
IBYTE=0 ;the I/O port until you see the
X=TGETCH.(IBYTE,CH) ;character , EOF is not expected
W'R (IBYTE.EQ.SOH)
GASOH=YES ;I got the SOH
BUFFER(COUNT)=IBYTE ;store the SOH into buffer
COUNT=COUNT+1 ;increment the buffer pointer
E'L
E'W
IBYTE=0
X=TGETCH.(IBYTE,CH) ;read a byte from the I/O port
W'R (IBYTE.EQ.PROMPT) ; we got the prompt
STATUS=NO
O'E
BUFFER(COUNT)=IBYTE ;it is not a prompt, but another
COUNT=COUNT+1 ;data of the incoming packet
E'L ;store it and increment pointer
E'W
BUFFER(COUNT)=EOS ;add an EOS into end of buffer
LCLSTATE=OK
F'N LCLSTATE
E'N