home *** CD-ROM | disk | FTP | other *** search
/ Columbia Kermit / kermit.zip / computervision / kermit.rinit < prev    next >
Text File  |  2020-01-01  |  2KB  |  52 lines

  1. ; 17 jly 85 esj converted
  2. ;;;;;     RINIT     ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  3.       E'F A:S(NWLS)
  4.       E'O RINIT.(X)
  5.  
  6. ;     receive the initial packet from the remote KERIT
  7.  
  8. /INCLUDE BYU.PROG.KERMIT.SYM.EQU.KERCOM
  9. /INCLUDE BYU.PROG.KERMIT.SYM.EQU.KERDEF
  10.  
  11.       I'R LEN,NUM,STATUS,LCLSTATE,X,TNUM
  12.       I'R TV1,TV2,TV3
  13.  
  14.       W'R (NUMTRY.GT.MAXTRY)
  15.          LCLSTATE=BIGA                           ;exceeded max. # of re-try
  16.          F'N LCLSTATE                               ;gives up
  17.       O'E
  18.           NUMTRY=NUMTRY+1                     ;try-it again
  19.       E'L
  20.  
  21.       E'E FILL.(40,0,PACKET)
  22.  
  23.       STATUS=RPACK.(LEN,NUM,PACKET)            ;read a packet
  24.       W'R (STATUS.EQ.BIGS)                  ;we got a SINIT packet
  25.          E'E RPAR.(PACKET)                    ;store other KERMIT's requ
  26.          E'E SPAR.(PACKET)                    ;get our parameters/requir
  27.          TNUM=N
  28.          TV1=BIGY
  29.          TV2=6
  30.          E'E SPACK.(TV1,TNUM,TV2,PACKET)      ;send out requirement and
  31.          OLDTRY=NUMTRY                        ;ACK it on one shot
  32.          NUMTRY=0
  33.          N=((N+1).MOD.64)
  34.          LCLSTATE=BIGF                           ;change state to look for
  35.          F'N LCLSTATE                               ;the file header packet
  36.  
  37.       O'R(STATUS.EQ.BAD)              ;we got a checksum error
  38.            LCLSTATE=STATE
  39.            TNUM=N
  40.            TV1=BIGN
  41.            TV2=0
  42.            TV3=0
  43.            E'E SPACK.(TV1,TNUM,TV2,TV3)       ;NAK it
  44.            F'N LCLSTATE
  45.  
  46.       O'E
  47.           LCLSTATE=BIGA                          ;we got an unexpected pack
  48.       E'L                                   ;type, gives up
  49.  
  50.       F'N LCLSTATE
  51.       E'N
  52.