asm-lsp icon indicating copy to clipboard operation
asm-lsp copied to clipboard

Add Z80 Support

Open WillLillis opened this issue 1 year ago • 2 comments

Note: Keeping this as a draft for now. Before it's ready I'd like to:

  • ~~Sync this branch up with the pending changes in the other PRs~~ Just should be merged after #68
  • ~~Create an internal TargetConfig-like struct with all optional fields. Use this to deserialize config files and then translate any missing fields to "false" in the actual TargetConfig. This way we can add the Z80 as a configuration option without breaking anyone's existing config files.~~ In my own testing, having the extra z80 field under instruction sets doesn't prevent deserializing of the TargetConfig struct using an older version of the lsp.
  • ~~Do a more thorough read over, taking out TODO comments, cleaning things up, etc.~~ Done!

This PR will add support for the Zilog Z80 CPU. Hover and autocomplete support for registers and instructions, as well as instruction signature help are included.

A huge thank you to @gilbertfrancois for writing the initial python script to translate instruction data from some of the online docs. I'll add some demo gifs for all the features once things are finalized, but I was kinda happy with this in particular:

Z80DocsDemo

The Z80 user manual has different sections for each instruction form, meaning the manual can be opened to any form's entry by adding a fragment to the url.

I realize this is very much on the long side of things, so no worries if it takes some time to review once it's ready. If anything's too messy/ needs to be refactored I'm more than happy to take another pass at it.

Closes #39

WillLillis avatar Jan 07 '24 03:01 WillLillis

Thank you so much for adding Z80 support. I don't know how to proceed from here. If there is anything that I can add or contribute, let me know.

gilbertfrancois avatar Jan 07 '24 11:01 gilbertfrancois

The features shown in the GIF are amazing! I can't wait having this functionality in the final asm-lsp! Well done @WillLillis.

gilbertfrancois avatar Jan 07 '24 12:01 gilbertfrancois