Skip to content

Fix/disasm: more inline evaluators (LDS, LES, LEA, CALL FAR)#2094

Merged
maximilien-noal merged 4 commits intomasterfrom
fix/disasm_more_inline_evaluators_lea
Apr 19, 2026
Merged

Fix/disasm: more inline evaluators (LDS, LES, LEA, CALL FAR)#2094
maximilien-noal merged 4 commits intomasterfrom
fix/disasm_more_inline_evaluators_lea

Conversation

@maximilien-noal
Copy link
Copy Markdown
Member

@maximilien-noal maximilien-noal commented Apr 19, 2026

Description of Changes

Fix gaps in the UI disasm expression evaluators for:

  • LDS,
  • LEA,
  • LES,
  • CALL FAR

Outside of LEA, changes are generic enough to fix more than those specific cases.

Before:
image

After:

image

Rationale behind Changes

Aid in reverse engineering

Suggested Testing Steps

Tested with manual tests. Covered by new UI integration tests which exercise the entire stack.

ExpressionEvaluationService now computes and displays the effective address for LEA instructions instead of reading memory contents. Added AddAddressValue and address expression builders for LEA. Introduced UI tests to verify correct LEA operand evaluation and prevent memory value display. Refactored RegisterToExpression for clarity.
@maximilien-noal maximilien-noal self-assigned this Apr 19, 2026
@maximilien-noal maximilien-noal added the UI UI work label Apr 19, 2026
Copilot AI review requested due to automatic review settings April 19, 2026 09:48
@maximilien-noal maximilien-noal added reverse engineering Related to reverse enginneering (features, APIs, ...) bugfix fixes a bug Debugger Related to the internal debugger or to the breakpoint framework labels Apr 19, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Improves the disassembly UI’s inline expression evaluation so that operand previews are correct for LEA (effective address vs. memory read) and for far-pointer memory operands used by LDS / CALL FAR.

Changes:

  • Add special-case operand formatting for LEA to show computed effective address rather than dereferenced memory.
  • Extend memory-size handling to support SegPtr16 (far pointers) as dword for evaluation/formatting.
  • Add new Avalonia UI integration tests covering LEA, LDS, and CALL FAR evaluator behavior.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 6 comments.

File Description
tests/Spice86.Tests/UI/ExpressionEvaluatorUITests.cs Adds UI integration tests for LEA, LDS, and CALL FAR operand evaluation/formatting.
src/Spice86/ViewModels/Services/ExpressionEvaluationService.cs Updates operand evaluation logic to compute address expressions for LEA and handle far-pointer (SegPtr16) memory operands.

Comment thread tests/Spice86.Tests/UI/ExpressionEvaluatorUITests.cs
Comment thread src/Spice86/ViewModels/Services/ExpressionEvaluationService.cs Outdated
Comment thread tests/Spice86.Tests/UI/ExpressionEvaluatorUITests.cs Outdated
Comment thread tests/Spice86.Tests/UI/ExpressionEvaluatorUITests.cs Outdated
Comment thread tests/Spice86.Tests/UI/ExpressionEvaluatorUITests.cs Outdated
Comment thread tests/Spice86.Tests/UI/ExpressionEvaluatorUITests.cs Outdated
@maximilien-noal maximilien-noal changed the title Fix/disasm more inline evaluators lea Fix/disasm more inline evaluators (LDS, LES, LEA, CALL FAR) Apr 19, 2026
@maximilien-noal maximilien-noal changed the title Fix/disasm more inline evaluators (LDS, LES, LEA, CALL FAR) Fix/disasm: more inline evaluators (LDS, LES, LEA, CALL FAR) Apr 19, 2026
@maximilien-noal
Copy link
Copy Markdown
Member Author

@copilot apply changes based on the comments in this thread

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 19, 2026

@copilot apply changes based on the comments in this thread

Done in f9e334a:

  • Removed unused Instruction instruction parameter from AddAddressValue and updated its call site
  • Replaced all non-ASCII characters (, ) with ASCII equivalents (->, -) throughout the test file
  • Replaced all null-forgiving operator (!) usages with the evaluated ?? [] pattern after the existing NotBeNullOrEmpty() assertion (covers lines 83, 122, 155, 190, 228, 265, 302, 339)

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • av-build-tel-api-v1.avaloniaui.net
    • Triggering command: /usr/share/dotnet/dotnet dotnet exec --runtimeconfig /home/REDACTED/.nuget/packages/avalonia.buildservices/11.3.2/tools/netstandard2.0/runtimeconfig.json /home/REDACTED/.nuget/packages/avalonia.buildservices/11.3.2/tools/netstandard2.0/Avalonia.BuildServices.Collector.dll (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

@maximilien-noal maximilien-noal merged commit 385f588 into master Apr 19, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix fixes a bug Debugger Related to the internal debugger or to the breakpoint framework reverse engineering Related to reverse enginneering (features, APIs, ...) UI UI work

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants