I have a piece of code that does some bit-fiddling, which should work on Little Endian and Big Endian alike.
Unfortunately the company has shut down the last of the AIX boxes (that I had access to), which were my go-to point to test BE code.
So... how do you test big-endian code? Online compilers like ideone.com are all LE. Emulation? Some small board / box that runs a BE Linux? I'd probably even be willing to shell out a couple of bucks if it gave me a big-endian testbed. One I could use to test heavily C++17-ish code...
How to test big-endian code?
How to test big-endian code?
Every good solution is obvious once you've found it.
Re: How to test big-endian code?
I bought for myself iMac g5. openbsd and linux can run on it.
it's even 64 bit. theoretically. with 512MB of RAM.
it's even 64 bit. theoretically. with 512MB of RAM.
-
- Member
- Posts: 223
- Joined: Thu Jul 05, 2007 8:58 am
Re: How to test big-endian code?
You could also look into using some ARM based board, as arm still supports both endian conventions.
Re: How to test big-endian code?
RaspberryPi draws a blank, as does Arduino...
Every good solution is obvious once you've found it.
Re: How to test big-endian code?
How about an old SPARC box from eBay? Buy-it-nows for about £50 in UK. You might strike lucky with an auctioned one.
- Schol-R-LEA
- Member
- Posts: 1925
- Joined: Fri Oct 27, 2006 9:42 am
- Location: Athens, GA, USA
Re: How to test big-endian code?
I would start by trying it in QEMU emulating MIPS BE (which is actually the default for MIPS on QEMU; the MIPS little-endian emulation is given as 'mipsel' rather than 'mips').
Rev. First Speaker Schol-R-LEA;2 LCF ELF JAM POEE KoR KCO PPWMTF
Ordo OS Project
Lisp programmers tend to seem very odd to outsiders, just like anyone else who has had a religious experience they can't quite explain to others.
Ordo OS Project
Lisp programmers tend to seem very odd to outsiders, just like anyone else who has had a religious experience they can't quite explain to others.
Re: How to test big-endian code?
Another possibility here: https://chiefio.wordpress.com/2015/10/1 ... d-endians/
Re: How to test big-endian code?
I think I have completed the circle, coming back home.
I installed WinUAE (which, being the owner of a licensed copy of AmigaForever, I have the ROM and OS files for), downloaded the DICE C compiler, and by putting the bit-fiddling stuff into out-of-context C files, am now able to put the Endian-dependent logic to the actual test.
Not quite what I would have preferred, but a workable solution.
And it feels like it was just yesterday, seeing the Amiga Workbench again...
I installed WinUAE (which, being the owner of a licensed copy of AmigaForever, I have the ROM and OS files for), downloaded the DICE C compiler, and by putting the bit-fiddling stuff into out-of-context C files, am now able to put the Endian-dependent logic to the actual test.
Not quite what I would have preferred, but a workable solution.
And it feels like it was just yesterday, seeing the Amiga Workbench again...
Every good solution is obvious once you've found it.
Re: How to test big-endian code?
Actually a good friend of mine happened to have an A3000 in his garage, complete with a SCSI hard drive. (The A3000 being the only Amiga that ever came with a MMU out-of-the-box -- you need the MMU to run a Unix on it.) The beauty is now sitting in my room, pending a test run after almost two decades of inactivity.
If it doesn't work out, the UAE / C solution is good enough for me.
(Auctioned Amigas are anything but cheap. The nostalgics associated with the platform, combined with the scarcity of late-era hardware, made prices go up instead of down over time...)
If it doesn't work out, the UAE / C solution is good enough for me.
(Auctioned Amigas are anything but cheap. The nostalgics associated with the platform, combined with the scarcity of late-era hardware, made prices go up instead of down over time...)
Every good solution is obvious once you've found it.