Skip to content

More80#24970

Merged
trufae merged 20 commits intomasterfrom
more80
Dec 2, 2025
Merged

More80#24970
trufae merged 20 commits intomasterfrom
more80

Conversation

@trufae
Copy link
Collaborator

@trufae trufae commented Dec 2, 2025

  • Mark this if you consider it ready to merge
  • I've added tests (optional)
  • I wrote some lines in the book (optional)

Description

Copilot AI review requested due to automatic review settings December 2, 2025 12:18
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR refactors the Z80 architecture plugin by splitting monolithic code into separate, more maintainable modules. The main changes include extracting assembly and disassembly logic into dedicated files, updating pseudo-code generation to use a rule-based system, modernizing type definitions, and improving code organization.

Key Changes

  • Separated Z80 assembler logic into z80asm.c and disassembler logic into z80dis.c
  • Refactored pseudo-code generation from string manipulation to a declarative rule-based system
  • Modernized type definitions from radare2-specific types (ut8) to standard C types (uint8_t)

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
libr/arch/p/z80/z80dis.h New header file declaring disassembler API functions
libr/arch/p/z80/z80dis.c New file containing extracted Z80 disassembly logic
libr/arch/p/z80/z80asm.h Updated header with PluginData structure definition and assembler API
libr/arch/p/z80/z80asm.c New file containing extracted Z80 assembly logic with 2189 lines
libr/arch/p/z80/z80_tab.h Changed function signatures to use standard C types and inline keyword
libr/arch/p/z80/pseudo.c Completely refactored to use rule-based pseudo-code transformation
libr/arch/p/z80/plugin.c Refactored to remove duplicate code and use new modular structure
libr/arch/p/z80.mk Updated build rules to include new source files
libr/arch/meson.build Updated meson build to include new source files

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review for a chance to win a $100 gift card. Take the survey.

Comment on lines +1702 to +1703
wrtb (pd->indexed);
wrtb (0x7E);
Copy link

Copilot AI Dec 2, 2025

Choose a reason for hiding this comment

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

Incorrect opcode 0x4E for indexed load into register A. For LD A,(IX+n) or LD A,(IY+n), the correct opcode should be 0x7E, not 0x4E. The opcode 0x4E is used for LD C,(IX+n) or LD C,(IY+n). This will generate incorrect machine code.

Copilot uses AI. Check for mistakes.
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@copilot open a new pull request to apply changes based on this feedback

Copy link
Contributor

Copilot AI commented Dec 2, 2025

@trufae I've opened a new pull request, #24971, to work on those changes. Once the pull request is ready, I'll request review from you.

@trufae trufae merged commit f528137 into master Dec 2, 2025
43 of 44 checks passed
@trufae trufae deleted the more80 branch December 11, 2025 19:38
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.

4 participants