From: Lukas Krickl Date: Thu, 21 Dec 2023 03:56:24 +0000 (+0100) Subject: Fixed comments not working after .db X-Git-Url: https://git.krickl.dev/?a=commitdiff_plain;h=fc5079a13ba8e1a8785c4af234fa456975f775c9;p=ulas%2F.git Fixed comments not working after .db --- diff --git a/src/ulas.c b/src/ulas.c index e7dd2c4..a47d74c 100644 --- a/src/ulas.c +++ b/src/ulas.c @@ -2280,6 +2280,11 @@ int ulas_asmdirbyte(FILE *dst, const char **line, unsigned long n, int *rc) { break; } } while (*rc != -1 && t.type == ','); + + // go back one byte if the token was a comment + if (t.type == ULAS_TOK_COMMENT) { + *line = *line - strlen(ulas.tok.buf); + } return written; } diff --git a/tests/t0.bin b/tests/t0.bin index bc8c7f2..8d8083d 100644 Binary files a/tests/t0.bin and b/tests/t0.bin differ diff --git a/tests/t0.s b/tests/t0.s index 03fd48e..fcfc303 100644 --- a/tests/t0.s +++ b/tests/t0.s @@ -123,3 +123,4 @@ l3: .db 1 jp hl ld a, 4/2 +.db 1 ; comment