From 6ba2af5c624aa946e84edf0fae20068da3ace5bf Mon Sep 17 00:00:00 2001 From: Andrew Alderwick Date: Sun, 28 Nov 2021 18:07:10 +0000 Subject: [PATCH] Avoid combining literals across | or $ pads. --- projects/library/asma.tal | 2 ++ src/uxnasm.c | 2 ++ 2 files changed, 4 insertions(+) diff --git a/projects/library/asma.tal b/projects/library/asma.tal index e038a62..1837de9 100644 --- a/projects/library/asma.tal +++ b/projects/library/asma.tal @@ -641,9 +641,11 @@ #00 JMP2r @asma-pad-absolute + ;asma-flush-lit JSR2 #0000 ,asma-pad-helper JMP @asma-pad-relative + ;asma-flush-lit JSR2 ;asma/addr LDA2 ( fall through ) diff --git a/src/uxnasm.c b/src/uxnasm.c index 3134ff1..12c4a03 100644 --- a/src/uxnasm.c +++ b/src/uxnasm.c @@ -254,11 +254,13 @@ tokenize(char *w, FILE *f) if(!sihx(w + 1)) return error("Invalid padding", w); p.ptr = shex(w + 1); + litlast = 0; break; case '$': /* pad-relative */ if(!sihx(w + 1)) return error("Invalid padding", w); p.ptr += shex(w + 1); + litlast = 0; break; case '@': /* label */ if(!makelabel(w + 1))