* Ralph Corderoy ([EMAIL PROTECTED]) wrote: > > Hi, > > Can anyone remind me where arcem handles endianess, e.g. when storing > words and then loading bytes. I've had a quick look but can't remember > enough to locate it.
Hi Ralph, This took me a few minutes to remember - the simple answer is it avoids it for everything internal. The memory is represented by a *word* array (MEMC.PhysRam) that gets accessed by normal C array operations and is thus held in host endianness. Byte accesses are done by reading the word and shifting and masking; and bit order is always constant in C (see PutVal in arch/armarc.c and look for the bNw code to see where it masks). The only place this doesn't hold is where you need to dump something to the video or else to the OS. Even the code to read the ROM in (armarc.c ARMul_MemoryInit) doesn't need to know host endianness; it just reads 4 bytes in, assembles them as a word using C shifts. Dave ------------------------------------------------------- This SF.Net email is sponsored by xPML, a groundbreaking scripting language that extends applications into web and mobile media. Attend the live webcast and join the prime developer group breaking into this new coding territory! http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642 _______________________________________________ arcem-devel mailing list arcem-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/arcem-devel