On Thu, Feb 19, 1998 at 01:37:03PM +0000, Theo Markettos wrote: > That depends on what your assembler and programmer software handle. The > simplest way is with a binary image - you just write a Basic program to Here is a C program that does just this. Before I get flamed for posting code to the list, it's only 1K. #include #include #include main(argc, argv) char ** argv; { FILE * hi, * lo; int c; char filebuf[128]; if(argc < 3) { fprintf(stderr, "Usage: binsplit input_file output_file_base\n") ; fprintf(stderr, "E.g. : binsplit foo.bin bar\n"); fprintf(stderr, " produces bar.hi and bar.lo\n"); exit(1); } if(freopen(argv[1], "rb", stdin) == NULL) { perror(argv[1]); exit(1); } strcpy(filebuf, argv[2]); if(strchr(filebuf, '.')) { fprintf(stderr, "output file name should not include a file type or extension\n"); exit(1); } strcat(filebuf, ".hi"); if(!(hi = fopen(filebuf, "wb"))) { perror(filebuf); exit(1); } strcpy(filebuf, argv[2]); strcat(filebuf, ".lo"); if(!(lo = fopen(filebuf, "wb"))) { perror(filebuf); exit(1); } while((c = getchar()) != EOF) { putc(c, hi); if((c = getchar()) == EOF) { exit(0); } putc(c, lo); } exit(0); } -- Clyde Smith-Stubbs | HI-TECH Software Email: clyde@htsoft.com | Phone Fax WWW: http://www.htsoft.com/ | USA: (408) 490 2885 (408) 490 2885 PGP: finger clyde@htsoft.com | AUS: +61 7 3354 2411 +61 7 3354 2422 --------------------------------------------------------------------------- ANSI C for the PIC! Now shipping! See www.htsoft.com for more info.