Skip to content

Fix MOVS Instruction#18

Merged
lmSeryi merged 1 commit into
masterfrom
feat/movs
Feb 9, 2026
Merged

Fix MOVS Instruction#18
lmSeryi merged 1 commit into
masterfrom
feat/movs

Conversation

@begeistert

Copy link
Copy Markdown
Collaborator

Description

  • Use a local rd variable when decoding MOV immediate to avoid duplicating the bit extraction expression and clarify intent.
  • Set the negative (N) flag based on the signed interpretation of the loaded value instead of always clearing it.
  • Add unit tests covering MOV behavior:
    • writes to SP clear the lower two bits
    • writes to PC clear the least significant bit
    • register-to-register moves for positive and negative values

Type of change

  • 🐛 Bug fix (non-breaking change which fixes an issue)

Checklist

  • 🧪 Tests passed locally (dotnet test)
  • ✅ Added new tests for this feature/fix
  • 📝 Documentation updated (if applicable)
  • 🚫 No "Magic Strings" or hardcoded values
  • 💾 Validated against the RP2040 Datasheet (if applicable)

Screenshots / Hex Dumps (Optional)

Use a local rd variable when decoding MOV immediate to avoid
duplicating the bit extraction expression and to clarify intent.
Set the negative (N) flag based on the signed interpretation of the
loaded value instead of always clearing it.

Add unit tests covering:
- writes to SP clear the lower two bits
- writes to PC clear the least significant bit
- register-to-register moves for positive and negative values

These tests increase coverage for MOV behavior and verify flag
and special-register handling.
@begeistert
begeistert requested a review from lmSeryi as a code owner February 2, 2026 08:57
@sonarqubecloud

sonarqubecloud Bot commented Feb 2, 2026

Copy link
Copy Markdown

@begeistert begeistert changed the title fix(mov): use rd variable and set N flag correctly; add MOV tests Fix MOVS Instruction Feb 2, 2026
@begeistert begeistert self-assigned this Feb 2, 2026
@lmSeryi
lmSeryi merged commit cb09e94 into master Feb 9, 2026
2 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