Skip to content

feat(db,emitter,tui,cg,analyzer): resolve jump-vector _LVO equates and preserve biased EAPCIndex code cells - #9

Merged
mikolas merged 1 commit into
masterfrom
feat/lvo-jump-vector-resolution
Oct 30, 2026
Merged

mikolas merged 1 commit into
masterfrom
feat/lvo-jump-vector-resolution

Conversation

@mikolas

@mikolas mikolas commented Oct 30, 2026

Copy link
Copy Markdown
Owner

Summary

  • Automatic _LVO_<Target> Jump-Vector Offset Resolution:
    • Adds BuildJumpVectorLVOMap, FormatVectoredOpStr, and SortedJumpVectorSlots in internal/db/controller.go to resolve non-zero disp(aN) jump-vector calls/jumps (jsr/jmp) to symbolic _LVO_<Target>(aN) operands dynamically from DetectJumpVectorBases + GetLabelsMap (zero DB schema or project.json changes).
    • Enforces a disp == 0 parity guard so 2-byte jsr (a5) (EAAddrInd) is never promoted to 4-byte EADisp16.
    • Handles duplicate target slots via a 2-pass disambiguator (consulting user-renamed trampoline slot labels first, with _LVO_<Target>_<HexDisp> fallback).
    • Emits sorted ; --- Jump Vector (_LVO) Equates --- blocks in src/equates.i (--amiga) and single-file output, and formats vectored operands across all 5 surfaces: Emitter (src/*.asm), TUI listing & x XRefs popup, Call Graph (hunks cg), hunks disasm, and hunks search.
  • Biased d8(PC,Xn) (EAPCIndex) Interior-Label Code Preservation:
    • Excludes biased m68k.EAPCIndex base addresses from dataReadTargets in stage2DiscoverCode (RefDataRead).
    • Scopes Step 6 interior-label CODE cell invalidation in stage2DiscoverCode to HUNK_RELOC32 targets (a.RelocTargets), preserving valid instructions (such as hunk6:0x0BF4 bra.w Combat_SpawnLaserHitSmokePuff) whose extension words serve as biased d8(PC,Xn) index base labels, and emits interior equ definitions in internal/emitter/emitter.go.
  • Multi-Element Data Cell & Batch Hint Cleanup Fixes:
    • Fixes multi-element CellDataB/CellDataW/CellDataL formatting (cell.Size > 1) in internal/emitter/emitter.go and cmd/hunks/agent_cmds.go.
    • Wraps pre-analysis cell cleanup (DeleteCellsInRange, ClearOverlaps, DeleteLabelsInRange) inside ctrl.WithActiveSeg(segName, ...) in applyCodeHintsBatch.

Verification

  • go build ./..., go vet ./..., and go test -v ./... pass with 0 warnings.
  • Verified 100% bit-for-bit vasmm68k_mot + scripts/verify_parity.py load-image parity against frontier.

…d preserve biased EAPCIndex code cells

- Add BuildJumpVectorLVOMap, FormatVectoredOpStr, and SortedJumpVectorSlots in internal/db to resolve non-zero disp(aN) jump-vector calls/jumps to _LVO_<Target> equates (with duplicate-target disambiguation and disp==0 EAAddrInd parity guard).
- Emit _LVO_<Target> equ  blocks in src/equates.i (and single-file header) and format vectored operands across emitter, TUI listing/XRefs, call graph (cg), hunks disasm, and hunks search.
- Fix multi-element CellDataB/CellDataW/CellDataL emission in emitter and CLI disasm/search.
- Scope Step 6 interior-label CODE cell invalidation in stage2DiscoverCode to HUNK_RELOC32 targets and exclude biased d8(PC,Xn) (EAPCIndex) base addresses from dataReadTargets so instructions containing biased index base labels (e.g. hunk6:0x0BF4) are preserved and emit interior equ definitions.
- Wrap pre-analysis cell cleanup in applyCodeHintsBatch inside ctrl.WithActiveSeg.
@mikolas
mikolas merged commit 90a1da9 into master Oct 30, 2026
8 checks passed
@mikolas
mikolas deleted the feat/lvo-jump-vector-resolution branch October 30, 2026 17:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant