C     This Fortran program should be run on the mainframe in conjunctionBOO00010
C     with a Basic program (HP86BOOT) on the HP86 to transfer           BOO00020
C     HP86KERM.BOO to the HP86 and store it as 'KERMIT BOO'.  this      BOO00030
C     program uses a very rudimentary technique to try to insure that   BOO00040
C     the characters it sends arrive correctly.  It just sends a count  BOO00050
C     of the number of characters sent after each line.  In this way anyBOO00060
C     errors of character loss or insertion will be caught.  If a       BOO00070
C     character is just corrupted it will not be caught.  Hopefully if  BOO00080
C     this happens it will be in a non-critical part of the 'KERMIT BOO'BOO00090
C     file.  The reason a simple checksum was not used was so that this BOO00100
C     program could run on machines using either EBCDIC or ASCII        BOO00110
C     characters.  This program should take about thirty minutes to run.BOO00120
C                                                                       BOO00130
C     This program assumes that 5 and 6 are directed to the terminal andBOO00140
C     7 is directed to the file HP86KERM.BOOT.                          BOO00150
C
C     *Original Program* for use with a PC running MS-DOS by:-          BOO00160
C     Bill Catchings, Columbia University Center for Computing ActivitieBOO00170
C     June 1984 (Revised September 1984)                                BOO00180
C                                                                       BOO00190
C     *REVISED* at Sheffield City Polytechnic by R.L.Horton 22Aug85:-   BOO00200
C      1) FORTRAN G1 cannot accept "I-1" on a WRITE statement.          BOO00210
C      2) Insert a call to NULIN and to RETYPE.                         BOO00220
C     *REVISED* at Sheffield City Polytechnic by R.L.Horton 10Apr86:-   BOO00020
C      1) NULIN has been rename to NULLIN.                              BOO00021
C      2) For some unknown reason this program started issuing a double BOO00021
C         read to the terminal at statement 100/3 (at start-up)!
C         The FORMAT statement 200 has been corrected to stop it.
C      3) The FILEDEF for the terminal has been changed to RECFM F80.   BOO00021
C
C     *CHANGED* for use with HP86BOOT at Sheffield City Polytechnic
C     By M.J.Rootes 11Apr86:-
C      1) Accept lines up to 79 characters long
C      2) Reverse character count as HP86 BASIC lines contain spaces
C      3) Insert Linefeed between Line and character count
C

      INTEGER LINE(79), ACK(4), CHECK, OK, SPACE, COMMA                 BOO00230
      CALL NULLIN                                                       BOO00240
      CALL RETYPE                                                       BOO00250
                                                                        BOO00260
      WRITE(6,100)                                                      BOO00270
100   FORMAT(' Ready to transfer data, now run HP86BOOT on the HP86.')  BOO00280
                                                                        BOO00290
C     Get characters for constants (character constants are rough in    BOO00300
C     some FORTRANs).                                                   BOO00310
      READ (5,200) OK, SPACE, COMMA, ACK                                BOO00320
200   FORMAT(A1,A1,A1,4A1)                                              BOO00330
C     The following statement has been changed from GO TO 30.           BOO00340
      GO TO 20                                                          BOO00350
                                                                        BOO00360
C     Get terminal handshake.                                           BOO00370
10    READ (5,200)ACK                                                   BOO00380
                                                                        BOO00390
C     Did the other side like it?  (Did they send OK?)                  BOO00400
      IF (ACK(1) .NE. OK) GO TO 50                                      BOO00410
                                                                        BOO00420
C     Yes, get new line from file.                                      BOO00430
20    READ (7,300,END=99)LINE                                           BOO00440
300   FORMAT(79A1)                                                      BOO00450
                                                                        BOO00460
C           Count the characters as some rudimentary check for noise.   BOO00470
      I = 79                                                            BOO00480
30    IF (LINE(I) .NE. SPACE) GO TO 50                                  BOO00490
      I = I - 1                                                         BOO00500
      GO TO 30                                                          BOO00510
                                                                        BOO00520
C           Put in a comma followed by the count.                       BOO00530
C     40    LINE(I) = COMMA                                             BOO00540
                                                                        BOO00550
C     Write to TTY.                                                     BOO00560
50    WRITE (6,400)LINE,I                                               BOO00580
400   FORMAT(79A1/I2)                                                   BOO00590
      GOTO 10                                                           BOO00620
                                                                        BOO00630
C     Send good-bye message.                                            BOO00640
99    WRITE (6,500)                                                     BOO00650
500   FORMAT(10('&')/'10')                                              BOO00660
                                                                        BOO00670
      STOP                                                              BOO00680
      END                                                               BOO00690
