Add the scalar instruction emitter in src/compiler/codegen.s and the
provisional arithmetic helpers in src/runtime/arithmetic.s. The emitter
writes documented 6502 instructions into a bounded code buffer, supports
absolute loads/stores and arithmetic operands, immediates, calls, forward
branches with checked fixups, and returns the byte length for golden tests.
The x128 fixture drives the emitter directly (parser integration is E04-S04) to build representative byte, word, integer, boolean, comparison, assignment, and short-circuit shapes, copies the golden byte stream, and executes it. It also calls the multiply/divide helpers, including unsigned and signed division, and verifies that division by zero sets a stable fault result.
src/compiler/codegen.s (new), src/runtime/arithmetic.s (new)src/common/codegen.inc, src/common/arithmetic.inc (new)tests/codegen/scalar-test.stests/codegen/scalar.expected.dis, tests/codegen/scalar.expected.hexscripts/build-scalar-test.ps1, scripts/verify-scalar-test.ps1docs/decisions.md, docs/architecture.mdplanning/claims/E04-S03.mdbuild/$5A, $0E, $2221, $ECBB.and/or avoids evaluating the unused operand: both
shapes leave V_EVAL=0 while producing the correct V_FLAG.ar_div_u16
returns C=1, sets ar_fault=AR_FAULT_DIV0, and stores a zero result.tests/codegen/scalar.expected.hex and .dis; the verifier compares both.done; this story adds the scalar backend primitives but does not
integrate them into the parser/control-flow shell.AR_FAULT_DIV0 value until
E04-S05 freezes the R-code namespace.$A000. Generated code is executed directly in that buffer.cg_* byte emitters, absolute operand forms, forward branch fixups,
and a 256-byte bounded buffer.#>addr+1 became
(>addr)+1, so high-byte operands pointed at $1Cxx instead of $1Bxx.
Parenthesized #<(addr)/#>(addr) fixed word high bytes and the apparent
OR-tail misalignment.$5A is $005A, and the short-
circuit cases now set their left operands explicitly.scripts/build-scalar-test.ps1scripts/verify-scalar-test.ps1 -Port 6530scripts/verify-output-test.ps1 -Port 6530 -RunPort 6531scripts/verify-frame-test.ps1 -Port 6530scripts/verify-diag-test.ps1 -Port 6530scripts/verify-parser-test.ps1 -Port 6530git diff --check5A 0E 21 22 BB EC E0 01;
golden 231 bytes; canonical disassembly and hex match committed files.src/compiler/codegen.s, src/runtime/arithmetic.s,
src/common/codegen.inc, src/common/arithmetic.inc,
tests/codegen/scalar-test.s, golden expectations,
scripts/build-scalar-test.ps1, scripts/verify-scalar-test.ps1,
docs/decisions.md, docs/architecture.md, this claim.Powered by TurnKey Linux.