home *** CD-ROM | disk | FTP | other *** search
- ; 16 jly 85 esj converted
- ;;;;;;;;;;;;;;;;;; KGETLIN ;;;;;;;;;;;;;;;;;;;;
- E'F A:S(NWLS)
- E'O KGETLIN.(BUFFER,UNIT)
-
- ; read a packet with a SOH in it and DON'T wait for the prompt
- ; before returning it
-
- ; BUFFER is an integer array that will hold the incoming packet
- ; UNIT tells this routine which device to read the packet from
-
- /INCLUDE BYU.PROG.KERMIT.SYM.EQU.KERCOM
- /INCLUDE BYU.PROG.KERMIT.SYM.EQU.KERDEF
-
- I'R BUFFER(*),STATUS,GASOH,COUNT,IBYTE
- I'R X,LCLSTATE
-
- ; E'E TYPEHEX.(.ADDR.BUFFER)
- STATUS=YES
- GASOH=NO ;we have not gotten a packet yet
- COUNT=0
- W'E (STATUS.EQ.YES)
- IBYTE=0
- X=TGETCH.(IBYTE,UNIT) ;read a byte from the I/O port
- W'R (IBYTE.EQ.MYEOL .AND. GASOH .E. YES) ;we got the required MYEOL
- STATUS=NO
- O'R (IBYTE .E. SOH)
- BUFFER(0)=IBYTE ;store the SOH into buffer
- COUNT = 1 ; rest buffer pointer to first soh
- GASOH = YES
- O'R (GASOH .E. YES) ; get char into buffer iff gasoh=yes
- BUFFER(COUNT)=IBYTE ;it is not MYEOL, 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
- ; E'E TYPOUT.(2,$KL$)
- ; E'E TYPEHEX.(COUNT)
- ; E'E TYPEHEX.(.ADDR.(BUFFER(COUNT)))
- ; E'E STACKDMP.
- F'N LCLSTATE
- E'N
-