WWW-www.enlightenment.org pushed a commit to branch master.


commit 5d37fa32552ac582783f15c3324c8a9a295bac16
Author: Raster <ras...@rasterman.com>
Date:   Sun Jun 21 23:51:29 2015 -0700

    Wiki page start changed with summary [] by Raster
 pages/docs/c/start.txt | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/pages/docs/c/start.txt b/pages/docs/c/start.txt
index 0e35c45..1e1e80f 100644
--- a/pages/docs/c/start.txt
+++ b/pages/docs/c/start.txt
@@ -596,6 +596,25 @@ A good 
[[http://man7.org/linux/man-pages/man2/syscalls.2.html|list of system cal
 ==== Endianess ====
+Memory is really a sequence of bytes from the view of a CPU, but when you 
access data types like ''short''s or ''int''s etc. that consume multiple bytes, 
the order that they are read from in memory and assigned to slots from the LSB 
(Least Significant Byte) to the MSB (Most Significant byte). There are 2 
commonly referred to ways of accessing these bytes in multi-byte types, called 
**Big Endian** and **Little Endian**. 
[[http://en.wikipedia.org/wiki/Endianness|Endianess]] these days is m [...]
+^Architecture ^Endianess ^
+^x86          |Little    |
+|x86_64       |Little    |
+|ARM          |Little    |
+|PowerPC      |Big       |
+|MIPS         |Big       |
+|SPARC        |Big       |
+|Alpha        |Big       |
+That means that the majority of people will find themselves programming for a 
little endian environment. This does not mean you can assume it everywhere. 
Many file formats store data in a big endian fashion, as do many network 
protocols, so when you deal with memory and have to save and load it or 
transmit it across a network, you need to be very careful about endianess and 
have to convert as necessary. Also be aware that alignment also matters.
+In memory, in order from lowest memory address to highest, endianess looks as 
follows for an 4 byte ''int'' type:
+^Decimal    ^Hex          ^Big endian               ^Little endian            ^
+|1393589900 |''53107e8c'' |''53''''10''''7e''''8c'' |''8c''''7e''''10''''53'' |
 ==== Function pointers ====
 ==== Callbacks ====
 ==== Threads ====


Reply via email to