# m2comp step 7 — backend listing (tag: `m2comp-step7`) `MGen.DumpImage` prints the assembled image to StdOut after every successful emit: global layout per scope (name/slot/size), the procedure table (number/address/depth), then disassembled code with resolved labels. Unknown bytes degrade to `DB` (never fail). A full sweep over all test sources shows zero unknowns. Suite 65/65 (61 inherited + 4 listing checks). ## What was built - `src/MGen.def/.mod`: `DumpImage` + helpers (`WrS/WrI/WrHex2/ WrHexQ/WrOp/OpLen/LabelAt`). Instruction sizes: 1, 2 (u8/ext), 9 (immW/jp/jpfalse); `imm0..15`, signed local slots, `loadParam` for `03H..07H`; jumps resolve to `L` (else `+rel`); `immW` payloads as 16 hex digits. - Driver (`compiler.frm`): `DumpImage` after a successful `EmitModule` (listings already written, verdict last). - `run_tests.sh`: `expect_code` (compile + grep backend listing): `realCmp` in `r_real` (listing-level guard for the step-5.2 D5 fix), proc-table entry in `r_proc`, `jpfalse` in `t_case`, `storeIndir0` in `t_with`. ## Bugs found (all fixed, all covered) - `immW` printed 32 hex digits (nibble helper already emits two chars each — dropped the manual split). - `84H/85H` leaves take a u8 param count (undocumented in the local table); missing size broke alignment and swallowed a label. Same class of latent defect the listing exists to catch. ## Harness findings (multi-file listings) - Definition and implementation share one `.LST` basename, so the committed listing is whichever unit compiles last; ad-hoc single-file compiles leave stale content behind. Canonical state = one full suite run (each session's last writer wins). - The "second program" rejection first compiled `d_basic` twice in one process (duplicate errors, never reaching the driver gate). It now uses a dedicated empty `tests/d_second.mod`, so both programs parse clean and the driver's program-last gate fires with clean listings on both sides. ## Limits - No source-line mapping (AST nodes carry no positions — needs grammar + AST + backend work; future step). - Listing goes to StdOut only (one emit per run, after the per-file dumps).