![]() |
| | #1 |
| Registered User Join Date: Oct 2006 Location: UK/Norway
Posts: 469
| Question about endians I was wondering what is the advantage of the different endian systems? To me it looks like small end big endians would have the same advantages/disadvantages, while middle endians would just make things more complicated? From what I have found out hand held consoles tend to favor the little endia system, while bigger systems are big endians. But does it really make a difference how memory is stored? Thanks |
| h3ro is offline | |
| | #2 |
| Kernel hacker Join Date: Jul 2007 Location: Farncombe, Surrey, England
Posts: 15,686
| It is probably more of a coincidence (as in handheld systems prefer ARM or MIPS, bigger systems prefer X86) than anything else. In the old days, the benefit of a little endian system was that a 16-bit update (for example increment or decrement) could potentially be made by writing the low byte only, and skipping the high byte - assuming you have a 8-bit bus, that is. On a 16-bit bus, you could perhaps do a 32-bit update by only updating the low half too. These sort of benefits are no longer interesting, since these type of updates go to cache in 99.99% of all cases (and 100% of performance critical updates). So, it's just a choice made by the processor designers these days. -- Mats
__________________ Compilers can produce warnings - make the compiler programmers happy: Use them! Please don't PM me for help - and no, I don't do help over instant messengers. |
| matsp is offline | |
| | #3 |
| (?<!re)tired Join Date: May 2006 Location: Portugal
Posts: 5,650
| And probably based only on historical reasons or backwards compatibility issues with code that makes specific use of endianness.
__________________ Originally Posted by brewbuck: Reimplementing a large system in another language to get a 25% performance boost is nonsense. It would be cheaper to just get a computer which is 25% faster. |
| Mario F. is online now | |
| | #4 |
| Registered User Join Date: Oct 2006 Location: UK/Norway
Posts: 469
| Is the difference between the two something programmers have to think about, or is it all done by the compiler? How can I convert between small and big? Found a few code examples of how to do it, but now `mathematical formula` |
| h3ro is offline | |
| | #5 |
| (?<!re)tired Join Date: May 2006 Location: Portugal
Posts: 5,650
| You will have to worry about endianness if you are programming low level data communications between different systems, for instance, where you don't know or expect endianness to be different among them (this is basically anything network related these days). Or using libraries that warn you about their lack of support for endianness. As for converting, information is all over the web.
__________________ Originally Posted by brewbuck: Reimplementing a large system in another language to get a 25% performance boost is nonsense. It would be cheaper to just get a computer which is 25% faster. |
| Mario F. is online now | |
| | #6 |
| Registered User Join Date: Oct 2001
Posts: 2,110
| Just to clarify, x86 uses little endian. |
| robwhit is offline | |
![]() |
| Thread Tools | |
| Display Modes | |
|
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Alice.... | Lurker | General Discussions | 16 | 06-20-2005 02:51 PM |
| Debugging question | o_0 | C Programming | 9 | 10-10-2004 05:51 PM |
| Question about pointers #2 | maxhavoc | C++ Programming | 28 | 06-21-2004 12:52 PM |
| Question... | TechWins | A Brief History of Cprogramming.com | 16 | 07-28-2003 09:47 PM |
| Question, question! | oskilian | A Brief History of Cprogramming.com | 5 | 12-24-2001 01:47 AM |