rzumer / dez80

A Z80 instruction decoding and (dis)assembly library.
MIT License
4 stars 1 forks source link

Support instruction (re-)assembly #4

Closed rzumer closed 5 years ago

rzumer commented 5 years ago

Instructions are now all defined and the model is specific enough that it is possible to losslessly re-assemble decoded (or manually generated) instructions. This could be useful for debugging or other use cases, so it is a feature worth adding.

Since the instruction module is getting very large, it might be a good idea to extract the decoder to its own module, and do the same with the encoder.

rzumer commented 5 years ago

Closed by https://github.com/rzumer/dez80/commit/4d6e917956aafc33690a4e859ac37bd44643c628.

This does require the opcode member to be set correctly. Two cases are not covered:

An appropriate solution for the latter case would be to provide a constructor that does not require an opcode, and infers it automatically. This can be tracked in a new issue if there is a need for it.