Penguin

Differences between version 16 and predecessor to the previous major change of BigEndian.

Other diffs: Previous Revision, Previous Author, or view the Annotated Edit History

Newer page: version 16 Last edited on Sunday, September 20, 2009 2:07:04 am by AristotlePagaltzis Revert
Older page: version 14 Last edited on Saturday, March 19, 2005 11:08:48 am by AristotlePagaltzis Revert
@@ -1,3 +1,14 @@
 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.