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
Need support for SDCC syntax on index-registers and explicit accumulator #33
Comments
I'm not familiar with SDCC... I think I can fin some source code examples, but I'd like to known which of the following are allowed:
Thanks! |
Great!
As for point 2: I have not used that one before, but I tested, and it works (makes sense as symbols probably are fixed up front in a preprosessor). Point 3: Same here, not tested it before today, but it works. This is a general substitution made across the board for the index registers. So, it affects all places where there is a reference, like "iy+n" (or "iy-n") and "ix+n" (or "ix-n"). We can get the overview of the commands if we write "iy+" and "ix+" in the search field on this page: Also, I just realised another peculiar thing with SDCC output: Some instructions have the accumulator explicitly stated, like these:
The extension does not recognise these either. I've tried to find information about this syntax, but couldn`t really find anything so far. I will try to reach out to the SDCC devs and ask if there is any documentation on this. Thank you, so far! |
Thanks for the info! |
I got this from SDCC:
And indeed, what I just descibed to you is documented fully on that page under "Z80 INSTRUCTION SET". |
If I'm understading it right, their syntax is arguably sick :D But it makes parsing actually easier, so here we go! |
Hmm, those dec and inc with included reference to the accumulator is indeed strange, and does not make sense (as A-reg is not part of the command...). I have lots of code produced by SDCC, and they don't use that as output, they use the normal variant in the second column. Same with RL*/RR*/SL*/SR*, SDCC outputs the second column so far in all my code . So, no, parsing not easier :-) I guess this means that it can accept both as input, but what it produces (from C code) is a mix of the two. |
Would you mind testing this build: z80-asm-meter-1.4.0-nightly.zip ? |
Nice, I can test. But I have some news too. This seemed so stupid that I had to give them a try. It was too early to conclude and this is the result from what SDCC accepts as input (from "Implicit Operand Instructions"):
All but two, actually. Strange again. But this is real life testing :) |
I would have to do a more thorough test later. One thing is testing the new stuff, that is easy. What about testing not breaking existing stuff? Do you have that covered, or should I do an overall test? That said, I tend to use a lot of spaces or tabs to align commands and make them easily readable, so I spotted this one:
(8 MSX cycles) is not the same as
(21 MSX cycles) |
Don't worry too much about overall testing; explicit accumulator syntax may affect existing code (but manual tests seems to look ok), and index register indirections code shouldn't affect existing code... This should fix the issues with spacing: z80-asm-meter-1.4.0-nightly.zip (btw, are artifacts from actions publicly downloadable?) I'll be offline until wednesday, so if you find anything else wrong with the SDCC syntax detection, please let me a note here in the issue. On wednesday, if everything seems OK, I'll make a new release :D Thank you very much! |
I did testing on the new ones. Most of them work, but the following either show nothing, or show the wrong timing / identification:
(same of IX) I did some random testing of other stuff too. I found some shortcomings when it comes to spaces inside parenthesis:
|
Oops... There was a missing |
Great! I have checked the ones I reported, and they all work well :) Thank you. This looks good now👍 |
Release 1.4.0 published with SDCC syntax support. |
SDCC is a widely used compiler (http://sdcc.sourceforge.net/). It produces asm files (from C), and accepts asm-files. It has a special syntax on the index-registers:
I'm citing Konamiman here:
Currently, when using SDCC-code, and the extension comes across this produced code:
`
`
... there are two lines which the extension doesn't count, and it is hard to get the overview of the total time spent.
Gettting support for this would make a great extension even better :-)
The text was updated successfully, but these errors were encountered: