home *** CD-ROM | disk | FTP | other *** search
/ Columbia Kermit / kermit.zip / mskermit / msbpct.bas < prev    next >
BASIC Source File  |  2020-01-01  |  3KB  |  81 lines

  1. 1    'On an IBM PC or compatible, use this BASICA program to convert a
  2. 2    'Kermit .BOO file to its original form.  The result is usually an
  3. 3    '.EXE file.  The program will prompt you for the file specifications
  4. 4    'of the input file and the output file, showing the defaults for
  5. 5    'each.  The default for the input file is MSKERMIT.BOO.  The default
  6. 6    'for the output file will be the file specification in the first line
  7. 7    'of the input file.
  8. 8    '
  9. 9    'Because of the way BASICA does its file I/O, an end-of-file
  10. 10   'character (control Z = hex 1A) will be added to the end of the
  11. 11   'output file.  This character will be included in the length of
  12. 12   'the output file.
  13. 13   '
  14. 14   'This program is based on MSPCTRAN.BAS by Bill Catchings, and it
  15. 15   'uses the same algorithm.  Many changes have been made to speed the
  16. 16   'program up.  It runs in 45% to 60% of the time that MSPCTRAN.BAS
  17. 17   'takes.  Using a hard disk, this program will convert the 59,394
  18. 18   'byte file named MSJRD5G.BOO in about 12 1/2 minutes.  Using a
  19. 19   'floppy disk instead, this program will do the same conversion in
  20. 20   'about 14 minutes.
  21. 21   '
  22. 22   'Developmemt and testing were done on an IBM PC XT using PC-DOS
  23. 23   '2.1 and IBM BASICA 2.0.  In CONFIG.SYS, BUFFERS=8.
  24. 24   '
  25. 25   '          Alan H. Holland     FEAHH at VTVM1 on BITNET
  26. 26   '          5/12/86
  27.  
  28. 100  defint a-z
  29. 110  z = asc("0")
  30. 120  t = asc("~") - z
  31.  
  32. 200  fid$ = "MSKERMIT.BOO"
  33. 210  print "Enter the file specification of the file to be deBOOed."
  34. 220  print "<CR> for default ["; fid$;
  35. 230  line input "] :", fi$
  36. 240  print
  37. 250  if len(fi$) = 0  then fi$ = fid$
  38. 260  open fi$ for input as #1
  39.  
  40. 300  line input #1, fod$
  41. 310  if len(fod$) <= 12 then goto 400
  42. 320  print "Error: The format of the .BOO file is incorrect."
  43. 330  close #1
  44. 340  system
  45.  
  46. 400  print "Enter the file specification of the output file."
  47. 410  print "<CR> for default ["; fod$;
  48. 420  line input "] :", fo$
  49. 430  print
  50. 440  if len (fo$) = 0 then fo$ = fod$
  51.  
  52. 450  t1$ = time$
  53. 470  print "Processing started at:  "; t1$
  54. 480  open fo$ for output as #2
  55.  
  56. 500  if eof(1) goto 800
  57. 510  input #1, x$
  58.  
  59. 600  if len(x$) < 2 goto 500
  60. 610  a = asc(x$) - z
  61. 620  b = asc( mid$(x$,2,1) ) - z
  62. 630  if a = t goto 700
  63. 640  if len(x$) < 4 goto 500
  64. 650  c = asc( mid$(x$,3,1) ) - z
  65. 660  d = asc( mid$(x$,4,1) ) - z
  66.  
  67. 670  print#2,chr$(a*4+b\16 and 255);chr$(b*16+c\4 and 255);chr$(c*64+d and 255);
  68.  
  69. 680  x$ = mid$(x$,5)
  70. 690  goto 600
  71.  
  72. 700  print #2, string$(b,0);
  73. 710  x$ = mid$(x$,3)
  74. 720  goto 600
  75.  
  76. 800  close #1, #2
  77. 810  t2$ = time$
  78. 820  print "Processing finished at: "; t2$
  79. 850  system
  80.  
  81.