; 17 jly 85 esj converted ;;;;; RINIT ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; E'F A:S(NWLS) E'O RINIT.(X) ; receive the initial packet from the remote KERIT /INCLUDE BYU.PROG.KERMIT.SYM.EQU.KERCOM /INCLUDE BYU.PROG.KERMIT.SYM.EQU.KERDEF I'R LEN,NUM,STATUS,LCLSTATE,X,TNUM I'R TV1,TV2,TV3 W'R (NUMTRY.GT.MAXTRY) LCLSTATE=BIGA ;exceeded max. # of re-try F'N LCLSTATE ;gives up O'E NUMTRY=NUMTRY+1 ;try-it again E'L E'E FILL.(40,0,PACKET) STATUS=RPACK.(LEN,NUM,PACKET) ;read a packet W'R (STATUS.EQ.BIGS) ;we got a SINIT packet E'E RPAR.(PACKET) ;store other KERMIT's requ E'E SPAR.(PACKET) ;get our parameters/requir TNUM=N TV1=BIGY TV2=6 E'E SPACK.(TV1,TNUM,TV2,PACKET) ;send out requirement and OLDTRY=NUMTRY ;ACK it on one shot NUMTRY=0 N=((N+1).MOD.64) LCLSTATE=BIGF ;change state to look for F'N LCLSTATE ;the file header packet O'R(STATUS.EQ.BAD) ;we got a checksum error LCLSTATE=STATE TNUM=N TV1=BIGN TV2=0 TV3=0 E'E SPACK.(TV1,TNUM,TV2,TV3) ;NAK it F'N LCLSTATE O'E LCLSTATE=BIGA ;we got an unexpected pack E'L ;type, gives up F'N LCLSTATE E'N