Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Labels without colon #15

Open
Ful9en opened this issue Feb 26, 2024 · 6 comments
Open

Labels without colon #15

Ful9en opened this issue Feb 26, 2024 · 6 comments

Comments

@Ful9en
Copy link

Ful9en commented Feb 26, 2024

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

Copy link
Owner

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

Copy link
Owner

Feb 27, 2024

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

@Ful9en
Copy link
Author

Ful9en commented Feb 27, 2024

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.

Copy link
Owner

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

@Ful9en
Copy link
Author

Ful9en commented Feb 28, 2024

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

Copy link
Owner

Feb 29, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants