# CS617 chapter01-u32calc - r002 handoff

STATUS: SOURCE-ONLY CANDIDATE; HD61 and runtime validation PENDING.
TARGET: Casio PB-2000C only. Do not claim AI-1000 compatibility.
SOURCE: src/apps/u32calc/u32calc_r002.s
SOURCE_SHA256: 7370841cb9a620ad2e449978f7e60983c03573b3db77d3c2aa82fa43866405c2
BASELINE: r001 source SHA-256 13788f0e55b332dcaf25e22bc3eb713f9f25e221897bee618ed293b23dd6c677
BASELINE_ROM_SHA256: 591306731f227d8f5d2a526be030f51fd21507aa923699196442818ca775e8c2
ROM_ID: 34 10 at both 0008-0009 and 0DB9-0DBA (unchanged).

## Purpose and exact change

After Alex's successful r001 report, Alex and Sol agreed that chapter 01
is a **menu-less** calculator. The r001 MENU screen contained FK1 and EXE
for exactly the same action and added no functionality. That was an
unrequested enhancement. r002 repairs this by:

- Deleting the r001 MENU_ENTRY/MENU_LOOP/MENU_RELEASE/MENU_START shell.
- Removing SHOW_MENU and its three unused ROM strings.
- Treating translated MENU (`9Ch`) as a **no-op**, passing into the existing
  key-release loop. No redisplay, cold init, navigation, or arithmetic dispatch.
- Updating the visible splash `version r001` to `version r002`.

Nothing else is deliberately modified: all numeric includes are unchanged;
CARD_BOOT, APP_ENTRY, BRK handling, provisional identity, TM-based timed
splash, arithmetic, cursor/keyboard behavior are retained. Source code
addresses may move because menu code and data have been removed. Historical
D4 remains frozen, and r001's exact source/listing/ROM and observations remain
preserved. No runtime claims are transferred automatically to r002.

## Alex - assemble (no edits to src/)

1. Assemble `src/apps/u32calc/u32calc_r002.s` with HD61700 ASSEMBLER Rev. 0.45,
   preserving all `../../lib/*.inc` relative includes (invoke from the source's
   directory as for r001). Do not modify `src/`.
2. Place **exact** returned `u32calc_r002.bin`, `u32calc_r002.lst`, any assembler
   messages and observations in your `build/apps/u32calc/` (Alex-owned).
   Do not overwrite the r001 files. Stop and return the error listing if
   assembly fails.
3. Optional read-only check from chapter root:
   `python src/test/verify_u32calc_r002.py --rom build/apps/u32calc/u32calc_r002.bin --lst build/apps/u32calc/u32calc_r002.lst`

## Focused regression test

1. Fresh PB-2000C card boot: `Xandrian Labs`, `CS617 U32 CALC`,
   `version r002`; automatic timed transition without EXE. Note actual timing.
2. Type `12345` as the first operand. Press **MENU**; no menu screen should
   appear, and the operand/display should remain. Release MENU; type `6`;
   observe the expected continued operand `123456`.
3. Press **BRK** with a partially entered operand. Warm entry must return to
   the calculator, preserve its meaningful state and **not** replay splash.
4. Spot-check unchanged arithmetic, e.g. `7 / 2 = 3`, `7 % 3 = 1`
   (red S then `]`), and `0 - 1 = 4294967295`. Test MENU after a result.
5. Confirm there is no accidental artificial menu or CAL mode. Physical
   CAL key remains unimplemented, not repurposed.
6. If practical, card-switch and return test separately; do not equate a
   recognized header with a proven RAM-ownership lifecycle.

Report the exact environment (emulator or hardware), and any observed
failure. BRK success from r001 is important evidence but not a substitute
for testing r002. Sol reads build/; only Alex writes there.

## Engineering lesson

Never add an optional enhancement to a proven application just because it
looks consistent with a generic methodology. Proposed new features require
explicit joint scope agreement. Alex's experience attributes roughly 30% of
his observed regressions to well-intended 'improvements'; this is his
engineering observation, not a universal measured rate. Preserve functioning
checkpoints, make the smallest change, and re-test.
