Specy/asm-editor

Labels without colon

Opened this issue · 6 comments

Labels with colons are not mandatory in 68000 assembler but it seems that they are in your asm-editor. Could this requirement be eliminated to avoid having to add the colon to all labels in order to adapt the code to your editor?

Thanks

Which assembler are you taking as reference? I'm using easy68k

Ok i used easy68k and this seems to be expected behaviour too

    bra test
    move.l #20, d0
test
    move.l #10, d0

this works.

i'm not sure what the grammar of m68k is at this point, i don't know how i could differentiate between instructions and labels. I should do a rewrite of the lexer/parser of the interpreter but i don't have much time lately, i'll keep this in consideration for the future though. If you have resources or information about this, share them here and i'll look at them

From Easy68k Help:

Label Field
A label is used to identify a location in a program or a memory location by name. Instructions or directives that require a location may use a label to indicate the location. A label normally begins in the first column of the line. It must be terminated with a space, tab or a colon. If a colon is used it does not become part of the label. If a label does not start in the first column it must be terminated with a colon.

Ah that assumes that instructions are always one tab indented and can't be on the start of the line, I'm not sure if I want that behavior

Ok, but that's the official behavior of Motorola's original MASM. You can read it in section 2.4.1

Yes I saw, to implement that I'd have to redo the lexer/parser from scratch since it's pretty bad for now and doesn't support such things. I don't have much time to do that lately so I'll delay this for when I have the time, which might be a few months

I'll keep this issue open to track the feature