1    'On an IBM PC or compatible, use this BASICA program to convert a
2    'Kermit .BOO file to its original form.  The result is usually an
3    '.EXE file.  The program will prompt you for the file specifications
4    'of the input file and the output file, showing the defaults for
5    'each.  The default for the input file is MSKERMIT.BOO.  The default
6    'for the output file will be the file specification in the first line
7    'of the input file.
8    '
9    'Because of the way BASICA does its file I/O, an end-of-file
10   'character (control Z = hex 1A) will be added to the end of the
11   'output file.  This character will be included in the length of
12   'the output file.
13   '
14   'This program is based on MSPCTRAN.BAS by Bill Catchings, and it
15   'uses the same algorithm.  Many changes have been made to speed the
16   'program up.  It runs in 45% to 60% of the time that MSPCTRAN.BAS
17   'takes.  Using a hard disk, this program will convert the 59,394
18   'byte file named MSJRD5G.BOO in about 12 1/2 minutes.  Using a
19   'floppy disk instead, this program will do the same conversion in
20   'about 14 minutes.
21   '
22   'Developmemt and testing were done on an IBM PC XT using PC-DOS
23   '2.1 and IBM BASICA 2.0.  In CONFIG.SYS, BUFFERS=8.
24   '
25   '          Alan H. Holland     FEAHH at VTVM1 on BITNET
26   '          5/12/86

100  defint a-z
110  z = asc("0")
120  t = asc("~") - z

200  fid$ = "MSKERMIT.BOO"
210  print "Enter the file specification of the file to be deBOOed."
220  print "<CR> for default ["; fid$;
230  line input "] :", fi$
240  print
250  if len(fi$) = 0  then fi$ = fid$
260  open fi$ for input as #1

300  line input #1, fod$
310  if len(fod$) <= 12 then goto 400
320  print "Error: The format of the .BOO file is incorrect."
330  close #1
340  system

400  print "Enter the file specification of the output file."
410  print "<CR> for default ["; fod$;
420  line input "] :", fo$
430  print
440  if len (fo$) = 0 then fo$ = fod$

450  t1$ = time$
470  print "Processing started at:  "; t1$
480  open fo$ for output as #2

500  if eof(1) goto 800
510  input #1, x$

600  if len(x$) < 2 goto 500
610  a = asc(x$) - z
620  b = asc( mid$(x$,2,1) ) - z
630  if a = t goto 700
640  if len(x$) < 4 goto 500
650  c = asc( mid$(x$,3,1) ) - z
660  d = asc( mid$(x$,4,1) ) - z

670  print#2,chr$(a*4+b\16 and 255);chr$(b*16+c\4 and 255);chr$(c*64+d and 255);

680  x$ = mid$(x$,5)
690  goto 600

700  print #2, string$(b,0);
710  x$ = mid$(x$,3)
720  goto 600

800  close #1, #2
810  t2$ = time$
820  print "Processing finished at: "; t2$
850  system

