Differences between version 15 and previous revision of BigEndian.
Other diffs: Previous Major Revision, Previous Author, or view the Annotated Edit History
Newer page: | version 15 | Last edited on Saturday, September 19, 2009 11:29:58 pm | by LawrenceDoliveiro | Revert |
Older page: | version 14 | Last edited on Saturday, March 19, 2005 11:08:48 am | by AristotlePagaltzis | Revert |
@@ -1,3 +1,12 @@
Opposite of LittleEndian.
See [Endianness].
+
+Odd fact: even on big-endian CPUs, registers are still little-endian. To see this, consider the following pseudo-AssemblyLanguage sequence:
+
+* move two-byte integer from ''A'' to ''X''
+* move one-byte integer from ''X'' to ''B''
+
+Question: will the byte at ''B'' end up containing the high byte or the low byte of ''A''?
+
+In little-endian architectures, the answer is always “the low byte”. However, in big-endian architectures, the answer depends on whether ''X'' is a memory location or a register; if it’s a memory location, then ''B'' gets the high byte. Otherwise, it gets the low byte.