[lug] A head scratcher for your weekend
BC
bcarr at purgatoire.org
Sat May 26 15:03:59 MDT 2018
Thank you for that explanation. Big/Little Endian has eluded me for
manyyears.
On 5/24/2018 6:29 PM, Zan Lynx wrote:
> On 5/24/2018 8:15 AM, Rob Nagler wrote:
>>
>> I hate little endian machines. They make no sense.
>
> Ah but they do. It took me a while to get it myself, but here is the
> trick.
>
> If you store the value 3 in big endian it looks like this in a hex
> dump:
> 00 00 00 03
>
> In little endian it looks like:
> 03 00 00 00
>
> The goodness of little endian comes in when you read the value using
> different width instructions. Because 03 00 00 00 is the same number
> at 16 bits 03 00 and 8 bits 03.
>
> While with big endian the pointer must be shifted over for different
> width access.
>
> If you're building a RISC system where absolutely every memory
> access is 32-bits or 64-bits and anything smaller is done with
> shift/mask, then big endian is OK. Otherwise it is annoying.
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lug.boulder.co.us/pipermail/lug/attachments/20180526/dbe9222f/attachment.html>
More information about the LUG
mailing list