How is Big/Little Endian stored again? ====================================== [ 0x00 ] Bits: -------------- Big Endian byte: [ 128 ][ 64 ][ 32 ][ 16 ][ 8 ][ 4 ][ 2 ][ 1 ] Little Endian byte: [ 1 ][ 2 ][ 4 ][ 8 ][ 16 ][ 32 ][ 64 ][ 128 ] NOTE: Most (if not all) mainstream computer architectires have a Big Endian bit order! x86 for example has a Big Endian bit order, but Little Endian byte order. [ 0x01 ] Bytes: --------------- Big Endian 2 byte integer: [ 32768 ][ 16384 ][ 8192 ][ 4096 ][ 2048 ][ 1024 ][ 512 ][ 256 ] [ 128 ][ 64 ][ 32 ][ 16 ][ 8 ][ 4 ][ 2 ][ 1 ] Little Endian 2 byte integer: [ 128 ][ 64 ][ 32 ][ 16 ][ 8 ][ 4 ][ 2 ][ 1 ] [ 32768 ][ 16384 ][ 8192 ][ 4096 ][ 2048 ][ 1024 ][ 512 ][ 256 ] Big Endian -> MSB has the lowest address (char a; char b; short int c) + bottom of stack, top of memory 0xFF (a) | [ 128 ][ 64 ][ 32 ][ 16 ][ 8 ][ 4 ][ 2 ][ 1 ] 0xFE (b) | [ 128 ][ 64 ][ 32 ][ 16 ][ 8 ][ 4 ][ 2 ][ 1 ] 0xFD (c) | [ 128 ][ 64 ][ 32 ][ 16 ][ 8 ][ 4 ][ 2 ][ 1 ] 0xFC (c) | [ 32768 ][ 16384 ][ 8192 ][ 4096 ][ 2048 ][ 1024 ][ 512 ][ 256 ] V top of stack, bottom of memory Little Endian -> LSB has the lowest address (char a; char b; short int c) + bottom of stack, top of memory 0xFF (a) | [ 128 ][ 64 ][ 32 ][ 16 ][ 8 ][ 4 ][ 2 ][ 1 ] 0xFE (b) | [ 128 ][ 64 ][ 32 ][ 16 ][ 8 ][ 4 ][ 2 ][ 1 ] 0xFD (c) | [ 32768 ][ 16384 ][ 8192 ][ 4096 ][ 2048 ][ 1024 ][ 512 ][ 256 ] 0xFC (c) | [ 128 ][ 64 ][ 32 ][ 16 ][ 8 ][ 4 ][ 2 ][ 1 ] V top of stack, bottom of memory