Skip to content

Fix m680x instruction mappings#6609

Open
historicattle wants to merge 1 commit into
rizinorg:devfrom
historicattle:m680x
Open

Fix m680x instruction mappings#6609
historicattle wants to merge 1 commit into
rizinorg:devfrom
historicattle:m680x

Conversation

@historicattle

@historicattle historicattle commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Your checklist for this pull request

  • I've read the guidelines for contributing to this repository.
  • I made sure to follow the project's coding style.
  • I've documented every RZ_API function and struct this PR changes.
  • I've added tests that prove my changes are effective (required for changes to RZ_API).
  • I've updated the Rizin book with the relevant information (if needed).
  • I've used AI tools to generate fully or partially these code changes and I'm sure the changes are not copyrighted by somebody else.

Detailed description

  • Fix m680x instruction mappings
  • Make the CPU mode checks case insensitive
  • Fixed m680xmode() to correctly return CS_MODE_M680X_HCS12X instead of returning RZ_CAPSTONE_HAS_M680X_HCS12X

Test plan
Updated the test in test/db/analysis/m680x since M680X_INS_JSR is correctly classified as a RZ_ANALYSIS_OP_TYPE_CALL

Closing issues
Partially addresses #5933

Make the CPU mode checks case insensitive
@codecov

codecov Bot commented Jul 7, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 38.53211% with 67 lines in your changes missing coverage. Please review.
✅ Project coverage is 49.93%. Comparing base (6f2989f) to head (8418b0e).

Files with missing lines Patch % Lines
librz/arch/p/analysis/analysis_m680x_cs.c 39.42% 51 Missing and 12 partials ⚠️
librz/arch/p/asm/asm_m680x_cs.c 20.00% 0 Missing and 4 partials ⚠️
Additional details and impacted files
Files with missing lines Coverage Δ
librz/arch/p/asm/asm_m680x_cs.c 46.55% <20.00%> (ø)
librz/arch/p/analysis/analysis_m680x_cs.c 47.95% <39.42%> (+2.50%) ⬆️

... and 9 files with indirect coverage changes


Continue to review full report in Codecov by Harness.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6f2989f...8418b0e. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@historicattle historicattle marked this pull request as ready for review July 7, 2026 12:42
@historicattle

Copy link
Copy Markdown
Contributor Author

@wargio @Rot127 could you take a look at this

} else if (str && strstr(str, "68HC08")) {
} else if (rz_str_casestr(str, "68hc08")) {
return CS_MODE_M680X_6808;
} else if (str && strstr(str, "6809")) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

extract this function and move it into arch_m680x_cs.c

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants