Split-Personality Link

Signals & Audio

One program, two code-generation personalities: native A16 arithmetic calls forced-default A8 byte code and returns through the shared ABI.

loading core…

Self-running — verified CRC 83B7.

Click the screen, then play. (Tab away and it pauses.)

The boundary under test

Every earlier native-width ROM selected one target feature set for its whole translation unit. This probe uses Clang's per-function target attribute to put native A16 and forced-default A8 functions in the same link, then calls across the boundary in both directions.

Native side: target("mos-a16") produces real rep #$20 / sep #$20 brackets.

Byte side: target("no-mos-a16,no-mos-xy16") remains transition-free A8 code even in globally native comparison builds.

Result: host, default, a16, and xy16 all return 0x83B7. No compiler defect was found.

What the gate does

A 192-step call-ping-pong chain alternates 16-bit rotate/add/XOR work with byte-lane mixing. Every result is folded into the browser-verified CRC. The compiler gate also inspects IR target features and machine code, so a silently ignored attribute cannot pass.

Compiler stress-test #126, Round 7. Source and full test record live in llvm-mos-65816.