Conversation
There was a problem hiding this comment.
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.cand disassembler logic intoz80dis.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.
| wrtb (pd->indexed); | ||
| wrtb (0x7E); |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
@copilot open a new pull request to apply changes based on this feedback
Description