-
-
Notifications
You must be signed in to change notification settings - Fork 12
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
Add support for Z80 instruction sets #39
Comments
This sounds like a very cool thing to add to the project! From what I can tell, the majority of the work is going to be translating/condensing the documentation you linked into a .xml file for the instructions and another for the registers. I should have time to work on this in the next month or so, but if you want to get started sooner by all means open up a PR :) |
Hi @gilbertfrancois . I had some free time today and got hover support and autocomplete for Z80 registers working in a development branch. Here's an example gif: For now, the information provided for each register is the long-form description provided by the owner's manual. As this is quite lengthy, would it would be better to have a more concise description? Do you have any resources that would better reflect the information you'd like to see in a register hover response? If not, I can just use my best judgement to try and pare things down :) I'm planning on tackling instruction hover support next, but that may be a bit. As a quick aside, I think I found a mistake in the owner's manual. On page 21 in Figure 2, row 2, |
This is amazing! Well done and so swift. It looks really cool in the animated GIF. The wikipedia page has a one sentence short summary of each register, which might be better suitable for an autocomplete hover menu. I agree that the description from the owner's manual is a bit lengthy. What do you think? https://en.wikipedia.org/wiki/Zilog_Z80#Registers You are right about the typo in the manual: the registers AF, BC, DE, HL have a shadow register, called A'F', B'C', D'E', H'L'. To answer your question: B'B' should be B'C'. The aforementioned wikipedia link has a better figure showing the registers. For the instructions and opcodes, Grauw has a nice table of all (documented) instructions. Only the description is missing from that table. I might figure out the needed xml structure today and make a pull request later. |
Thank you! Those Wikipedia descriptions seem a lot better for this use case. I'll pull those together into the xml soon (hopefully tomorrow). The Grauw link looks very promising! After an initial read, it looks like all the entries in that table would map nicely to the the |
@gilbertfrancois Quick update here. I had initially set out a bit too ambitiously regarding parsing the various forms and their associated arguments for the Z80 instructions into distinct types. While I'll be able to go back and add this later if need be, for the purposes of hover display a string of the instruction signature should be just fine. I went through the branch and made this change, and actually made some significant progress! There's still a bit for me to iron out, and I'll need to wait for some of the pending PRs to go through so this branch can get updated with whatever fixes they need before merging, but the majority of the work for this feature is done. :) Thanks so much for your patience! Hover support for instructions (kind of) working: Autocomplete for instructions working: |
Thank you @WillLillis for the great work. I've installed the latest master branch in neovim. Maybe a silly question, but how do I set the asm-lsp "flavour" to z80? It still defaults to x86 instructions in the autocomplete and popup panels. |
Hey @gilbertfrancois! You should be able to set asm-lsp to work just with z80-related stuff by specifying it in your config file, version = "0.1"
[assemblers]
gas = false
go = false
z80 = true
[instruction_sets]
x86 = false
x86_64 = false
z80 = true |
Perfect. It works! |
The Zilog Z80 is a legendary 8-bit microprocessor renowned for its versatility and widespread use in the retro computing era. Introduced in the late 1970s, it became a cornerstone in various iconic systems of that time, notably the MSX, Amstrad CPC, Sinclair ZX80, ZX81, ZX Spectrum, Gameboy, Enterprise, Sam Coupe, and the CP/M-based computers like the Osborne 1 and Kaypro.
The Z80 assembly language continues to inspire a vibrant community of developers who craft remarkable games and applications for retro platforms. Despite the passage of time, these dedicated programmers harness the Z80's capabilities to create engaging content that captivates audiences on classic systems like the Sinclair ZX Spectrum, the Amstrad CPC, MSX and more.
Here are some references about the cpu and its instruction set:
The text was updated successfully, but these errors were encountered: