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

v4 #21

Merged
merged 12 commits into from
Feb 7, 2024
Merged

v4 #21

merged 12 commits into from
Feb 7, 2024

Conversation

rzumer
Copy link
Owner

@rzumer rzumer commented Feb 7, 2024

  • Update dependencies and their usage
  • Clean up some minor warnings and comments
  • Add some interfaces and re-exports
  • Remove some interfaces and re-exports
  • Distinguish displacement operands from non-displacement operands in DecodingState

Bonus: hopefully gets rid of the spooky security warning on GitHub.

It doesn't do anything different from Default.
- Exposes InstructionDecoder, DecodingState, and Instruction
at the top level of the crate
- Removes top-level visibility for register data structures
- Removes public visibility for the decoder module

The goal is to make imports self-documenting by encouraging verbosity,
while keeping the most important structures accessible at the top level.
For example, it is not obvious that a dez80::Condition relates to
a conditional instruction rather than something related to the decoder,
whereas importing dez80::Instruction::Condition makes the association
clearer.
Displacement operands affect behavior significantly,
so in a progressive decoding scenario it is useful to
distinguish between displacement and non-displacement
operands.

Without distinct DecodingState variants or another
signaling mechanism, it is not always possible to detect
a displacement operand with limited context of the
decoder's state, because indexed instruction tables
include some instructions with only non-displacement
operands, as well as both types of operands.

While disambiguation is only strictly necessary for
indexed instructions, for consistency this also replaces
the IndexedBitwiseOperand variant with
IndexedBitwiseDisplacement, since all bitwise indexed
instructions have a displacement as their only operand,
as well as RootDisplacement, used in relative jumps.
This includes updates to CLI parsing syntax.
@rzumer rzumer merged commit 3b6292b into master Feb 7, 2024
2 checks passed
@rzumer rzumer deleted the v4 branch February 7, 2024 06:08
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