Subject: Need byte-splitter utility

From: "Bruce Lane" <[email-masked]>
Date: Sat Mar 29 23:34:25 2003

Hi, gang,

	I've got a single EPROM file that I need to split into separate odd-byte/even-byte files for programming into two separate (smaller) EPROMs. I'm not able to figure out how to make the Unisite programmer do this, so I'm thinking a DOS or Windoze based splitting utility will do the trick.

	Here's the problem; I've searched all over Google, and can't find anything that'll work.

	Any ideas?

	Thanks much.

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Bruce Lane, Owner & Head Hardware Heavy,
Blue Feather Technologies -- http://www.bluefeathertech.com
ARS KC7GR (Formerly WD6EOS) since 12-77 -- [email-masked]
"I'll get a life when someone demonstrates that it would be superior
to what I have now..." (Taki Kogoma, aka Gym Z. Quirk)

---

From: Ron Hudson <[email-masked]>
Date: Mon Mar 31 19:15:00 2003

On Saturday, March 29, 2003, at 09:28  PM, Bruce Lane wrote:

> Hi, gang,
>
> 	I've got a single EPROM file that I need to split into separate 
> odd-byte/even-byte files for programming into two separate (smaller) 
> EPROMs. I'm not able to figure out how to make the Unisite programmer 
> do this, so I'm thinking a DOS or Windoze based splitting utility will 
> do the trick.
>

Is the file "readable" -ie text that may look like:

0000 00 11 22 33 44 55 66 77
0008 88 99 aa bb cc dd ee ff
000f 10 11 22 33 44 55 66 77

(only lined up because this is not a monospaced font)

You could write somthing quick and dirty in perl/basic/python/c/other 
language of choice

All the above probably available to a windows/dos machine.

---

From: "Jerome H. Fine" <[email-masked]>
Date: Mon Mar 31 19:16:45 2003

>Bruce Lane wrote:

>         Here's the problem; I've searched all over Google, and can't find anything that'll work.

Jerome Fine replies:

If you are desperate enough, I can easily write something to run
under RT-11.  In MACRO-11, that would be dead easy.  In
C, it should be just as easy and with FORTRAN - just open
the file and copy the bytes into two output files.

But then, unless you have not written any programs lately,
I would think it would be just as easy under any operating system.

However, I have chosen to stay away from writing software
except under RT-11.  There is too much I want to do there
and never seem to get the time - well, no one else seems to
be interested in any case.  So I don't have any compilers
available except under RT-11.

Sincerely yours,

Jerome Fine
--
If you attempted to send a reply and the original e-mail
address has been discontinued due a high volume of junk
e-mail, then the semi-permanent e-mail address can be
obtained by replacing the four characters preceding the
'at' with the four digits of the current year.

---

From: Frank McConnell <[email-masked]>
Date: Mon Mar 31 20:06:15 2003

"Bruce Lane" <[email-masked]> wrote:
> 	I've got a single EPROM file that I need to split into
> separate odd-byte/even-byte files for programming into two separate
> (smaller) EPROMs. I'm not able to figure out how to make the Unisite
> programmer do this, so I'm thinking a DOS or Windoze based splitting
> utility will do the trick.

Under Un*x, srec_cat from SRecord can be used for this purpose.  It
looks like it can be built for Win32 using gcc under Cygwin too.

<http://gd.tuwien.ac.at/softeng/Aegis/srecord.html>

-Frank McConnell

---

From: "Eric Smith" <[email-masked]>
Date: Mon Mar 31 20:09:26 2003

> 	Here's the problem; I've searched all over Google, and can't find

SRecord by Peter Miller does that and a lot more.  Originally written for
Unix, but there are prebuilt binaries for Windows NT.  I'd be somewhat
surprised if they don't also run on Windows 95/98/ME/2000/XP.

    http://srecord.sourceforge.net/

---

From: "Fred Cisin (XenoSoft)" <[email-masked]>
Date: Mon Mar 31 20:10:49 2003

> 	Here's the problem; I've searched all over Google, and can't find

This may sound harsh, but what is your favorite programming language?

It would be an excellent exercise for learning some programming.

---

From: [email-masked] (Tony Duell)
Date: Mon Mar 31 20:11:16 2003

> This may sound harsh, but what is your favorite programming language?

\begin{ciarcia_mode}
SOLDER!!
\end{ciarcia_mode}

:-)

> It would be an excellent exercise for learning some programming.

Agreed. I've had to write many 1-off utilites for scrambling data to get 
it into EPROMs over the years (when the address/data lines to the EPROM 
on the target board aren't in the normal sequence, or when I need to 
split/combine bytes to/from words, etc). It shouldn't take more than an 
evening to do the entire job, and I don't claim to be a programmer.

-tony

---

From: ben franchuk <[email-masked]>
Date: Mon Mar 31 20:12:46 2003

> \end{ciarcia_mode}

Dito. :)
On a real machine a good assembler is nice. I don't consider the PC
a real machine. I think CPU development went down hill after they forgot
about Machine Langauge programing.

---

From: "William R. Buckley" <[email-masked]>
Date: Mon Mar 31 20:16:07 2003

> -----Original Message-----
> From: [email-masked] 
> [mailto:[email-masked]]On
> Behalf Of ben franchuk
> Sent: Sunday, 30 March, 2003 14:23
> To: [email-masked]
> Subject: Re: Need byte-splitter utility
> 
> 
> Tony Duell wrote:

The great John von Neumann would agree!

---

From: "Bruce Lane" <[email-masked]>
Date: Mon Mar 31 20:48:08 2003

