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

SIGN EXTENSION widen a number, keep its value — the primitive under every word-size step

Every permutation to a wider word needs one operation: move a narrow value into a wide register without changing what it means. For a signed number that is sign extension — copy the sign bit into all the new high bits. The byte 0x80 is −128 as a signed 8-bit value; widened to 16 bits it must become 0xFF80, still −128, not 0x0080 = 128. It is the MOVSX instruction, the cast in every language, and the quiet primitive that makes 8→16→32→64 a value-preserving map rather than a reinterpretation. The load-bearing detail of the whole lineage.

THE TECHNIQUE copy the sign bit into the new high bits — value preserved (MOVSX)

The demo sign-extends 0x80 (−128) from 8 to 16 bits → 0xFF80 (still −128), while a positive value just zero-fills: live demo


HISTORY & CREDIT sign extension · MOVSX

“Widening a number just adds zeros.” — for signed values you copy the sign bit, or −1 becomes 255. cited

the rule · fill the new high bits with the sign bit — 0x80 → 0xFF80, both −128.
the contrast · zero extension (dart 477) fills with zeros — correct only for unsigned.
everywhere · MOVSX, the integer cast, the value-preserving step of every widening.

A narrow value moved into a wide register with its meaning intact — the primitive that makes the word-size ladder a map, not a lie. width

RECOMMEND FOR I-13 the value-preserving widen, on the compiler

On the canonical compiler, sign-extending 0x80 to 16 bits gives 0xFF80 (65408, = −128); a positive 100 stays 100:

$ i13 run ln_signextension.i13 # copy the sign bit RUN OK · 49 step(s) · peak stack 3 · call depth 1 neg = 65408 -- 0x80 -> 0xFF80, still -128 pos = 100 -- 0x64 -> 0x0064, unchanged preserves = 1
Recommend as a keeper shot — the one dart here with real structural pull. Sign extension is a value-preserving map between representations of different width — and one could argue it “carries” the value across a resolution change. But under the criterion it is a representation/encoding operation (B44): the value is bit-fixed, and widening is a coordinate change, not an orthogonal channel two same-function mechanisms differ on. My read: NULL by B44. Still, it is the load-bearing primitive of the whole lineage, so it goes to the panel as the batch’s honest shot.