You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
numbered labels with forward/backward references. This allows things like cmp #7; beq 1f; jsr fnord; .1 without needing to open a scope or think about a label name.
Would probably be a good idea to discuss possible syntax over on stardot for something like this, though if one syntax turns out to be much easier to implement than another that would be a strong argument for it IMO. :-)
A reference to a label consisting of nothing but '+'s always resolves to the next such label in the code, and a label consisting of nothing but '-'s always resolves to the previous such label in the code. It's not an error to have multiple '+'/'-' labels with the same name, because this rule means they're not ambiguous.
Mentioned in passing by davidgiven in #32:
Would probably be a good idea to discuss possible syntax over on stardot for something like this, though if one syntax turns out to be much easier to implement than another that would be a strong argument for it IMO. :-)
As a random thought, the ACME assembler (https://github.com/martinpiper/ACME) uses '+' and '-' symbols for this, e.g.
A reference to a label consisting of nothing but '+'s always resolves to the next such label in the code, and a label consisting of nothing but '-'s always resolves to the previous such label in the code. It's not an error to have multiple '+'/'-' labels with the same name, because this rule means they're not ambiguous.
(Code fragment taken from PLASMA: https://github.com/dschmenk/PLASMA)
The text was updated successfully, but these errors were encountered: