santiontanon / mdlz80optimizer

MDL (a Z80 assembler optimizer)
Apache License 2.0
81 stars 6 forks source link

Sjasmplus directives causes error #52

Closed svenyurgensson closed 1 month ago

svenyurgensson commented 4 months ago

Hi once again!

I have such lines in my assembly:

DEVICE ZXSPECTRUM128
SLDOPT COMMENT WPMEM, LOGPOINT, ASSERTION

...
SAVEBIN 'main.bin', main

also I have this option -dialect sjasmplus

Running optimizer I get:

ERROR: parseRestofTheLine: Cannot parse line main.asm#2:         SLDOPT COMMENT WPMEM, LOGPOINT, ASSERTION  left over tokens: [WPMEM, ,, LOGPOINT, ,, ASSERTION]
...
ERROR: Unsupported save command SAVEBIN

Also it just silently removes directive DEVICE ZXSPECTRUM128 from generated output

svenyurgensson commented 4 months ago

Also, it would be very handy if optimizer would add commented messages about optimized instructions in output asm at the optimized place

santiontanon commented 4 months ago

Thanks for the suggestions! Indeed, not all sjasmplus directives are supported yet, but I'll take a note of these ones and add as soon as possible. I'll keep this issue open until I fix it. Thanks!

And the second suggestion is also a great one, I'll make a note of that to add asap too!

santiontanon commented 1 month ago

Sorry this took so long, but the original problem should be fixed with this commit: https://github.com/santiontanon/mdlz80optimizer/commit/ece5fc03e5ddfafd1af6bf98c208c5cf23014c59

It'll be included in the next release (that I am planning to upload to morrow if all goes well)