From: huntercr AT cs DOT purdue DOT edu (Charles Hunter) Subject: Little endian to big endian and vice versa... To: executor AT nacm DOT com (Executor mailing list), DJGPP AT sun DOT soe DOT clarkson DOT edu (djgpp mailing list) Date: Sat, 22 Apr 1995 10:18:55 -0500 (EST) Cc: huntercr AT cs DOT purdue DOT edu (Charles Randolph Hunter) Hi gang, I know that this is inappropriate to post on either of these lists, but I hear it talked about so often that I thought I might ask here. I am working on a project that will convert simple binaries across two platforms and or back again. This is similar to a program I picked up called, "86to68", which converts 8086 asm to 68000 asm. I am attempting to do this from the assembled [binary ] level. Sort of a re-assembler. Things are working out well, but I have been ignoring, until now, the endian difference. My question is: What patterns should the program look for? What kind of strategy should the program use to check? I'll admit, I am a little ignorant on the subject. Can this be swapped statically at all? If so, Should I execute the program internally and tag all references to 16+bit data? If not... am I going to have to add a swap routine to every program that is reassembled? I'm confused. 8-) Right now, I am only implementing a 2 pass dissasemble that does nothing with what appears to be dataspace. Mat? Cliff? DJ? anyone??? Help! --Charles Hunter