Reputation: 966
I think I understand at least the basics of endianness, but I can't understand the last sentence of this paragraph in my computer organization text. Can someone provide an example that illustrates the point being made here?
Computers divide into those that use the address of the leftmost or “big end” byte as the doubleword address versus those that use the rightmost or “little end” byte. LEGv8 can work either as big-endian or little-endian. Since the order matters only if you access the identical data both as a doubleword and as eight bytes, few need to be aware of the “endianness”.
I should point out that "LEGv8" is a subset of the ARMv8 instruction set.
Upvotes: 0
Views: 164
Reputation: 6608
For the first part consider how a processor accesses data from memory. It transfers memory contents to and from registers using some kind of load and store instruction combined with the length. You don't need to consider the endianness, you just instruct the processor to load, perform other operations and then store the result. The endianness is the same during a load and store when using the size of the data type so you don't care what it is.
Now consider you need to do something like send that same doubleword across a network or save to a file, examples of where you might need to access a doubleword as individual bytes. Maybe the other end of the network connection runs a different endianness. Maybe the file format specifies a certain endianness for interoperability. In this case you need to know the byte order so you can keep it correct.
Upvotes: 1