Re: [Help] Endian Problem

Max TenEyck Woodbury <>
18 Sep 1998 23:03:37 -0400

          From comp.compilers

Related articles
[Help] Endian Problem (Yunseok Rhee) (1998-09-13)
Re: [Help] Endian Problem (Max TenEyck Woodbury) (1998-09-18)
Re: [Help] Endian Problem (Michael Meissner) (1998-09-18)
Re: [Help] Endian Problem (1998-09-18)
Re: [Help] Endian Problem (1998-09-22)
| List of all articles for this month |

From: Max TenEyck Woodbury <>
Newsgroups: comp.compilers
Date: 18 Sep 1998 23:03:37 -0400
Organization: Duke University, Durham, NC, USA
References: 98-09-039
Keywords: architecture, performance

Yunseok Rhee wrote:
> For architectural simulation, I should deal with MIPS executable codes
> in a Pentium PC. Unfortunately, the endians between the two machines
> are different: MIPS machines adopt the big-endian but the PCs do the
> little-endian.

I have no idea how practical this is, but you may be able to take
advantage of the fact that big-endian and little-endian architectures
can be converted to each other by complementing the addresses used.

Try reading the MIPS image in and byte reversing the whole thing once.
Instead of incrementing the instruction counter, decrement. Whenever
you are about to use an address, complement it (after you have
finished any arithmetic on the address) then translate it. If you do
this, the memory loads will pick up the right number of bytes in the
right order.

It's 1 A.M., I'm short on sleep and may be talking in my sleep, so if
this is a real stinko idea, just heave it and keep your flames to

Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.