From 202ca788009978a204dbb0d6892eea89315828d5 Mon Sep 17 00:00:00 2001 From: Devine Lu Linvega Date: Sun, 25 Feb 2024 16:06:54 -0800 Subject: [PATCH] (uxnasm) Added support for partial label jsi --- projects/examples/gui/timer.tal | 4 ++-- src/uxnasm.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/projects/examples/gui/timer.tal b/projects/examples/gui/timer.tal index 34837d6..3c387f2 100644 --- a/projects/examples/gui/timer.tal +++ b/projects/examples/gui/timer.tal @@ -32,9 +32,9 @@ BRK &on-second ( -> ) [ LIT2 00 _&frame ] STR - [ LIT2 ff &time $1 ] ADD DUP ?{ Timer/end } + [ LIT2 ff &time $1 ] ADD DUP ?{ /end } ,&time STR - Timer/ BRK + / BRK &start ( -- ) [ LIT2 0f _&time ] STR [ LIT2 00 _&paused ] STR diff --git a/src/uxnasm.c b/src/uxnasm.c index 367b0db..e2a1a00 100644 --- a/src/uxnasm.c +++ b/src/uxnasm.c @@ -195,7 +195,7 @@ makereference(char *scope, char *label, char rune, Uint16 addr) if(label[0] == '{') { p.lambda_stack[p.lambda_ptr++] = p.lambda_count; scpy(makelambda(p.lambda_count++), r->name, 0x40); - } else if(label[0] == '&') { + } else if(label[0] == '&' || label[0] == '/') { if(!sublabel(subw, scope, label + 1)) return error("Invalid sublabel", label); scpy(subw, r->name, 0x40); @@ -502,7 +502,7 @@ main(int argc, char *argv[]) if(argc == 1) return error("usage", "uxnasm [-v] input.tal output.rom"); if(argv[1][0] == '-' && argv[1][1] == 'v') - return !fprintf(stdout, "Uxnasm - Uxntal Assembler, 24 Feb 2024.\n"); + return !fprintf(stdout, "Uxnasm - Uxntal Assembler, 25 Feb 2024.\n"); if(!(src = fopen(argv[1], "r"))) return !error("Invalid input", argv[1]); if(!assemble(src))