From e7f234f55b1998c899c60a3796ea1e0a6c3446b8 Mon Sep 17 00:00:00 2001 From: Andrew Alderwick Date: Wed, 21 Apr 2021 21:01:50 +0100 Subject: [PATCH] Reinstated check for labels in zero page --- projects/examples/gui.animation.usm | 2 +- src/assembler.c | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/projects/examples/gui.animation.usm b/projects/examples/gui.animation.usm index 5f22138..9f2b988 100644 --- a/projects/examples/gui.animation.usm +++ b/projects/examples/gui.animation.usm @@ -3,7 +3,7 @@ |00 @System [ &vector $2 &pad $6 &r $2 &g $2 &b $2 ] |20 @Screen [ &vector $2 &width $2 &height $2 &pad $2 &x $2 &y $2 &addr $2 &color $1 ] -|0100 +|0000 @dvd [ &x $2 &y $2 &dx $1 &dy $1 ] diff --git a/src/assembler.c b/src/assembler.c index 9e9af37..645e98e 100644 --- a/src/assembler.c +++ b/src/assembler.c @@ -233,6 +233,8 @@ parsetoken(char *w) Label *l; Macro *m; if(w[0] == '.' && (l = findlabel(w + 1))) { /* zero-page */ + if(l->addr > 0xff) + return error("Address is not in zero page", w); pushbyte(l->addr, 1); return ++l->refs; } else if(w[0] == ',' && (l = findlabel(w + 1))) {