It is a ridiculous feature of modern C that you have to write the super verbose "mask and shift" code, which then gets compiled to a simple `mov` and maybe a `bswap`. Wheras, the direct equivalent in C, an assignment with a (type changing) cast, is illegal. There is a huge mismatch between the assumptions of the C spec and actual machine code. One of the few reasons I ever even reached to C is the ability to slurp in…
> There is a huge mismatch between the assumptions of the C spec and actual machine code. People like to say „C is close to the metal“. Really not true at all anymore.
A language that does the same things regardless of endianness would not have pointer arithmetic. That is not ASM and not C.