home *** CD-ROM | disk | FTP | other *** search
/ Columbia Kermit / kermit.zip / convergent / ctaaaa.bwr < prev    next >
Internet Message Format  |  2020-01-01  |  3KB

  1. Date: Tue, 26 Oct 93 9:31:59 EDT
  2. From: Frank da Cruz <fdc@watsun.cc.columbia.edu>
  3. To: Michel Bartholome <bartholome@bavax.bartho.ulg.ac.be>
  4. Subject: Re: Kermit for BTOS and CTOS
  5. In-Reply-To: Your message of Tue, 26 Oct 1993 11:34:26 +0200
  6.  
  7. > A friend of me need Kermit for a Burroughs B28.
  8. > In the last version of CT-Kermit(Version 2.00) two files are missing:
  9. > CTOBJS.? and CTLIBS.?
  10. CTLIBS.FLS is there.  It contains the following two lines:
  11.  
  12. <sys>medium.c.lib
  13. <sys>mwc.lib
  14.  
  15. > >A 'ctobjs' file is supplied, containing a list of 
  16. > >all .o files.  To link, specify @ctobjs for the object modules, and @ctlibs 
  17. > >(supplied) for libraries. 
  18. I can't find the ctobjs file, however, but I assume it would simply contain
  19. a list of all the object files produced by the compile step, perhaps something
  20. like this:
  21.  
  22. ctaaaa.o
  23. ctcmd.o
  24. ctconu.o
  25. ctctdir.o
  26. ctdial.o
  27. ctfns.o
  28. ctfns2.o
  29. ctlogi.o
  30. ctmain.o
  31. ctprot.o
  32. ctuser.o
  33. ctusr2.o
  34. ctusr3.o
  35. ctvt10.o
  36. ctxcto.o
  37. ctzcto.o
  38.  
  39. Let me know if this is correct.  In any case, the binary executable is also
  40. supplied in simple hex form as ctct.hex, and so you should not really need to
  41. compile from source code.  Here is a program that should do the job of
  42. decoding the hex file back into a binary:
  43.  
  44. /*  UNHEX.C - Program to translate a hex file from standard input
  45.  *  into an 8-bit binary file on standard output.
  46.  *  Usage: unhex < foo.hex > foo.exe
  47.  *  Christine M. Gianone, CUCCA, October 1986.
  48.  *  Modified Aug 89 to work right with Microsoft C on the PC.
  49.  */
  50.  
  51. #include <stdio.h>            /* Include this for EOF symbol */
  52. #ifdef MSDOS
  53. #include <fcntl.h>            /* For MS-DOS setmode() symbol */
  54. #endif
  55.  
  56. unsigned char a, b;            /* High and low hex nibbles */
  57. unsigned int c;                /* Character to translate them into */
  58. unsigned char decode();            /* Function to decode them  */
  59.  
  60. /* Main program reads each hex digit pair and outputs the 8-bit byte. */
  61.  
  62. main() {
  63. #ifdef MSDOS
  64.     setmode(fileno(stdout),O_BINARY); /* To avoid DOS text-mode conversions */
  65. #endif
  66.     while ((c = getchar()) != EOF) {    /* Read first hex digit */
  67.     a = c;                /* Convert to character */
  68.         if (a == '\n' || a == '\r') {    /* Ignore line terminators */
  69.             continue;
  70.     }
  71.     if ((c = getchar()) == EOF) {    /* Read second hex digit */
  72.         fprintf(stderr,"File ends prematurely\n");
  73.         exit(1);
  74.     }
  75.     b = c;                /* Convert to character */
  76.     putchar( ((decode(a) * 16) & 0xF0) + (decode(b) & 0xF) );
  77.     }
  78.     exit(0);                /* Done */
  79. }
  80.  
  81. unsigned char
  82. decode(x) char x; {              /* Function to decode a hex character */
  83.     if (x >= '0' && x <= '9')         /* 0-9 is offset by hex 30 */
  84.       return (x - 0x30);
  85.     else if (x >= 'A' && x <= 'F')    /* A-F offset by hex 37 */
  86.       return(x - 0x37);
  87.     else {                            /* Otherwise, an illegal hex digit */
  88.         fprintf(stderr,"\nInput is not in legal hex format\n");
  89.         exit(1);
  90.     }
  91. }
  92.  
  93.