chips icon indicating copy to clipboard operation
chips copied to clipboard

Z80 idea: get rid of instruction start lookup table

Open floooh opened this issue 1 year ago • 1 comments

...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 avatar May 01 '24 08:05 floooh

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

https://github.com/floooh/chipz

floooh avatar Jun 29 '24 09:06 floooh

Implemented in the C version too now.

floooh avatar Jan 07 '25 19:01 floooh