Z80 Assembly Meter v3.0.0

Door jltursan

Prophet (2619)

afbeelding van jltursan

01-03-2022, 19:07

A couple of days ago, a new version of this great VSCode extension has been released with a new cool addition: user-defined macros metering.

All in all works fine; but I've found a little annoyance that maybe it's intented; but it's giving me some headaches.
The mnemonic "ex af,af" is no more a valid one and now a strict syntax, "ex af,af'" (notice the single quote) is needed to be metered.
Since long time, none of my code uses the "strict" version as the single quote has been always problematic with other editors and their syntax highlihgtning schemes; so I wonder, it's definitely a bug or it's really on purpose?

Aangemeld of registreer om reacties te plaatsen

Van Bengalack

Hero (594)

afbeelding van Bengalack

01-03-2022, 19:18

Just a small comment: Workaround: For the highlighting issue, which happens to me in asm inlined in C, I always add a comment like this:

; '// comment here

Like this:

  ex af, af' ; '// comment here

works for me Smile

Van jltursan

Prophet (2619)

afbeelding van jltursan

01-03-2022, 20:53

Haha, thanks!, it mostly works; but the comment highlightning is lost now! (this is using Notepad++). Using the following I'm near of a perfect syntax rendering:

ex af,af' ; ' ; comment here

Smile

Anyway, I've opened an issue in the project github; so let's see...

Van theNestruo

Champion (351)

afbeelding van theNestruo

01-03-2022, 21:04

jltursan wrote:

A couple of days ago, a new version of this great VSCode extension has been released with a new cool addition: user-defined macros metering.

Hi, jltursan!
I don't use macros, so this feature is a little bit experimental. Please feel free to send me any issue Smile

jltursan wrote:

All in all works fine; but I've found a little annoyance that maybe it's intented; but it's giving me some headaches.
The mnemonic "ex af,af" is no more a valid one and now a strict syntax, "ex af,af'" (notice the single quote) is needed to be metered.
Since long time, none of my code uses the "strict" version as the single quote has been always problematic with other editors and their syntax highlihgtning schemes; so I wonder, it's definitely a bug or it's really on purpose?

Uh? It's not on purpose, but I don't know what change could have caused this in this version.
I guess you are an SjASMPlus user. I'm reviewing the code and I think the behaviour change could have been caused by a change in version 2.1.0: "Configuration property sjasmplusFakeInstructions renamed to sjasmplus". Check your settings.json and add "z80-asm-meter.sjasmplus": true. You'll probably find the old setting and it will appear dimmed as it not longer exists. Sorry for the inconvenience!
With that setting, ex af,af', ex af, af, ex af, and exa should be properly recognized (as well as any other SjASMPlus alternative syntax and fake instructions)

Van jltursan

Prophet (2619)

afbeelding van jltursan

02-03-2022, 08:58

Nope, I'm a sjAsm (without plus) user and I've found the issue right after updating the extension. Of course I can be wrong; but I've been using the last version for a long time and I think I've metered a lot of "ex af,af" lines without problems before.

I'll try your suggestion and I'll report back the results ASAP!, thanks for this uber-cool extension! Smile

Van theNestruo

Champion (351)

afbeelding van theNestruo

02-03-2022, 10:07

You are probably right. When I added support for SjASMPlus fake instructions I probably removed some of those alternate syntax from "standard" z80 instruction set as they appeared now in the "SjASMPLus instruction set".
I have been checking Sjasm 0.42 manual and, curiously, "ex af,af" is not documented! And it seems that there is a lot of sacrilegious syntax the extension does not support yet!!
I'll try to take a look at it this evening to restore the basic Sjasm alternate syntax without requiring the configuration setting to be set.
Alternative flag syntax, extended instructions (++ and --) and negative conditions will have to wait, as they require more changes in the base code (Are they commonly used, btw?)
Thank you very much for your reports!
Happy coding!

Van jltursan

Prophet (2619)

afbeelding van jltursan

02-03-2022, 13:24

Cool!, about extended instructions, I'm specially using the "repeated" shortcut:

[8] OUTI ; 8 x OUTI instructions

Van jltursan

Prophet (2619)

afbeelding van jltursan

02-03-2022, 18:53

Just to let you know that enabling the alternate Sjasmplus setting, the extension works as before, "EX AF,AF" is being parsed and metered correctly Smile

Van theNestruo

Champion (351)

afbeelding van theNestruo

02-03-2022, 19:18

jltursan wrote:

Just to let you know that enabling the alternate Sjasmplus setting, the extension works as before, "EX AF,AF" is being parsed and metered correctly Smile

Great!
I plan on improve Sjasm support (with emphasis on Sjasm/SjASMPlus differences), but it will take some time so let's use that setting meanwhile Smile
Thank you for reporting!

Van theNestruo

Champion (351)

afbeelding van theNestruo

08-07-2022, 12:22

jltursan wrote:

Cool!, about extended instructions, I'm specially using the "repeated" shortcut:

[8] OUTI ; 8 x OUTI instructions

Added support for both Sjasm (brackets) and SjASMPlus (dot) repeat count. Please let me know if you experience any issue.

The full set of features (repeat counts, expressions, and iterators (%)) is not supported at the moment at the moment, but I can give them a try if they are widely used.

Edit:

theNestruo wrote:

I plan on improve Sjasm support (with emphasis on Sjasm/SjASMPlus differences), but it will take some time so let's use that setting meanwhile Smile

Oops, I completely forgot about this!!!

Van Metalion

Paragon (1529)

afbeelding van Metalion

08-07-2022, 14:52

FYI, the higlighting works correcly in Notepad++ if you use the quote:
a af b bc c d de e h hl i ix ixh ixl iy iyh iyl l r sp "af'"