>It would be an excellent exercise for learning some programming.

	Yes, it is harsh, and such a statement is of absolutely no use to me since there are plenty of other things I have chosen to devote my time and energy to.

	I am, first and foremost, a hardware hack. I have a ton of respect for all the folks who have chosen to be code jockeys, but pesonally, I'm far happier with a soldering iron in one hand and a schematic in the other. Typing and debugging code all day, beyond the few scripts and config files I use to keep my 'net presence alive and well, would drive me nuts in less than a week.

	In short; I will do it if I have no other way to accomplish my goal. However, I will always search for a pre-written alternative (yes, I buy stuff from shareware authors) before I think about rolling my own.

	Fortunately, a number of other list users have offered outstandingly helpful pointers (thanks, troops!) As it turns out, it's not an odd-even split I need; It's high-byte/low-byte split. I'm still digging, and I find I often learn more along the way than I would if I sat down and started coding.

---

From: Joe <[email-masked]>
Date: Tue Apr 1 09:25:57 2003

>	Yes, it is harsh, and such a statement is of absolutely no use to me since there are plenty of other things I have chosen to devote my time and energy to.

   Well put Bruce! Some of the people on this list think that it's necessary to re-invent the wheel everytime that you want to do something. IMO you're a lot better off using existing software/hardware/whatever and spending your time on more productive pursuits. I CAN write code in BASIC, Assembly, several machine languages, Fortran, Pascal, APL and Cobol but I chose to leave it to the ones that enjoy it and are experts at it.

    Joe

---

From: "Bruce Lane" <[email-masked]>
Date: Tue Apr 1 10:19:32 2003

Hi, Joe,

*********** REPLY SEPARATOR  ***********

On 01-Apr-03 at 10:29 Joe wrote:

>   Well put Bruce! Some of the people on this list think that it's
>necessary to re-invent the wheel everytime that you want to do something.
>IMO you're a lot better off using existing software/hardware/whatever and
>spending your time on more productive pursuits. I CAN write code in BASIC,

	I figured that out, yes. In fact, I've found a number of utilities that come very close to what I want to do. The situation, though, was rendered academic when the manufacturer of the device I was trying to do the EPROM for chose to send me a pre-made update.

	In retrospect, that's probably better. It seems that the latest code for the SCSI bus analyzer I got is, by itself, larger than would normally fit into a 27C010 device. However, it seems that the engineers behind it pulled some goofy tricks (utilizing gaps in the original code image) to make everything fit. The downside of that is, of course, that the only reliable source of updates is an exact binary image of the updated EPROM, something that they did not have on their FTP site.

>Assembly, several machine languages, Fortran, Pascal, APL and Cobol but I
>chose to leave it to the ones that enjoy it and are experts at it.

	Right. I don't particularly enjoy it. Never have, never will. I'll do it when needed, and I certainly take pride in my work, but there are limits. ;-)

	Keep the peace(es).

---

From: "J.C.Wren" <[email-masked]>
Date: Wed Apr 2 01:51:39 2003

Whic programmer do you have?  Most that I'm familiar with (Needham, DataIO,
BP Microsystems, Tribal) all have a utility that after downloading the
image, allows you to program either the high byte or low byte of the image.
Is your programmer one that's perhaps a standalone unit that doesn't support
this?

	--John

> Behalf Of Bruce Lane
> Sent: Monday, March 31, 2003 21:43
> To: [email-masked]
> 	Yes, it is harsh, and such a statement is of absolutely
> no use to me since there are plenty of other things I have
> chosen to devote my time and energy to.
>
> 	I am, first and foremost, a hardware hack. I have a ton
> of respect for all the folks who have chosen to be code
> jockeys, but pesonally, I'm far happier with a soldering iron
> in one hand and a schematic in the other. Typing and
> debugging code all day, beyond the few scripts and config
> files I use to keep my 'net presence alive and well, would
> drive me nuts in less than a week.
>
> 	In short; I will do it if I have no other way to
> accomplish my goal. However, I will always search for a
> pre-written alternative (yes, I buy stuff from shareware
> authors) before I think about rolling my own.
>
> 	Fortunately, a number of other list users have offered
> outstandingly helpful pointers (thanks, troops!) As it turns
> out, it's not an odd-even split I need; It's
> high-byte/low-byte split. I'm still digging, and I find I
> often learn more along the way than I would if I sat down and
> started coding.
>
>
>
>

---

From: "Fred Cisin (XenoSoft)" <[email-masked]>
Date: Wed Apr 2 02:38:48 2003

On Mon, 31 Mar 2003, Bruce Lane wrote:
> 	Yes, it is harsh, and such a statement is of absolutely no use
> to me since there are plenty of other things I have chosen to devote
> my time and energy to.

OK
Sorry, some of us forget that not everybody enjoys programming.
If you have a K&R compatible C compiler, here's a quick, crude one for
you.  For some compilers/OS's the "rb" and "wb" need tobe "r" and "w".
IF each of the output files is half the size of the input file, then it
worked.  
If you want input of the filenames, better error checking, verification of
file content, etc., that can be added later.

#include <STDIO.H>
#include <FILE.H>

main()
{
	int x;
	FILE * FPIN, FPO1, FPO2;
	FPIN = fopen("INPUT.DAT","rb");
	FPO1 = fopen("OUT1.DAT","wb");
	FPO2 = fopen("OUT2.DAT","wb");
	
	while ((x = fgetc(FPIN)) != EOF)
	{	
		fprintf(FPO1,"%c",x);
		x = fgetc(FPIN);
		fprintf(FPO2,"%c",x);
	}
	fclose(FPIN);
	fclose(FPO1);
	fclose(FPO2);
}