Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better internal opcode table #5

Open
2 of 4 tasks
x93bd0 opened this issue Jan 7, 2025 · 0 comments
Open
2 of 4 tasks

Better internal opcode table #5

x93bd0 opened this issue Jan 7, 2025 · 0 comments
Labels
enhancement New feature or request

Comments

@x93bd0
Copy link
Owner

x93bd0 commented Jan 7, 2025

Checklist

  • I believe this feature/suggestion would be benefitial and/or necessary to this project.
  • I have searched for the same request on the issue tracker.

What's your idea?

The MOS6502 has instructions that can be encoded better by compressing similar ones into "super" instructions. Those instructions can share one arm in the VM's match, making code execution faster and making the final binary more lightweight.

Must do:

  • The ADC and SBC instructions only differ by one operation (SBC negates the memory first, then it executes ADC), so they can be compacted as ADDER (not-a-mnemonic, PoC) with a flag that activates SBC.
  • All of the branch instructions can be compacted as BRANCH, because they have the same code, only differing in the check of the flag status, and the flag itself.

Why would this be necessary?

I believe this will improve performance.

@x93bd0 x93bd0 added the enhancement New feature or request label Jan 7, 2025
@x93bd0 x93bd0 mentioned this issue Jan 7, 2025
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant