home *** CD-ROM | disk | FTP | other *** search
/ Columbia Kermit / kermit.zip / mskermit / msboot.f < prev    next >
Text File  |  2020-01-01  |  3KB  |  74 lines

  1. C     This Fortran program should be run on the mainframe in conjunction
  2. C     with a Basic program (MSPCBOOT.BAS) on the PC to transfer
  3. C     MSKERMIT.BOO to the PC and translate it into KERMIT.EXE.  This
  4. C     program uses a very rudimentary technique to try to insure that
  5. C     the characters it sends arrive correctly.  It just sends a count
  6. C     of the number of characters sent after each line.  In this way any
  7. C     errors of character loss or insertion will be caught.  If a
  8. C     character is just corrupted it will not be caught.  Hopefully if
  9. C     this happens it will be in a non-critical part of the KERMIT.EXE
  10. C     file.  The reason a simple checksum was not used was so that this
  11. C     program could run on machines using either EBCDIC or ASCII
  12. C     characters.  This program should take about thirty minutes to run.
  13. C
  14. C     This program assumes that the standard input and standard output units
  15. C     are directed to the terminal.  The program prompts for the name of a
  16. C     file to transfer (e.g. MSKERMIT.BOO) and opens unit 7 with than name.
  17. C
  18. C     Modified by:
  19. C     Tom Putnam, Purdue University Computing Center, Dec. 1985.
  20. C     (changed to FORTRAN 77, prompt for file name, cleanup)
  21. C
  22. C     Original by:
  23. C     Bill Catchings, Columbia University Center for Computing Activities
  24. C     June 1984 (Revised September 1984)
  25. C
  26.       CHARACTER*1 LINE(77), ACK, OK, SPACE, COMMA
  27.       CHARACTER*30 FNAME
  28.  
  29.       PRINT *, 'Enter the full name of the .BOO file to transfer'
  30.       READ (*,5) FNAME
  31. 5     FORMAT(A30)
  32.       OPEN(UNIT=7,FILE=FNAME,STATUS='OLD',ERR=99)
  33.  
  34.       PRINT *,'Ready to transfer data, now run MSPCBOOT.BAS on the PC.'
  35.  
  36. C     Get characters for constants (character constants are rough in
  37. C     some FORTRANs).
  38.       READ (*,10) OK, SPACE, COMMA, ACK
  39. 10    FORMAT(4A1)
  40.  
  41. C     Get new line from file.
  42. 20    READ (7,30,END=80)LINE
  43. 30    FORMAT(77A1)
  44.  
  45. C     Count the characters as some rudimentary check for noise.
  46.       I = 1
  47. 40    IF (LINE(I) .EQ. SPACE) GO TO 50
  48.       I = I + 1
  49.       GO TO 40
  50.  
  51. C     Put in a comma followed by the count.
  52. 50    LINE(I) = COMMA
  53.  
  54. C     Write to TTY.
  55. 60    WRITE (*,70)LINE,I-1
  56. 70    FORMAT(77A1,I2)
  57.  
  58. C     Get terminal handshake.
  59.       READ (*,10)ACK
  60.  
  61. C     Did the other side like it?  (Did they send OK?)
  62.       IF (ACK .NE. OK) GO TO 60
  63.       GOTO 20
  64.  
  65. C     Send good-bye message.
  66. 80    WRITE (*,90)
  67. 90    FORMAT(10('&'),',10')
  68.       STOP
  69.  
  70. C     Here if error opening file
  71. 99    PRINT *,'Error - cannot open file = ',FNAME
  72.       STOP
  73.       END
  74.