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

Z80 idea: get rid of instruction start lookup table #97

Open
floooh opened this issue May 1, 2024 · 1 comment
Open

Z80 idea: get rid of instruction start lookup table #97

floooh opened this issue May 1, 2024 · 1 comment
Assignees

Comments

@floooh
Copy link
Owner

floooh commented May 1, 2024

...each instruction payload starts the case step of its own opcode (with offset for ED and CB prefixes), so case steps 0..767 are occupied by the first payload clock cycle.

Each case step explicitly writes the next step (instead of step++).

Instructions that are longer than M1 put their additional case blocks starting at 768.

The remaining special case cycle blocks are grouped at the end.

This gets rid of the indirection 'optables' but results in a switch-case that's just as compact as now.

@floooh floooh self-assigned this May 1, 2024
@floooh
Copy link
Owner Author

floooh commented Jun 29, 2024

The idea is implemented here in Zig, with a backport to the C version planned:

https://github.com/floooh/chipz

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

No branches or pull requests

1 participant