◄ WORLD V · SONNY 5DART 480 · a helldive at the net

THE ENDIANNESS which byte comes first — the holy war a swap settles

When a word wider than a byte crosses a byte-addressed bus, someone must decide byte order. Little-endian (6502, x86) stores the low byte first; big-endian (68000, network protocols) the high byte first. The value 0x1234 is bytes 34 12 one way, 12 34 the other. Converting between them is a byte swap — and swapping twice returns the original, so the conversion is its own inverse. Danny Cohen named the split in 1980, borrowing Gulliver’s war over which end of an egg to crack: a difference with no technical winner, only a choice that must be agreed.

THE TECHNIQUE byte-swap converts little↔big; swapping twice = identity

The demo byte-swaps 0x1234 to 0x3412 and swaps again back to 0x1234 — the conversion is an involution: live demo


HISTORY & CREDIT Danny Cohen · 1980 (the term)

“There is a right byte order.” — there is only a chosen one; the two are related by a self-inverse swap. cited

the two orders · little-endian (6502/x86) low byte first; big-endian (68000/network) high first.
the swap · 0x1234 ↔ 0x3412 — and swapping twice restores the value (an involution).
1980 · Danny Cohen named it, after Gulliver’s Big- and Little-Endians.

A word’s bytes read either way round, converted by a swap that undoes itself — a war settled by an involution. self-inverse

RECOMMEND FOR I-13 the byte swap, on the compiler

On the canonical compiler, 0x1234 byte-swaps to 0x3412 (13330), and swapping again returns 0x1234:

$ i13 run ln_endianness.i13 # byte-swap 16-bit RUN OK · 41 step(s) · peak stack 3 · call depth 1 be = 13330 -- 0x1234 -> 0x3412 roundtrip = 4660 -- swap again -> 0x1234 swapped_and_back = 1
Recommend as a NULL by duplication. The byte swap is a self-inverse (swap twice = identity) — the seated axis 1 (CRC/Verlet), same as XCE and bit-reversal before it. Endianness itself is a representation/ordering choice (B44). NULL — a genuine involution, but a duplicate of a seated pillar, and a reminder that byte order is a convention, not a truth.