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

Illegal opcodes #17

Merged
merged 39 commits into from
Nov 10, 2023
Merged

Illegal opcodes #17

merged 39 commits into from
Nov 10, 2023

Conversation

dillydally414
Copy link
Collaborator

@dillydally414 dillydally414 commented Dec 20, 2022

Add unofficial opcodes, implementations taken from a few different sources:

Todo:

  • Check cycle counts
  • Resolve STP command
  • Add assembly script testing

src/execute.rs Outdated Show resolved Hide resolved
src/execute.rs Outdated
self.registers.sr.set_nz(self.registers.a);

Ok(cycles)
} /* @breqdev change to unreachable or entirely omit?
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@breqdev also hey ;)

Copy link
Owner

@breqdev breqdev Dec 20, 2022

Choose a reason for hiding this comment

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

Let's just remove this entirely, since we match all of the available opcodes!

Copy link
Owner

@breqdev breqdev left a comment

Choose a reason for hiding this comment

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

A few things to clear up, but overall looks pretty good!

We should probably get a test suite written that covers these instructions -- I tested my implementation for the official instructions with these functional tests I found, but it doesn't seem like there's an equivalent for the unofficial opcodes.

Writing unit tests for this is probably outside the scope of this PR, but a short assembly program that runs through each of these opcodes would be nice for reassurance. If you're feeling ambitious, you could totally give this a try; if not, I'm happy to take care of it.

src/execute.rs Outdated Show resolved Hide resolved
src/execute.rs Outdated Show resolved Hide resolved
src/execute.rs Outdated Show resolved Hide resolved
src/execute.rs Outdated Show resolved Hide resolved
src/execute.rs Outdated Show resolved Hide resolved
src/execute.rs Outdated Show resolved Hide resolved
src/execute.rs Outdated Show resolved Hide resolved
src/execute.rs Outdated
self.registers.sr.set_nz(self.registers.a);

Ok(cycles)
} /* @breqdev change to unreachable or entirely omit?
Copy link
Owner

@breqdev breqdev Dec 20, 2022

Choose a reason for hiding this comment

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

Let's just remove this entirely, since we match all of the available opcodes!

@codecov
Copy link

codecov bot commented Dec 29, 2022

Codecov Report

Attention: 182 lines in your changes are missing coverage. Please review.

Comparison is base (a13f7ce) 20.47% compared to head (f6242ed) 19.98%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #17      +/-   ##
==========================================
- Coverage   20.47%   19.98%   -0.50%     
==========================================
  Files          40       40              
  Lines        8517     8717     +200     
==========================================
- Hits         1744     1742       -2     
- Misses       6773     6975     +202     
Files Coverage Δ
src/cpu/fetch.rs 0.00% <ø> (ø)
src/cpu/execute.rs 0.00% <0.00%> (ø)

... and 2 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@breqdev breqdev self-requested a review November 10, 2023 02:55
@dillydally414
Copy link
Collaborator Author

👀

@breqdev breqdev marked this pull request as ready for review November 10, 2023 03:36
@breqdev breqdev merged commit 8366245 into main Nov 10, 2023
5 checks passed
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.

2 participants