x86-64 registers are 64 bits, but only 48 address bits are wired (256TB is plenty), which leaves a question: what may the top 16 bits be? The answer is the canonical rule: bits 48–63 must be a copy of bit 47 — a sign extension of the used address into the unused top. Any other pattern is a non-canonical address and faults. It is sign extension (dart 476) promoted to a hardware invariant on pointers, and it reserves the unused bits so a future chip can widen to 56 or 64 without breaking today’s software. Here it is modeled at 8-of-16 bits to fit the compiler’s exact-integer range.
The demo checks the canonical rule (modeled 8-of-16): the high half must equal the sign of the low half — 0xFF80 passes, 0x7F80 faults: live demo
“A 64-bit pointer can hold any 64-bit value.” — only canonical ones; the top bits must sign-extend bit 47 or the CPU faults. cited
The unused top bits pinned to the sign of the used ones — sign extension turned into a law on addresses. invariant
On the canonical compiler (modeled 8-of-16 bits), 0xFF80 is canonical (high = sign of low), 0x7F80 is not: