Here are some examples showing how to access different
pieces of data using the macros introduced so far.
Mixed-endian accesses
This code is written to be portable. It accesses little_data (i.e. data that's known to be stored in little-endian format, perhaps as a result of some on-media storage scheme), and then
manipulates it, writing the data back. This illustrates that the ENDIAN_*() macros are bidirectional.
Accessing hardware with dual-ported memory
Hardware devices with dual-ported memory may "pack" their respective fields on nonaligned boundaries. For example, if we had a piece of hardware with the following layout, we'd
have a problem: