From 261b574671bb8ca4a1edac1ea00af078854ff04b Mon Sep 17 00:00:00 2001 From: neauoire Date: Wed, 9 Nov 2022 16:21:07 -0800 Subject: [PATCH] (uxnasm) Added support for = and - runes --- src/uxnasm.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/uxnasm.c b/src/uxnasm.c index 5f9b228..3243b8a 100644 --- a/src/uxnasm.c +++ b/src/uxnasm.c @@ -316,9 +316,14 @@ parse(char *w, FILE *f) if(!writeshort(0xffff, 1)) return 0; break; case ':': /* raw short absolute */ + case '=': makereference(p.scope, w, p.ptr); if(!writeshort(0xffff, 0)) return 0; break; + case '-': /* raw byte absolute */ + makereference(p.scope, w, p.ptr); + if(!writebyte(0xff)) return 0; + break; case '"': /* raw string */ i = 0; while((c = w[++i])) @@ -375,6 +380,7 @@ resolve(void) l->refs++; break; case ';': + case '=': if(!(l = findlabel(r->name))) return error("Unknown absolute reference", r->name); p.data[r->addr + 1] = l->addr >> 0x8; @@ -384,10 +390,16 @@ resolve(void) case ':': if(!(l = findlabel(r->name))) return error("Unknown absolute reference", r->name); - p.data[r->addr + 0] = l->addr >> 0x8; + p.data[r->addr] = l->addr >> 0x8; p.data[r->addr + 1] = l->addr & 0xff; l->refs++; break; + case '-': + if(!(l = findlabel(r->name))) + return error("Unknown absolute reference", r->name); + p.data[r->addr] = l->addr & 0xff; + l->refs++; + break; default: return error("Unknown reference", r->name); }