GLASS malfunction?

Door thegeps

Paragon (1125)

afbeelding van thegeps

13-09-2022, 20:21

Exception in thread "main" nl.grauw.glass.expressions.EvaluationException: Not an instruction.
[at shadow.asm:1976]
set 0,l
at nl.grauw.glass.expressions.Expression.getInstruction(Expression.java:65)
at nl.grauw.glass.Line.getInstruction(Line.java:76)
at nl.grauw.glass.Line.expand(Line.java:91)
at nl.grauw.glass.Source.expand(Source.java:74)
at nl.grauw.glass.Source.expand(Source.java:68)
at nl.grauw.glass.Source.assemble(Source.java:50)
at nl.grauw.glass.Assembler.writeObject(Assembler.java:72)
at nl.grauw.glass.Assembler.main(Assembler.java:59)

what happened here? I've assembled this rom hundreds of time today and suddenly happened this. I'm not able to assemble my code anymore (if I comment this set instruction Glass doesn't like other ones too, like the ones present in arkos tracker code)

Aangemeld of registreer om reacties te plaatsen

Van Grauw

Ascended (10635)

afbeelding van Grauw

13-09-2022, 20:30

Do you perhaps happen to have a label named set in your code?

Otherwise, can you send me a test case? Email is in my profile.

Van thegeps

Paragon (1125)

afbeelding van thegeps

13-09-2022, 20:44

LoL how stupid I am XD
I really named a label as "set:"
Thank you for your fast answer Grauw Smile

Van santiontanon

Paragon (1698)

afbeelding van santiontanon

14-09-2022, 13:42

Hehe, I think it would be useful to print warnings when labels named after a mnemonic or a register name are defined. I was just testing my own assembler this past weekend on a codebase where they had defined constants "L", "R", "U", "D" for the directions of the joystick, and I feel it was compiling in the original assembler they used by pure chance (probably relying on upper/lower case for defaulting to the label or register), with the name clashes with registers "l", "r" and "d"!